I also have a write up on my website. https://eugenegrechko.com/blog/USB-Boot ... berry-Pi-4
Update firmware to support USB Booting
First things first you need to make sure that your Raspberry Pi 4 supports USB Booting. In order to do this, you will have to install Raspbian on an SD card and update the firmware. To do this reference this video https://www.youtube.com/watch?v=tUrX9wzhygc. You'll want to watch up to the part where he verifies the boot loader is updated, around 7:56. If you already updated your bootloader skip to the next step.
Download 64 bit version of Ubuntu Server
Now we need to download the 64bit version of Ubuntu Server for Raspberry Pi 4. Then we'll flash the image to our SSD using Raspberry Pi Imager.
Visit the Ubuntu Raspberry Pi download page and grab yourself the 64-bit version for the RP4.
Flash Image to SSD
After downloading our image we'll need to install Raspberry Pi Imager. Visit the Raspberry Pi Downloads page and install it on your computer.
Next open Imager. Click "Choose OS" & find your newly downloaded image of Ubuntu Server. After that click on "Choose SD Card" and select your SSD drive. Finally, click Write and wait for the process to finish.
Mount system-boot partition on SSD
Now we need to mount the system-boot partition on the SSD drive in order to change some things.
Code: Select all
sudo mkdir /mnt/ssdboot
sudo mount /dev/sdb1 /mnt/ssdboot
cd /mnt/ssdboot
IMPORTANT: You will have to rerun this step every time ubuntu updates the kernel.
First, we're going to uncompress the vmlinuz file into vmlinux. This is because booting from a compressed 64bit arm kernel is not currently supported.
Find out where the gzipped content starts in the image.
Code: Select all
od -A d -t x1 vmlinuz | grep '1f 8b 08 00'
The first string of numbers 0000000 is the location that we're looking for. In this case its right at the beginning of the image.0000000 1f 8b 08 00 00 00 00 00 02 03 ec 5b 0f 74 54 e5
Now use dd to extract the data and zcat to uncompress it into a file. If your number was something other than 0000000 make sure you put that number as the skip value.
Code: Select all
dd if=vmlinuz bs=1 skip=0000000 | zcat > vmlinux
Now that we have the uncompressed image we'll want to update the config.txt file in order to tell the Pi how to boot.
Edit config.txt ( you can use nano or gedit if you're not comfortable with vim )
Code: Select all
vim config.txt
Code: Select all
#[pi4]
#kernel=uboot_rpi_4.bin
#max_framebuffers=2
#[pi2]
#kernel=uboot_rpi_2.bin
#[pi3]
#kernel=uboot_rpi_3.bin
Code: Select all
[all]
arm_64bit=1
device_tree_address=0x03000000
kernel=vmlinux
initramfs initrd.img followkernel
Now we need to update the .dat & .elf files to the latest version in the master branch of the raspberrypi/firmware Github. https://github.com/raspberrypi/firmware ... aster/boot
Download boot folder
Visit the link above and download the folder using something like GitZip. https://gitzip.org/
Copy files from downloaded folder
Next copy all of the .dat & .elf files into the boot folder. Overwrite all files.
Code: Select all
cp ~/Downloads/firmware-/boot/*.dat ./
cp ~/Downloads/firmware-/boot/*.elf .
Now you're ready to boot your Raspberry Pi. Make sure the SD card is unplugged. Unmount the SSD from your computer. Plug it into your Raspberry Pi and power on.
If you run into any issues let me know. I'll do my best to help you out. Hope this helped some people!