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. 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...
Actual screenshot of the standard GRUB prompt you'll see after install — Doesn't get any more vanilla than this
Opinionated preamble (skip this part if you're only interested in the guide)
The reason we are able to perform this above is because we finally have a full UEFI firmware for the 3B/3B+, and because the Debian ISOs, be it for x86 or ARM64, are pretty much designed to work right out of the box with UEFI.
At this stage, I feel the need to voice my opinion as to why people who have been interested in getting vanilla distros such as Debian (or Ubuntu, or Suse, or whatever, since it makes things equally easy for those) as well as the Raspberry Pi Foundation haven't been helping with the effort to get a UEFI firmware going, because that is really the one piece of the puzzle anyone interested in running a generic ARM/ARM64 distro should have been concentrating on, instead of trying to alter anything and everything on a case by case basis, to get it to run...
As valid as some of the criticism it receives might be, there is a good reason UEFI exists in the first place, which a lot of people don't seem to appreciate, and that is to ensure that any OS can rely on a unified boot environment to set everything it needs moving forward.
And as this guide hopefully demonstrates, once your platform supports UEFI, everything else becomes incredibly easy!
Plus it also ensures that users can find a familiar environment during boot, which they can control through a User Interface and which can indeed be critical for a platform such as the Pi, which is designed to be an affordable entry point for people of all horizons...
But let's get to the guide, which is mostly a mashup of the already existing succinct guide we have in the Systems readme for the Raspberry Pi 3 UEFI firmware as well as my more detailed blog entry .
- One micro SD card with sufficient space (at least 16 GB or more).
- A Raspberry Pi 3 Model B or Model B+. Earlier or later models are not supported yet, since there exists no UEFI firmware for those at the moment.
- The latest Debian ARM64 net install ISO.
- The latest Raspberry Pi 3 UEFI firmware binary, along with the relevant Broadcom bootloader support files (i.e. bootcode.bin, config.txt, fixup.dat, start.elf).
- (Optional) The non-free WLAN firmware binaries, which are required if you want to use Wifi for the installation.
- Partition the SD media as MBR and create a ~300 MB partition on it with MBR type 0x0e.
Note: Make sure that the partition scheme is MBR (not GPT) and the type 0x0e (not 0xef for instance), as the on-CPU Broadcom bootloader supports neither the GPT scheme nor the ESP MBR type.
- Set the partition as active/bootable. This is needed as the Debian partition manager can not detect it as ESP otherwise, which we need for GRUB installation. If using fdisk on Linux, you can use the a command to set a partition as active. On Windows, you can use diskpart and then type active after selecting the relevant disk and partition.
- Format the partition as FAT16 (again needed for Debian partition manager to detect it as ESP). If you are using Windows diskpart then format fs=fat quick will format a drive to FAT16. On Linux, the equivalent command would be mkfs.vfat -F 16 /dev/<your_device>. If you need help with the partitioning and formatting of your device, you can find full detailed steps in the Appendixes of the blog entry I linked above.
- Copy all the UEFI firmware files, including any optional files such as the Wifi firmware drivers, onto the FAT partition.
- Extract the full content of the ISO onto the FAT partition.
- Eject your SD card and insert it into your Raspberry Pi 3
Note: A lot of the steps described below are the same you'd expect if you were installing Debian on a PC.
- Power up the Pi. It should show the multicoloured screen (indicates that the UEFI firmware is being loaded from the SD card) and then the black and white Raspberry Pi logo (indicates that the UEFI firmware is running)
- On the GRUB menu select Install and let the Debian Installer process start. Note: In case anything goes wrong during the install process, you can use <Alt>-<F4> to check the installation log.
- Select your Language, Country and Keyboard and let the installer proceed until it reports that No Common CD-ROM drive was detected.
- 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:
Code: Select all
-t vfat -o rw /dev/mmcblk0p1
- (Optional) If you have the non-free WLAN firmware binaries, and plan to install through wireless, you can let the installer select the firmware files. Please be mindful that you may be asked multiple times as there are multiple files to provide.
- If requested by the installer, set up your network by choosing the network interface you want to use for installation and (optionally) your access point and credentials.
- Go through the hostname, user/password set up and customize those as you see fit.
- Let the installer continue until you get to the Partition disks screen. There, for Partitioning method select Manual. You should see something like this:
In other words, the partition manager should already detect your existing partition as ESP, with the B (bootable) and K (keep data) flags. If that is not the case, (e.g. if it says fat16 or fat32 instead of ESP) then it probably means you either didn't format the partition to FAT16 or you forgot to set the bootable flag. In that case, please refer to the Additional Notes below.
Code: Select all
MMC/SD card #1 (mmcblk0) - 16.0 GB SD 2WCGO #1 primary 314.6 MB B K ESP pri/log FREE SPACE
- Select FREE SPACE → Create a new partition and create a 1 GB primary swap partition.
- Select FREE SPACE → Create a new partition and allocate the rest to a primary ext4 root partition (mountpoint = /)
- After doing the above, your partition report should look like this:
Code: Select all
MMC/SD card #1 (mmcblk0) - 16.0 GB SD 2WCGO #1 primary 314.6 MB B K ESP #2 primary 1.0 GB f swap swap #3 primary 14.7 GB f ext4 /
- Select Finish partitioning and write changes to disk, then Yes and let the installer continue with the base system installation.
- After a while, the installer should produce a message that states:
This is a benign message that you can safely ignore by selecting Continue (The reason it is benign is we are running a net install and won't need to access the "CD-ROM" files post install).
Code: Select all
[!!] Configure the package manager apt-configuration problem An attempt to configure apt to install additional packages from the CD failed.
- Once you have dismissed the message above, pick the mirror closest to your geographical location and let the installer proceed with some more software installation.
- Finally, at the Software selection screen, choose any additional software package you wish to install. Debian desktop environment should work out of the box if you choose to install it.
- Let the process finalize the software and GRUB bootloader installation and, provided you didn't run into the partition manager issue described above you can reboot your machine when prompted, which, once completed, should bring you to your newly installed vanilla Debian environment.
The reason we use -t vfat -o rw /dev/mmcblk0p1 for the source media (i.e. "CD-ROM" device) is because, whereas the first partition on the SD card is indeed /dev/mmcblk0p1, we also need to provide additional parameters for the mount command that the installer invokes behind the scenes. For instance, if we don't use -t vfat, then ISO-9660 is forced as the file system, and if we don't use -o rw then the partition will be mounted as read-only which then prevents the same partition from being remounted when locating the non-free firmware files or when setting up /efi/boot.
With regards to fixing the partitioning if you don't see B K ESP when entering the partition manager, what you need to do is:
- Before you create the additional partitions, select the first partition and change its type to ESP. Note however that doing this changes the type of the partition to 0xef which is precisely what we're trying to avoid by having the partition manager already detect it as ESP, as type 0xef is unbootable by the Broadcom CPU.
- To fix this then, before you choose Continue on the Installation complete prompt you should open a new console with <Alt>-<F2> and type:
Code: Select all
chroot /target fdisk /dev/mmcblk0
- From within fdisk press t, 1, e and w, to reset the partition to type 0x0e (FAT16 LBA).
- Go back to the main installation window (<Alt>-<F1>) and continue with the reboot.