This should work fine when booting to in ARMv7
mode (32bit) - currently only version of RetroPie.
AArch64
mode (64bit) uses U-Boot and I couldn't set it up yet...
-
Install Raspbian to an SD Card and boot your Raspberry Pi 4
TODO
-
Find your Raspberry Pi 4 serial number, will be referred to as
$SERIAL
laterTODO
-
Enable Network Booting for Raspberry Pi
TODO
-
Setup NFS shares for boot and root partitions on the NFS server
192.168.0.10:/tftpboot/$SERIAL/ # /boot 192.168.0.10:/pi4-$SERIAL/ # /
With network booting enabled Raspberry Pi tries to load files from
/tftpboot/$SERIAL/
by default. It's configurable with DHCP options but lets
stick to defaults here.
-
Setup TFTP server (eg dnsmasq, dhcpd, opentftpd, etc) on NFS server for /tftpboot
-
Setup your DHCP server to provide DHCP options for you Raspberry Pi 4
# vendor-specific option-43='Raspberry Pi Boot ' # trailing spaces, very important # vendor-class option-60='PXEClient' # tftp-server-name option-66='192.168.0.10' # NFS/TFTP server # in case your DHCP server and TFTP server are on different hosts
-
Setup directories
mkdir -p ~/raspberry/{iso,nfs}root/boot
-
Download latest Retropie image
cd ~/raspberry/ curl -sSLO https://github.com/RetroPie/RetroPie-Setup/releases/download/4.8/retropie-buster-4.8-rpi4_400.img.gz
-
Create loopback devices from partitions in the image, mount filesystems
sudo kpartx -v -a ~/raspberry/retropie-buster-4.8-rpi4_400.img sudo mount /dev/mapper/loop0p2 ~/raspberry/isoroot sudo mount /dev/mapper/loop0p1 ~/raspberry/isoroot/boot
-
Mount NFS shares
cd ~/raspberry sudo mount -t nfs 192.168.0.10:/pi4-$SERIAL/ ./nfsroot/ sudo mkdir -p nfsroot/boot sudo mount -t nfs 192.168.0.10:/tftpboot/$SERIAL/ ./nfsroot/boot/
-
Copy files from ISO into NFS
cd ~/raspberry sudo rsync -azv ./isoroot/ ./nfsroot/
-
Update
/boot/cmdline.txt
. Important bits areroot=/dev/nfs
,nfsroot=...
andip=dhcp
. I've disabled reduced logging for debugging boot issues, you can keeploglevel
andquiet
if you'd like.cd ~/raspberry sudo -e ./nfsroot/boot/cmdline.txt #contents console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.0.10:/pi4-$SERIAL ip=dhcp rw rootwait consoleblank=0 plymouth.enable=0
-
Update
/etc/fstab
cd ~/raspberry sudo -e ./nfsroot/etc/fstab #contents proc /proc proc defaults 0 0 192.168.0.10:/pi4-$SERIAL / nfs defaults 0 0 192.168.0.10:/tftpboot/$SERIAL /boot nfs defaults 0 0
-
Enable SSH
sudo ln -s /lib/systemd/system/ssh.service ./nfsroot/etc/systemd/system/sshd.service sudo ln -s /lib/systemd/system/ssh.service ./nfsroot/etc/systemd/system/multi-user.target.wants/ssh.service
-
Remove SD card from Raspberry Pi and attempt to network boot now.
-
You can SSH into your Raspberry Pi to finish configuring RetroPie