Activating USB boot for Ubuntu MATE 20.04 LTS on Raspberry Pi 4

It is known that modern Ubuntu MATE 20.10 is capable to boot from USB.
If you want to upgrade 20.10 to 21.04 by sudo do-release-upgrade or update-manager -c , the resulting system will be able to boot from USB too. This is true for both 32-bit (armhf) and 64-bit (arm64).

But what is about Ubuntu MATE 20.04 LTS?

The below guide shows how to boot existing Ubuntu MATE 20.04.1 LTS from USB.

Using 32-bit armhf image

What should we do:

  1. Install updated bootloader into RPi, see this guide for complete instruction.

  2. Download official installation image to laptop using link https://ubuntu-mate.org/download/armhf/focal/ and write it directly to USB flash or USB SSD.

  3. Mount system-boot partition on laptop and then replace the contents of config.txt file with the following lines from 20.10 image:

    [pi4]
    max_framebuffers=2
    
    [all]
    kernel=vmlinuz
    cmdline=cmdline.txt
    initramfs initrd.img followkernel
    
    # Enable the audio output, I2C and SPI interfaces on the GPIO header
    dtparam=audio=on
    dtparam=i2c_arm=on
    dtparam=spi=on
    
    # Enable the FKMS ("Fake" KMS) graphics overlay, enable the camera firmware
    # and allocate 128Mb to the GPU memory
    dtoverlay=vc4-fkms-v3d
    gpu_mem=128
    start_x=1
    
    # Comment out the following line if the edges of the desktop appear outside
    # the edges of your display
    disable_overscan=1
    
    # If you have issues with audio, you may try uncommenting the following line
    # which forces the HDMI output into HDMI mode instead of DVI (which doesn't
    # support audio output)
    #hdmi_drive=2
    
    # If you have a CM4, uncomment the following line to enable the USB2 outputs
    # on the IO board (assuming your CM4 is plugged into such a board)
    #dtoverlay=dwc2,dr_mode=host
    

    then unmount this system-boot partition and detach its USB storage device.

  4. Insert USB storage device into RPi 4, power it, wait for first boot and enjoy!

Using 64-bit arm64 image

What should we do:

  1. Install updated bootloader into RPi, see this guide for complete instruction.

  2. Download official installation image to laptop using link https://ubuntu-mate.org/download/arm64/focal/ and write it to microSD card using USB- or internal cardreader.

  3. Boot Raspberry Pi 4 using microSD card as usual: choose locale, create user, reboot, login to system, then install all updates and do cleanup by sudo apt update && sudo apt dist-upgrade -y && sudo apt autopurge -y && sudo apt clean -y, reboot to ensure that system on microSD is fully functional, poweroff the Raspberry Pi 4.

  4. Connect microSD card to laptop, mount system-boot on laptop and then replace the contents of config.txt file with the following lines:

    [pi4]
    max_framebuffers=2
    
    [all]
    arm_64bit=1
    # kernel=uboot_rpi_4.bin
    kernel=vmlinuz
    cmdline=cmdline.txt
    initramfs initrd.img followkernel
    # device_tree_address=0x03000000
    # enable_uart=0
    
    # Enable the audio output, I2C and SPI interfaces on the GPIO header
    dtparam=audio=on
    dtparam=i2c_arm=on
    dtparam=spi=on
    
    # Enable the FKMS ("Fake" KMS) graphics overlay, enable the camera firmware
    # and allocate 128Mb to the GPU memory
    dtoverlay=vc4-fkms-v3d
    gpu_mem=128
    start_x=1
    
    # Comment out the following line if the edges of the desktop appear outside
    # the edges of your display
    disable_overscan=1
    
    # If you have issues with audio, you may try uncommenting the following line
    # which forces the HDMI output into HDMI mode instead of DVI (which doesn't
    # support audio output)
    #hdmi_drive=2
    
    # If you have a CM4, uncomment the following line to enable the USB2 outputs
    # on the IO board (assuming your CM4 is plugged into such a board)
    #dtoverlay=dwc2,dr_mode=host
    
  5. Insert microSD card to USB-cardreader, connect USB-cardreader to Raspberry Pi 4, allow it to boot, then power it off.

  6. Copy the whole microSD card to USB-flash or USB SSD, optionally grow the size of writable partition to fit free space of USB media.

  7. Connect USB media to Raspberry Pi 4, boot it and enjoy!