Files needed for booting Raspberry Pi 4 in UEFI mode.
PKGBUILD
file is designed for Arch Build System (ABS), you can know more about it at there. Here are the steps for using these files correctly:
- Clone this repository.
- If you are using Arch Linux or other distributions based on it such as Manjaro, you can run
bash start-build.sh
command in the root directory of this repo after installed requirements (see start-build.sh for more info), finally, you can find software packages generated by makepkg program atout
folder.
If you are not using Arch Linux, you may have to understand Arch Build System and do the same when themakepkg
program is run. You can also use docker, see CI config for more info. CI is running on Ubuntu x86_64 host and you can use it as a reference. Note: final artifacts inout
folder is Arch Linux Package, if you want to create package for your distribution, you shouldn't use docker and you should turn to readmakepkg
files. - Choose packages you need to install. Normally, packages provide
uefi-raspberrypi4
andraspberrypi-overlays
are needed to be installed. You may have to removeuboot-raspberrypi
in your original Arch Linux ARM Distribution. - Install bootloader. You can choose any bootloader you like such as grub, systemd-boot, rEFInd and so on, please take a look at #NOTE about how to make the bootloader you chose work.
- Migrate your kernel parameters. They should be in the file
/boot/cmdline.txt
or/boot/cmdline.txt.pacsave
, please add them to your bootloader. The old file is useless after this, you can remove them as you like.
UEFI firmware needs root privilege to build on my Arch Distribution. So I think it can't be treated as a valid PKGBUILD because a valid one needs no manual interaction. This problem has been fixed.
UEFI firmware needs gcc10
to build, which is not provided on Arch Linux ARM. This problem will only be solved when pftf upgrade BrotilCompress
to newer version which supports GCC 12 or Arch Linux ARM provides gcc10
package. Update: This can be workarounded by using clang as compiler, this is also the default behavior now.
As for other aspects, there should be no issue to upload, I have even set buildarch
to meet Arch Linux ARM's requirements.
If you think pacman or other wrapper complains about not found these packages, please add them to IgnorePkg
in /etc/pacman.conf
- Backup your Pi's files or at least backup boot partition. Or you may have to reinstall your original system.
- UEFI firmware is experimental, that means maybe some features may not work properly. You can get more infomation at there
- Install grub with
--removeable
flag, or you have to choose boot from/EFI/grub/grubaa64.efi
file in UEFI manually when your Pi is powering on. Also you can add a boot entry in UEFI manualy to solve this. For systemd-boot,--no-variables
should be OK. - According to kernel documentation, a compressed aarch64 kernel does not have a decompressor, so you have to choose a bootloader which can do the decompression job. GRUB works well on Raspberry Pi 4B even with the compressed vmlinuz kernel.
- GRUB may create some useless entries in advanced menu, like booting from vmlinux without initramfs, booting from Image without initramfs and so on, you can remove them as you like, booting from vmlinuz with initramfs works well.
UEFI provided by this project. Thanks to pftf and others' contribution, we can use UEFI Firmware in RaspberryPi.
Overlays provided by raspberrypi/firmware.