%define debug_package %{nil} %bcond_without debug # Build options %define TOOL_CHAIN_TAG GCC5 %define TARGET_ARCH AARCH64 %define ACTIVE_PLATFORM Platform/RaspberryPi/RPi4/RPi4.dsc %if %{with debug} %define TARGET DEBUG %else %define TARGET RELEASE %endif Name: edk2-rpi4 Version: 0 %global WORKSPACE %{_builddir}/%{name}-%{version} Release: 2%{?dist} Summary: UEFI firmware for Raspberry Pi 4 License: BSD-2-Clause-Patent URL: http://www.tianocore.org Source0: %{name}-%{version}.tar # Set graphical console as default # https://github.com/pftf/RPi4/raw/master/0001-MdeModulePkg-UefiBootManagerLib-Signal-ReadyToBoot-o.patch Patch0: 0001-MdeModulePkg-UefiBootManagerLib-Signal-ReadyToBoot-o.patch # Enable more than 3GB and ACPI+Devicetree by default Patch1: edk2-rpi4-defaults.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: python3 BuildRequires: git BuildRequires: libuuid-devel BuildRequires: acpica-tools Requires: rpi4-firmware %description This is a port of 64-bit Tiano Core UEFI firmware for the Raspberry Pi 4 platform. This is intended to be useful 64-bit TF-A + UEFI implementation for the Raspberry Pi variants based on the BCM2711 SoC, which should be good enough for most kind of UEFI development, as well running consumer Operating Systems. Raspberry Pi is a trademark of the Raspberry Pi Foundation. %prep %setup -q %build export WORKSPACE=%{WORKSPACE} git clone https://github.com/tianocore/edk2.git pushd edk2 git submodule update --init %{__patch} -p1 < %{PATCH0} popd git clone https://github.com/tianocore/edk2-platforms.git pushd edk2-platforms git submodule update --init %{__patch} -p1 < %{PATCH1} popd git clone https://github.com/tianocore/edk2-non-osi.git export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi . edk2/edksetup.sh %{__make} -C edk2/BaseTools build -n $(nproc) -b %{TARGET} -a %{TARGET_ARCH} -t %{TOOL_CHAIN_TAG} -p %{ACTIVE_PLATFORM} # Generate config.txt echo "arm_64bit=1 start_x=1 enable_uart=1 uart_2ndstage=1 enable_gic=1 armstub=RPI_EFI.fd disable_commandline_tags=1 disable_overscan=1 device_tree_address=0x1f0000 device_tree_end=0x200000 dtoverlay=miniuart-bt gpu_mem=64" > config.txt %install mkdir -p %{buildroot}/boot/efi install -m 0600 Build/RPi4/%{TARGET}_GCC5/FV/RPI_EFI.fd %{buildroot}/boot/efi/ install -m 0600 config.txt %{buildroot}/boot/efi/ # Text files install -m 0644 edk2-platforms/License.txt . install -m 0644 edk2-platforms/Maintainers.txt . install -m 0644 edk2-platforms/Readme.md . install -m 0644 edk2-platforms/License-History.txt . %files %config(noreplace) /boot/efi/config.txt %license License.txt %doc Maintainers.txt Readme.md License-History.txt /boot/efi/RPI_EFI.fd %changelog * Sat Aug 20 2022 Luca Magrone - 0-2 - Update to include new library instance from SecurityPkg * Fri Jul 1 2022 Luca Magrone - 0-1 - Initial version of the package