Raspberry Piでネットワーク構築/PXEブート

提供: Medeshima wiki
ナビゲーションに移動 検索に移動

概要

設定

シリアル

$ cat /proc/cpuinfo | grep Serial

ネットワークブート

Raspberry Pi 4 Model B

$ sudo raspi-config

Advanced Options -> Boot Order -> Network Boot

$ vcgencmd bootloader_config | grep BOOT_ORDER
BOOT_ORDER=0xf21

Raspberry Pi 3 Model B

$ vcgencmd otp_dump | grep 17:
17:3020000a

TFTPサーバ

  • /etc/dnsmasq.conf
pxe-service=0,"Raspberry Pi Boot"
enable-tftp
tftp-root=/tftpboot

$ sudo cp -r /boot/* /tftpboot

  • /tftpboot/cmdline.txt
console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.0.1:/nfsroot/raspberrypi,vers=4.1,proto=tcp rw ip=dhcp rootwait

NFSサーバ

  • /etc/exports
/nfsroot/raspberrypi 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)
/tftpboot 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)

  • /nfsroot/raspberrypi/etc/fstab
192.168.0.1:/tftpboot /boot nfs defaults,vers=4.1,proto=tcp 0 0