These are the steps that I went thru to update the firmware and get Ubuntu Server 20.04 LTS installed on my Raspberry Pi 4 2GB from my Chromebook
Prerequisites:
- Raspberry Pi
- SD Card and USB Flash Drive
- Chromebook:
- Have the Linux Virtual Machine enabled
- Have Chromebook Recovery Utility installed
- Download the latest firmware from: https://github.com/raspberrypi/rpi-eeprom/releases
- Insert your SD Card into your Chromebook
- Copy the Contents of the Zip file onto the SD Card
- Uses Files to eject your SD Card and then remove from Chromebook
- Boot your Raspberry Pi using the SD Card
- Download 64-bit Ubuntu Server for Rasberry Pi from here: https://ubuntu.com/download/raspberry-pi
- In Files: Move it from Downloads to your Linux Files
- On the Linux Command Prompt run:
- xz -d ubuntu-20.04.1-preinstalled-server-arm64+raspi.img.xz
- In Files: Right click the IMG file and click Zip selection
- Insert your SD Card or USB Drive you want to use
- Write the image to your removable media:
- Open Chromebook Recovery Utility
- Click the Setting Wheel next to the close window button
- Click "Use local image"
- Use files to select the zip file you just created
- Wait for the progress bar to complete TWICE (once for unpacking, once for writing)
- Exit Chromebook Recovery Utility
- Ubuntu 20.04 preinstalled servers uses cloud-init on first boot, you can find out more here:
- Setup your WiFi
- Open /system-boot/network-config in a text editor
- Uncomment (remove the # from the front of the line) the wifis section and update it with your wireless network and password
- Or for a fixed IP
- Save the File
- If you are using a SD Card, you are finished and can:
- Eject the removable media using the Files app
- Remove it from the laptop
wifis:wlan0:dhcp4: trueoptional: trueaccess-points:"YourWifiNameHere":password: "YourPasswordHere"
wifis:wlan0:addresses: [192.168.1.XX/24]gateway4: 192.168.1.1nameservers:addresses: [192.168.1.1]dhcp4: falseoptional: trueaccess-points:"YourWifiNameHere":password: "YourPasswordHere"
- Decompress vmlinux
- Share the system-boot partition with Linux
- In the files app, right click it and click "Share with Linux"
- Open the terminal
- cd /mnt/chromeos/removable/system-boot
- zcat vmlinuz > vmlinux
- Update /system-boot/config.txt to have the pi4 section look like:
- Install a script that will do this after installing updates (currently this cannot be done on a Chromebook because the writable partition is mounted read-only --oh the irony--)
- Create a file on /system-boot (/system-boot/firmware if logged into the pi) called auto_decompress_kernel and paste the code that is at the end of the blog
- Create a file in /writable/etc/apt/apt.conf.d called 999_decompress_rpi_kernel and paste the following single line into it:
- DPkg::Post-Invoke {"/bin/bash /boot/auto_decompress_kernel"; };
- Share the writable partition with Linux
- In the files app, right click it and click "Share with Linux"
- Open the terminal
- cd /mnt/chromeos/removable/writable/etc/apt/apt.conf.d
- chmod +x 999_decompress_rpi_kernel
[pi4]max_framebuffers=2dtoverlay=vc4-fkms-v3dboot_delaykernel=vmlinuxinitramfs initrd.img followkernel
#!/bin/bash -e#Set VariablesBTPATH=/boot/firmwareCKPATH=$BTPATH/vmlinuzDKPATH=$BTPATH/vmlinux#Check if compression needs to be done.if [ -e $BTPATH/check.md5 ]; thenif md5sum --status --ignore-missing -c $BTPATH/check.md5; thenecho -e "e[32mFiles have not changed, Decompression not needede[0m"exit 0else echo -e "e[31mHash failed, kernel will be compressede[0m"fifi#Backup the old decompressed kernelmv $DKPATH $DKPATH.bakif [ ! $? == 0 ]; thenecho -e "e[31mDECOMPRESSED KERNEL BACKUP FAILED!e[0m"exit 1else echo -e "e[32mDecompressed kernel backup was successfule[0m"fi#Decompress the new kernelecho "Decompressing kernel: "$CKPATH".............."zcat $CKPATH > $DKPATHif [ ! $? == 0 ]; thenecho -e "e[31mKERNEL FAILED TO DECOMPRESS!e[0m"exit 1elseecho -e "e[32mKernel Decompressed Succesfullye[0m"fi#Hash the new kernel for checkingmd5sum $CKPATH $DKPATH > $BTPATH/check.md5if [ ! $? == 0 ]; thenecho -e "e[31mMD5 GENERATION FAILED!e[0m"else echo -e "e[32mMD5 generated Succesfullye[0m"fi#Exitexit 0
- https://www.raspberrypi.org/documentation/installation/installing-images/chromeos.md
- https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview
- https://www.raspberrypi.org/forums/viewtopic.php?t=278791
- https://www.explorelinux.com/raspberrypi-4-usb-boot-no-sd-card/