Vanilla here means that we are going to be installing straight from an untouched ARM64 Debian netinst ISO, with no need for custom kernel modifications or any gymnastics of the original content before installation. In other words, by following this guide, you will get as close to the same experience as the one you have when installing Debian from an x86 ISO on an UEFI PC. As a matter of fact, once the Debian installer starts, it will be indistinguishable from a PC installation experience. You will also end up with everything you'd expect to see from a PC install, including a graphical GRUB prompt as well as a system that'll natively update its kernel and initrd, without the need for further configuration...
Overview of the entire process
Create a GPT ESP (EFI System Partition) onto an USB, extract the netinst.iso content there, add the latest Raspberry PI UEFI firmware and proceed to a standard Debian networked installation. That's it!
Or did you perhaps think that the process of installing Debian on an ARM platform would be different from the process of installing Debian on a UEFI based PC? Why on earth should that be the case? The whole point of having an SBBR-compliant UEFI firmware (which we do have for the Pi 4) is precisely so that we stop with the madness of having each ARM platform require its custom media installation and boot process. SBBR and UEFI gets you the ability to use vanilla installation media to boot and run your OS. Oh, and that works not just for Linux, but for Windows and other OSes too!
- One USB drive with sufficient space (at least 16 GB or more). A fast USB 3.0 flash-based drive is strongly advised.
- A Raspberry Pi 4 Model B that is physically connected to the network through the Ethernet port (i.e. You won't be able to use wireless since a wireless driver with the ACPI bidings has not yet been integrated to Debian).
Also note that your Pi 4 should use an EEPROM that supports USB boot. If you purchased it after April 2020, it should probably already be the case, but if you are using an older model, and haven't updated its EEPROM yet, you should create and run an EEPROM update media using the files from here.
- A recent Debian 11 ARM64 net install ISO. We must use a daily or weekly build since Debian 11 has not been officially released yet and support for the Raspberry Pi 4 in terms of networking has not been backported into Debian 10. I suggest to use a weekly build (provided link) instead of a daily build, as daily builds are more experimental and may get broken.
- The latest Raspberry Pi 4 UEFI firmware binary, (which also includes the relevant Broadcom bootloader support files, i.e. config.txt, fixup4.dat, start4.elf).
- Partition the USB media as GPT (not MBR) and create a ~350 MB ESP partition on it.
Note: Make sure that you create a partition of type ESP and not "Basic Data" as Debian's partition manager will have trouble using it otherwise.
- Format the ESP as FAT32
- Extract the full content of the netinst ISO onto the ESP (including the .disk/ directory).
- Extract the full content of the UEFI firmware zip onto the ESP.
- Eject your USB drive and insert it into your Raspberry Pi 4
If you are running Windows and have downloaded Rufus as well as the prerequisite files, then the process becomes:
- Launch Rufus and make sure your USB media is plugged in
- Click the SELECT button and select the Debian netinst ISO
- Ctrl-Click the SELECT button (yes, that means you should click SELECT again, but this time with the Ctrl key pressed at the same time) and select the UEFI Firmware zip. Ctrl-SELECT is a special mode of Rufus that allows adding files to an already selected ISO, which is what we want to do.
- Change Partition scheme to GPT (Make sure you do select GPT and not MBR or else the process will not work)
- Click START
- When prompted, choose Write in ISO → ESP mode. Note that you will only get this option is you selected GPT for Partition scheme, so if you don't see it, please double check Partition scheme.
- Let Rufus complete the media creation
- Eject your USB drive and insert it into your Raspberry Pi 4
Just follow the Debian installer prompts. The whole point of the media creation above is so that, once you plug your USB drive and boot the Pi, the installation experience will be the same as the one you would get on a PC, so I will not be covering that in details.
The only elements I will mention are that:
- If the installer reports that No Common CD-ROM drive was detected. (this was a bug in some netinst ISOs that should have been corrected in latest releases) please perform the following:
- On Load CD-ROM drivers from removable media select No.
- On Manually select a CD-ROM module and device select Yes.
- On Module needed for accessing the CD-ROM select none.
- On Device file for accessing the CD-ROM type the following exactly:
-t vfat -o rw /dev/sda1
- If/when prompted for the network card, select enabcm6e4ei0 (which should be the first one in the list)
- During partitioning, you should leave the ESP as is (which the Debian installer will be smart enough to do on its own, as long as you only use the free space for the new partitions to be created). If you don't know what to choose, you should choose Guided - use the largest continuous free space which is the default.
Post Installation Tweaks
If you are using a 4 GB or 8 GB Raspberry Pi 4 board, and provided that you are using a Debian installation ISO that was created after 2020.09.07 (i.e. one that uses version 5.8 of the Linux kernel), you will find that the system reports only 3 GB of RAM available.
This is because (as far as we know) Broadcom botched their PCIe DMA implementation so that the VIA xHCI controller can only effectively access 3 GB of RAM unless the OS kernel implements bounce buffers or some other workaround. This workaround has recently been added into the Linux 5.8 kernel, which is what recent Debian 11 installation ISOs use, so, after you have confirmed that you are using a post 5.8 kernel (through uname -a for instance), you should perform the following:
- Reboot the OS.
- Go to the UEFI settings by pressing the Esc key when you see the UEFI firmware black and white Raspberry logo.
- Go to Device Manager → Raspberry Pi Configuration → Advanced Configuration and set Limit RAM to 3 GB to <Disabled>.
- Save the settings and reboot
Can I perform a graphical install? Does X work?
Absolutely. And if you install in graphical mode, you'll also get a graphical GRUB prompt which is nice.
Why can't I use the SD card?
That's because the Linux kernel does not yet have support for the SD controller used by the Raspberry Pi 4, with the necessary ACPI bindings. Once someone sends a patch for that to the mainline kernel, and it makes its way into Debian, you will naturally gain SD access through a regular network system update. Oh and you're much better off running the system from an USB 3.0 drive than an SD card anyway, as SD on the Pi 4 will always be much slower than USB 3.0.
What about other Pi 4 devices that aren't supported yet?
It needs to be pointed out that, in order to be SBBR compliant, which is the precise reason why you can use vanilla media and vanilla installation methods, the default boot mode of the platform, as enacted by the UEFI firmware, will be ACPI and not Device Tree, so the question of having hardware X or Y supported in Linux becomes a question of having a driver with the necessary ACPI bindings in the kernel (which means that a driver that only has the Device Tree bindings will not be enough). But again, since this is a pure Linux kernel issue, and not a UEFI one, once they get added to the Linux kernel, they will naturally percolate to your networked Debian installation. Oh, and if you are impatient to have this or that driver working in vanilla Debian, by all means you should submit a driver update to the mainline kernel!
Why use netinst.iso and not mini.iso?
If you are very size conscious, you may wonder why we didn't go for Debian's mini.iso which is quite a bit smaller than netinst.iso, and can actually be used to perform an networked installation just the same. It mostly boils down with wanting to reach a trade-of between speed and size. The advantage of using netinst is that you don't have to download the base system components, so it makes the process of installing Debian faster as a result. But of course, that means that you're going to lose about 300 MB of disk space that's only going to be used once. Considering the current flash-based media capacity, we don't consider this as a major drawback, but if you see it as a dealbreaker, by all means use the smaller mini.iso and resize your ESP accordingly.
What about using the Debian 10 release?
We tried to get the Debian maintainers to backport the Genet ACPI bindings, required for network support, into the 4.x kernel used by Debian 10.x, but unfortunately they have not been receptive to that idea at all. And of course, without a working network driver, this whole process is pointless.