Raspberry Pi mit PXE booten (Network Boot)
Im OpenWRT-Router:
Network --> Interfaces --> LAN --> Edit --> DHCP-Server --> Advanced Settings:
TFTP Boot Server hinzufügen: 66,192.168.X.Y
Im OpenWRT-Router den TFTP-Server bekanntgeben: Network --> DHCP and DNS --> TFTP Server:
TFTP server root: leer lassen Network boot image pxelinux.0,,192.168.X.Y
Im Raspberry Pi:
cat >> /boot/config.txt << "EOFCONFIG" program_usb_boot_mode=1 EOFCONFIG reboot (Erfolg testen mit: $ vcgencmd otp_dump | grep 17 17:3020000a) # Zeile (nach verifiziertem Erfolg) wieder entfernen: sed -i 's/program_usb_boot_mode=1//g' /boot/config.txt
Im OpenWRT-Router:
Statische IP-Adresse vergeben (über Network --> DHCP and DNS --> Static Leases)
Raspberry Pi OS Lite herunterladen und ansehen:
# fdisk -l 2021-10-30-raspios-bullseye-armhf-lite.img Festplatte 2021-10-30-raspios-bullseye-armhf-lite.img: 1,84 GiB, 1954545664 Bytes, 3817472 Sektoren Einheiten: Sektoren von 1 * 512 = 512 Bytes Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes Festplattenbezeichnungstyp: dos Festplattenbezeichner: 0x8acef004 Gerät Boot Anfang Ende Sektoren Größe Kn Typ 2021-10-30-raspios-bullseye-armhf-lite.img1 8192 532479 524288 256M c W95 2021-10-30-raspios-bullseye-armhf-lite.img2 532480 3817471 3284992 1,6G 83 Lin
Hier wichtig: Sektorgröße (hier: 512 Bytes) und Anfangs-Bit (hier: 8192 bzw 532480)
Dateien extrahieren:
mount -t auto -o loop,offset=$((8192*512)) /pfad/zum/2021-10-30-raspios-bullseye-armhf-lite.img /tmp/mount/ bzw mount -t auto -o loop,offset=$((532480*512)) /pfad/zum/2021-10-30-raspios-bullseye-armhf-lite.img /tmp/mount/
--> Auf das NAS schieben!
Die cmdline.txt muss dann so aussehen:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.X.Y:/volume1/PXE/boot/c799f2b5/rootfs/,tcp,v3 vers=3 rw ip=dhcp rootwait elevator=deadline fsck.repair=yes splash