Created
February 13, 2021 04:10
-
-
Save cfallin/c6babd18f74993d5ad8dd02b7f37a4bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Install a Debian filesystem using debootstrap on your NFS server (normal x86 | |
Linux machine, for example): | |
$ debootstrap --arch=arm64 sid /home/pi | |
- Install qemu-aarch64 on host system and set up binfmt_misc to allow for | |
chroot | |
- depends on host system; Fedora and Arch have packages for this | |
- no need to get arm64 libraries on host as the chroot will take care | |
of this (but qemu binary should be static) | |
- Set up via chroot: | |
- chroot arm64-root/ | |
- vim /etc/fstab: add nfs root | |
10.1.1.1:/home/pi / nfs rw,tcp,nolock 0 0 | |
- set root password; add users | |
- install a kernel | |
apt install linux-image-5.9.0-4-arm64 | |
- install other packages as desired | |
- Add rpi to DHCP config (this is OpenBSD dhcpd syntax; adjust if needed): | |
host pi.my.network { | |
hardware ethernet 01:23:45:67:89:ab; # your Pi's MAC here | |
fixed-address 10.1.1.2; # your chosen IP address here | |
option host-name "pi.my.network"; | |
allow booting; | |
allow bootp; | |
option tftp-server-name "10.1.1.1"; | |
option bootfile-name "bootcode.bin"; | |
option dhcp-class-identifier "PXEClient"; | |
option vendor-encapsulated-options "Raspberry Pi Boot"; | |
} | |
- Set up tftp on machine named by tftp-server-name | |
- create a directory /var/lib/tftpboot/<RPi serial> | |
(watch the logs the first time to find this path) | |
- in this directory, extract the latest rpi4 firmware | |
- should see a bunch of *.dtb files and start*.elf | |
- copy vmlinuz and initrd.img from Debian filesystem's /boot | |
- create config.txt: | |
hdmi_safe=1 | |
arm_64bit=1 | |
upstream_kernel=1 | |
dtoverlay=upstream-pi4 | |
kernel=vmlinuz-5.9.0-4-arm64 | |
initramfs initrd.img-5.9.0-4-arm64-netboot followkernel | |
- create cmdline.txt: | |
root=/dev/nfs nfsroot=10.1.1.1:/home/pi console=tty1 rootwait | |
- optional: readonly NFS root (allows sharing between multiple Pis): | |
- edit fstab: rw -> ro for NFS mount | |
- add fstab entries: | |
none /tmp tmpfs defaults 0 0 | |
none /var/tmp tmpfs defaults 0 0 | |
none /var/log tmpfs defaults 0 0 | |
none /var/run tmpfs defaults 0 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment