3

I am setting up a demo lab where I build a baby Openstack data center using MaaS and Juju with LXD hypervisors running ZFS. Here is my setup:

  • Macbook Pro i7, 16GB RAM
  • VMWare Fusion VM(s) running Ubuntu 16.04 with LXD
  • 4 Raspberry Pi's, version 3
  • 10/100 Ethernet switch
  • Thunderbolt Ethernet for bridging the Fusion network to the physical switch.

I would like to boot the Ubuntu 16.04 ARM64 image to the Pi's using MaaS, but am having a hard time finding instructions related to enabling PXE on the Pi. Does anyone know where I can find something more substantial than "it's supported" that I can reference?

Darth Vader
  • 4,206
  • 24
  • 45
  • 69
spyderdyne
  • 151
  • 1
  • 1
  • 6

3 Answers3

5

Documentation is now available to enable network boot from the wired network connection for the Raspberry Pi3.

Program USB Boot Mode

First, prepare the /boot directory with the latest boot files:
sudo apt-get update && sudo apt-get upgrade

Now, enable USB boot mode with the following command:
echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt

This adds program_usb_boot_mode=1 to the end of /boot/config.txt. Reboot the Raspberry Pi with sudo reboot. Once the client Raspberry Pi has rebooted, check that the OTP has been programmed with:

$ vcgencmd otp_dump | grep 17: 17:3020000a

Ensure the output 0x3020000a is correct.

The client configuration is almost done. The final thing to do is to remove the program_usb_boot_mode line from config.txt (make sure there is no blank line at the end). You can do this with sudo nano /boot/config.txt, for example.

Finally, shut the client Raspberry Pi down with sudo poweroff.

Source: Link

Glorfindel
  • 620
  • 1
  • 8
  • 15
Radu Herinean
  • 11
  • 1
  • 1
4

you don't PXE boot any Raspberry Pi except the Pi3 and Pi4

For Raspberry Pi 1, 2 and their variants, the short answer is that it is not supported.

but you can, sort of

The "firmware" on the RasPi GPU (yes it's (part of) the gpu that actually boots first and proceeds to bootstrap the cpu) will need to load its blobs from an inserted SD card - there's no way around this so you absolutely need an SD card inserted with a FAT32 partition and the right files on it.

After that, it's just software so sky's the limit. You can technically have a boot loader on the SD that proceeds to get the linux kernel and initial ramdisk with PXE - I don't know if such a thing actually exists but it is definitely possible to do.

If there is not a PXE enabled boatloader, you can prepare an SD card with just the binary blobs, the kernel and the ramdisk. Technically speaking you are not PXE booting, but you should be able to boot the kernel+ramdisk locally and then NFS-mount the root filesystem from a remote server. The SD card would need only a couple of megabytes of space and would be used strictly read-only, so I'd expect it to achieve a really long working life.

you can network boot the Pi3 and Pi4

The Raspberry Pi 3 introduced some new boot modes, including PXE over the on-board ethernet port. See PI 3 BOOTING PART II: ETHERNET for details.

tomodachi
  • 115
  • 5
Luke404
  • 229
  • 3
  • 7
  • Not supporting PXE for something that just begs to be an IOT device seems like an oversight. It hadn't even occurred to me that PXE wasn't included. Do you know where anyone has successfully done this? I have read your answer, but like the references you are citing that I have already read, you aren't providing any links to code or a documented solution. - Thanks – spyderdyne May 16 '16 at 18:38
  • @UwePlonus it was incomplete, not wrong: the very first words were "If nothing changed from the RasPi2 to the RasPi3". That was because at the time of writing (may '16) the Pi3 was already in the stores but details about its alternative boot modes were not published.

    I've now edited the answer to include PXE booting on the Pi3.

    – Luke404 Feb 28 '18 at 08:26
  • @Luke404: My other comment is obsolete after the edit therefore I'll remove it. – Uwe Plonus Feb 28 '18 at 09:39
2

The capability for USB/PXE boot is thought to be there and is said to work.

USB and PXE network boot

Even with the chip designed and taped out in March of last year, the Foundation had some final input for Broadcom in order to add two new features: direct USB mass storage and PXE network boot capabilities. “Gordon rewrote the boot ROM for the chip and then provided an updated boot ROM to Broadcom, saying ‘shove this in the chip, it’ll work’,” Eben laughs. “And it does!

See https://www.raspberrypi.org/magpi/pi-3-interview/

However I know of no evidence that any production Pis have had the new ROM software installed. I don't see how this could be retrofitted to existing Pis.


EDITED TO ADD

The current situation was said to be some form of USB boot by the end of April and PXE boot by the end of May.

Listen to http://thepipodcast.com/media/ThePiPodcast022.mp3 from minute 25.

Given that the end of April milestone has passed I'd take any dates with a pinch of salt.

joan
  • 71,024
  • 5
  • 73
  • 106
  • is there an option to add a USB NIC with PXE? – spyderdyne May 16 '16 at 18:36
  • The link you shared is something I had already read and was what gave me the impression that this was resolved somewhere already. Are you aware of any documented workarounds? I haven't found any yet. - Thanks – spyderdyne May 16 '16 at 18:40
  • @spyderdyne I don't see how there can be any workaround until Broadcom update the ROM in production SOCs. Perhaps they already have. I have seen no announcement though. I'd expect it to be blogged on raspberrypi.org first. – joan May 16 '16 at 18:57
  • I was hoping someone could cite some code examples as in the answer above, or maybe something clever like a model of USB NIC that does PXE or even some sort of GPIO extension module that I could use. - Thanks – spyderdyne May 18 '16 at 19:05
  • @spyderdyne I can only repeat what has already been said. You have to boot from the SD card currently. – joan May 18 '16 at 19:35
  • @spyderdyne Added edit to answer. – joan May 18 '16 at 20:03
  • I have offered a bounty - http://askubuntu.com/questions/774349/is-there-a-way-for-maas-to-commission-a-raspberry-pi-3b – spyderdyne May 24 '16 at 16:18