Raspbery Pi 4 MAAS images

Hello,

I’m trying to use MAAS images on Raspberry Pi 4, like I do with amd64 images for x86 hardware. I’m not actually using MAAS application, I only use the images (kernel, initrd, squashfs) available at images.maas.io. For deployment I combine dnsmasq with a small cherrypy app for feeding the machines with cloud-init data. I’m not using NFS either. The process works fine on x86, but I got stuck with the Pi. I got it to PXE boot, but the kernel and initramfs from the official ubuntu focal raspberry pi image don’t support root squashfs over http, among other things, so the boot process gets stuck waiting for root. The arm64 images from MAAS leave a blank screen, although I see that they are being downloaded from the the tftp server. My guess is that the arm64 images available through MAAS aren’t compatible with Pi.

How do I build such images?

1 Like

After searching more on this site, I found out that the hwe-20.04-edge images are for Raspberry Pi. I tried them and there is no change. I suspect I need to change config.txt and/or cmdline.txt, but don’t know how.

All of the SquashFS images are actually from cloud-images.ubuntu.com, we don’t change the SquashFS images at all. These images do not contain a kernel or initrd. We use an automated job which mounts the SquashFS image with an overlay and installs cloud-initramfs-rooturl, cloud-initramfs-dyn-netconf, and cloud-initramfs-resuevol. These packages enable pulling the SquashFS over HTTP. We then install the target kernel when the initrd is generate it includes all necessary scripts. We pull the kernel and initrd out to be included in the MAAS stream.

That being said my understanding is that there are currently issues networking booting on Raspberry Pi 4. I heard there was some work done but there are issues with the firmware.

Thanks for the info, I now think my problem is with bootloader configuration rather than the images. I’ll continue testing.

Update: I got it working, with small issues left that probably can be fixed:

  1. build pipxe for RPi4 (see my description from https://github.com/ipxe/pipxe/issues/2#issuecomment-808703259)
  2. tell your TFTP server to provide the UEFI firmware on legacy boot, and the IPXE binary on UEFI boot. Others have documented how this works
  3. get hw-20.04-edge images and put them on a webserver (tftp works too but is slower)
  4. ungzip kernel (my ipxe doesn’t otherwise see it as an EFI binary)
  5. use this ipxe script:
#!ipxe

dhcp
initrd http://my.server.ip/focal-maas/arm64/boot-initrd
chain http://my.server.ip/focal-maas/arm64/boot-kernel initrd=boot-initrd root=squash:http://my.server.ip/focal-maas/arm64/squashfs ip=dhcp overlayroot=tmpfs:recurse=0 ds=nocloud-net;s=https://cloud-init-server/cloud-init/

The machine first boots into UEFI using RPi’s firmware bootloader, you select to use UEFI PXE IPv4, then it loads ipxe, which then loads the images and boots into linux. From here on it behaves the same way as on x86.

What is left is to configure the UEFI firmware to use full RAM (now limited to 3GB) and to change the boot order to use PXE IPv4 first.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

@PeterSurda, i’m always impressed when someone makes a raspberry pi work with any part of MAAS, even the images. we tested the Pi but found it had some rather thorny issues we didn’t have time to address. i’m very proud of the way our community is stepping up and experimenting! in teh spirit of open source, great job!