Netbooting Raspberry Pi: Difference between revisions

From Alpine Linux
(Instruction for netbooting Pi devices)
 
m (updated see also link)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Draft| it contains some outdated information}}
{{Draft|Consult [[#See also|Official Reference pages]] for Pi 3B, 3B+, 2B v1.2, 4, 5 for updated information.}}
 
The Raspberry Pi 4 bootloader can be configured to [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration boot from the network]. Configure the bootloader with at least
The Raspberry Pi 4 bootloader can be configured to [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration boot from the network]. Configure the bootloader with at least


Line 22: Line 23:
# <code>vmlinuz-rpi4</code> (from [https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4 alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4])
# <code>vmlinuz-rpi4</code> (from [https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4 alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4])


<code>config.txt</code>:
The config files can be as follows {{Cat|config.txt|<nowiki>[pi4]
{{cmd|<nowiki>[pi4]
kernel=vmlinuz-rpi4
kernel=vmlinuz-rpi4
initramfs initramfs-rpi4
initramfs initramfs-rpi4
Line 29: Line 29:
</nowiki>}}
</nowiki>}}


<code>cmdline.txt</code>:
 
{{cmd|<nowiki>modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4</nowiki>}}
{{Cat|cmdline.txt|<nowiki>modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4</nowiki>}}


Instead of using the <nowiki>http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/</nowiki> base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.
Instead of using the <nowiki>http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/</nowiki> base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.


With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.
With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.
== See also ==
* [[Raspberry Pi|Main Raspberry Pi page]]
* [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#network-booting Official Reference page1]
* [https://www.raspberrypi.com/documentation/computers/remote-access.html#network-boot-your-raspberry-pi Official Reference page2]
* [[Netboot Alpine Linux using iPXE]]
* [https://www.reddit.com/r/raspberry_pi/s/HeKIlLoy7j Reddit post PXE Booting to a Raspberry Pi 4 ]
[[Category: Raspberry]]

Latest revision as of 09:21, 10 May 2025

This material is work-in-progress ...

Consult Official Reference pages for Pi 3B, 3B+, 2B v1.2, 4, 5 for updated information.
(Last edited by Prabuanand on 10 May 2025.)

The Raspberry Pi 4 bootloader can be configured to boot from the network. Configure the bootloader with at least

BOOT_ORDER=0xf142 TFTP_PREFIX=1

and optionally also

TFTP_IP=x.x.x.x

where x.x.x.x is the IP address of your TFTP server.

If not configuring TFTP_IP in the bootloader, you'll need to configure your DHCP server to advertise the TFTP server IP address. This varies depending on your DHCP server; use the following details if applicable:

  1. Vendor class: PXEClient:Arch:00000:UNDI:002001
  2. Filename: /

The minimal set of files that your TFTP server needs to host are:

  1. bcm2711-rpi-4-b.dtb (from raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb)
  2. cmdline.txt (see below)
  3. config.txt (see below)
  4. fixup4.dat (from raspberrypi/firmware/master/boot/fixup4.dat, alternatively fixup4cd.dat for the cut down version)
  5. initramfs-rpi4 (from alpine/edge/releases/aarch64/netboot/initramfs-rpi4)
  6. start4.elf (from raspberrypi/firmware/master/boot/start4.elf, alternatively start4cd.elf for the cut down version)
  7. vmlinuz-rpi4 (from alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4)

The config files can be as follows

Contents of config.txt

[pi4] kernel=vmlinuz-rpi4 initramfs initramfs-rpi4 arm_64bit=1


Contents of cmdline.txt

modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4

Instead of using the http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/ base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.

With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.

See also