Saturday, 14 August 2021

Vanilla Debian on a Raspberry Pi 4 with UEFI

Thanks to the good folk who put the hard work into building a UEFI implementation for the Raspberry Pi 4 which "just works", allowing you to install Debian straightforwardly, and especially to Pete Batard who has written up the process and collected a zip file together. 

Not quite so straightforward ...

I have an early model Raspberry Pi 4. I wanted to install Debian on an SSD  connected via a cable to a USB3 port. It turned out that the version of the software in the EEPROM would not boot reliably so the first task was to update this with the latest stable EEPROM available from the Raspberry Pi downloads.

The easiest way to do this was to boot an SD card with Raspbian on. Once that was done, I had a Pi that would boot from an SSD.

Untar the files

A tarball of UEFI from Pete's Github repository at https://github.com/pftf/RPi4/releases - latest is v 1.29 as at 20210814.

Plugging in the SSD to another machine to format the drive: msdos format, one ESP partition in FAT32 and marked bootable and the rest of the drive blank.

One aarch64 DVD image from the usual place. 

 https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/debian-11.0.0-arm64-DVD-1.iso

Untar the UEFI  tarball into the ESP partition you've just made

 Plug the SSD into a USB3 port on the RPi using a USB -> SATA cable

Write the aarch image to a USB stick using dd and place that into one of the other USB ports. Add a keyboard.

Install

Power up the RPi4, hit Esc and work your way through UEFI to select a boot device and go, save the settings and go.

The install is almost identical to any Debian d-i install.

There is a setting in UEFI to reclaim the 1G of memory that was masked out, there's a setting for control of the fan shim if you have that style of fan.

End result - happiness

Done the other day and sitting next to me on the desktop.






 

6 comments:

  1. Did you also have to add Grub manually in the UEFI firmware as a boot option, or was this done by the installer?

    ReplyDelete
    Replies
    1. No, the UEFI firmware picked up Grub - the install was very much comparable to an install on amd64.

      Delete
  2. You can also put the .iso's _contents_ to the EFI partition itself, sparing you the second USB stick.

    Also, it might be noteworthy that the installed system will use ACPI for hardware enumeration instead of DT which will lead to DT-only device drivers not working. Unfortunately, this includes the vc4 graphics driver. Or did you get vc4 to work?

    ReplyDelete
  3. I realised that you could put the .iso into the EFI partition but I kept that small. I really wanted to make sure that "vanilla" arm64 DVD copied onto USB would work. The UEFI firmware gives options for ACPI and DT concurrently. I wasn't worried about vc4 intitially, I've got a text only install working fine - the only glitchy thing is the PWM control for the Raspberry Pi fan shim.

    ReplyDelete
  4. its possible in rpi4 1gb? Or not

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete