Booting Ubuntu Server 20.04 on Pi 4 from USB

After Raspberry PI 4 firmware upgrade 15 June, I can boot PI OS on USB and yesterday night after a few attempts and some kernel panics (caused by enable_uart=1 inside the config.txt file in the boot folder) I managed to get a good working version of Manjaro XFCE 20.06. One of the issues was that some of the files in the boot folder were no longer in sync with the 15 June beta firmware update so I had to retrieve old .elf and .dat files, replace them in the boot folder and eventually I got it all working.

This isn't the case with Ubuntu Server (Arm) 20.04. The Downloaded image fails to boot from USB and the files trick didn't work. It doesn't detect USB, doesn't detect network either and then it just gets stuck at a rudimentary prompt in which I can't type because apparently USB doesn't work.

Any clues?


Solution 1:

As of writing, there is no easy way of booting the preinstalled raspberry pi ubuntu-server image from usb only.

But there is an easy workaround - that worked for me:

  • copy the image to micro-sd-card and usb-stick/harddrive
  • delete the second partition named "writeable" from the micro-sd-card
  • (not necessary - but might avoid later complications) delete the first partition named "system-boot" from the usb-stick/harddrive
  • have both devices plugged in on boot

Since the boot-device selection in the preinstalled-images uses the "Label" option to identify the devices, this works.

Solution 2:

You can boot from usb only.
TL,DR : extract vmlinuz to vmlinux in the boot partition of the ubuntu image from their website.

explaination: per the official ubuntu wiki page for arm processors, you need to edit config.txt in the boot partition, and replace the kernel line to kernel=vmlinuz
only problem is vmlinuz is compressed. so you have to decompress it to vmlinux.
(easy way to extract use sudo dd if=vmlinuz bs=1 | zcat > vmlinux)

credit source: raspberry forum, visit this link for step-by-step guide.

EDIT
I wrote the official ubuntu 64bit image for rpi4
I then edited config.txt with kernel=vmlinux instead of using vmlinuz
(don't forget adding initramfs initrd.img followkernel per the wiki page).
then replaced *.elf and *.dat files on the boot partition with the ones from raspberry pi/firmware github repo