From 07ab11ca41cf66805d5463df408f7f190bf5760f Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 25 Mar 2021 00:29:21 +0000 Subject: [PATCH] Switch to GitHub CI builds Remove AppVeyor builds --- .github/workflows/linux_edk2.yml | 80 ++++++++++++++++++++++++++++++++ Readme.md | 4 +- appveyor.yml | 50 -------------------- build_firmware.sh | 13 ------ 4 files changed, 82 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/linux_edk2.yml delete mode 100644 appveyor.yml delete mode 100755 build_firmware.sh diff --git a/.github/workflows/linux_edk2.yml b/.github/workflows/linux_edk2.yml new file mode 100644 index 00000000..1e4b36b5 --- /dev/null +++ b/.github/workflows/linux_edk2.yml @@ -0,0 +1,80 @@ +# Copyright (c) 2021, Pete Batard +# SPDX-License-Identifier: BSD-3-Clause + +name: UEFI firmware - EDK2 build + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Set version + id: set_version + run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}" + - name: Set up Linux environment + run: sudo apt install acpica-tools gcc-aarch64-linux-gnu python3-distutils uuid-dev + - name: Check out EDK2 repositories + uses: actions/checkout@v2 + - name: Check out EDK2 submodules + run: git submodule update --init --recursive + - name: Patch EDK2 repositories + run: patch --binary -d edk2 -p1 -i ../0001-MdeModulePkg-UefiBootManagerLib-Signal-ReadyToBoot-o.patch + - name: Set up EDK2 + run: make -C edk2/BaseTools + - name: Build UEFI firmware + run: | + export WORKSPACE=$PWD + export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi + export GCC5_AARCH64_PREFIX=aarch64-linux-gnu- + export BUILD_FLAGS="-D SECURE_BOOT_ENABLE=TRUE -D INCLUDE_TFTP_COMMAND=TRUE -D NETWORK_ISCSI_ENABLE=TRUE" + source edk2/edksetup.sh + # EDK2's 'build' command doesn't play nice with spaces in environmnent variables, so we can't move the PCDs there... + build -a AARCH64 -t GCC5 -p edk2-platforms/Platform/RaspberryPi/RPi4/RPi4.dsc -b DEBUG --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor=L"https://github.com/pftf/RPi4" --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString=L"UEFI Firmware ${{steps.set_version.outputs.version}}" ${BUILD_FLAGS} + build -a AARCH64 -t GCC5 -p edk2-platforms/Platform/RaspberryPi/RPi4/RPi4.dsc -b RELEASE --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor=L"https://github.com/pftf/RPi4" --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString=L"UEFI Firmware ${{steps.set_version.outputs.version}}" ${BUILD_FLAGS} + cp Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd . + - name: Upload UEFI firmware artifacts + uses: actions/upload-artifact@v2 + with: + name: RPi4 UEFI Firmware ${{steps.set_version.outputs.version}} Artifacts + path: | + Build/RPi4/DEBUG_GCC5/FV/RPI_EFI.fd + Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd + - name: Download Raspberry Pi support files + run: | + curl -O -L https://github.com/raspberrypi/firmware/raw/master/boot/fixup4.dat + curl -O -L https://github.com/raspberrypi/firmware/raw/master/boot/start4.elf + curl -O -L https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-4-b.dtb + curl -O -L https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-cm4.dtb + curl -O -L https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-400.dtb + curl -O -L https://github.com/raspberrypi/firmware/raw/master/boot/overlays/miniuart-bt.dtbo + mkdir overlays + mv miniuart-bt.dtbo overlays + - name: Create UEFI firmware archive + run: zip -r RPi4_UEFI_Firmware_${{steps.set_version.outputs.version}}.zip RPI_EFI.fd *.dtb config.txt fixup4.dat start4.elf overlays Readme.md + - name: Display SHA-256 + run: sha256sum Build/RPi4/DEBUG_GCC5/FV/RPI_EFI.fd Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd RPi4_UEFI_Firmware_${{steps.set_version.outputs.version}}.zip + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + draft: false + prerelease: false + release_name: ${{steps.set_version.outputs.version}} + body: Raspberry Pi 4 UEFI Firmware ${{steps.set_version.outputs.version}} + tag_name: ${{steps.set_version.outputs.version}} + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + upload_url: ${{steps.create_release.outputs.upload_url}} + asset_path: RPi4_UEFI_Firmware_${{steps.set_version.outputs.version}}.zip + asset_name: RPi4_UEFI_Firmware_${{steps.set_version.outputs.version}}.zip + asset_content_type: application/zip diff --git a/Readme.md b/Readme.md index fefeb3f6..0a1bde53 100644 --- a/Readme.md +++ b/Readme.md @@ -1,7 +1,7 @@ Raspberry Pi 4 UEFI Firmware Images =================================== -[![Build status](https://img.shields.io/appveyor/ci/pbatard/RPi4.svg?style=flat-square)](https://ci.appveyor.com/project/pbatard/RPi4) +[![Build status](https://img.shields.io/github/workflow/status/pftf/RPi4/UEFI%20firmware%20-%20EDK2%20build.svg?style=flat-square)](https://github.com/pftf/RPi4/actions) [![Github stats](https://img.shields.io/github/downloads/pftf/RPi4/total.svg?style=flat-square)](https://github.com/pftf/RPi4/releases) [![Release](https://img.shields.io/github/release-pre/pftf/RPi4?style=flat-square)](https://github.com/pftf/RPi4/releases) @@ -84,7 +84,7 @@ card or on a USB drive in `efi/boot/bootaa64.efi`, you can let the UEFI system r The firmware provided in the zip archive is the `RELEASE` version but you can also find a `DEBUG` build of the firmware in the -[AppVeyor artifacts](https://ci.appveyor.com/project/pbatard/RPi4/build/artifacts). +[GitHub CI artifacts](https://github.com/pftf/RPi4/actions). The provided firmwares should be able to auto-detect the UART being used (PL011 or mini UART) according to whether `config.txt` contains the relevant overlay or not. The default diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index be830885..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2019-2021, Pete Batard -# SPDX-License-Identifier: BSD-3-Clause - -image: Ubuntu1804 - -skip_non_tags: true - -install: - sh: |- - sudo apt-get update -qq - sudo -E apt-get install -y acpica-tools gcc-aarch64-linux-gnu python3-distutils uuid-dev - git submodule update --init --recursive - patch --binary -d edk2 -p1 -i ../0001-MdeModulePkg-UefiBootManagerLib-Signal-ReadyToBoot-o.patch - -before_build: - ps: |- - Start-FileDownload https://github.com/raspberrypi/firmware/raw/master/boot/fixup4.dat - Start-FileDownload https://github.com/raspberrypi/firmware/raw/master/boot/start4.elf - Start-FileDownload https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-4-b.dtb - Start-FileDownload https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-cm4.dtb - Start-FileDownload https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-400.dtb - Start-FileDownload https://github.com/raspberrypi/firmware/raw/master/boot/overlays/miniuart-bt.dtbo - mkdir overlays - move miniuart-bt.dtbo overlays - -build_script: - sh: ./build_firmware.sh - -after_build: - sh: |- - 7z a RPi4_UEFI_Firmware_$APPVEYOR_REPO_TAG_NAME.zip $APPVEYOR_BUILD_FOLDER/Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd $APPVEYOR_BUILD_FOLDER/*.dtb $APPVEYOR_BUILD_FOLDER/config.txt $APPVEYOR_BUILD_FOLDER/fixup4.dat $APPVEYOR_BUILD_FOLDER/start4.elf overlays/miniuart-bt.dtbo $APPVEYOR_BUILD_FOLDER/Readme.md - sha256sum $APPVEYOR_BUILD_FOLDER/Build/RPi4/DEBUG_GCC5/FV/RPI_EFI.fd $APPVEYOR_BUILD_FOLDER/Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd RPi4_UEFI_Firmware_$APPVEYOR_REPO_TAG_NAME.zip - -artifacts: - - path: 'Build/RPi4/DEBUG_GCC5/FV/RPI_EFI.fd' - name: DEBUG RPi4 UEFI Firmware - - path: 'Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd' - name: RELEASE RPi4 UEFI Firmware - - path: '*.zip' - name: RPi 4 UEFI Firmware - -deploy: - release: $(APPVEYOR_REPO_TAG_NAME) - description: Raspberry Pi 4 UEFI Firmware $(APPVEYOR_REPO_TAG_NAME) - provider: GitHub - auth_token: - secure: w5YuQOim+G+U7FxxrL0BH6t0trCWKCs9DMZlF4xqF2XGC6SymzwaJrPWrKeeJHPK - artifact: /.*\.zip/ - draft: false - prerelease: false diff --git a/build_firmware.sh b/build_firmware.sh deleted file mode 100755 index 860cf11a..00000000 --- a/build_firmware.sh +++ /dev/null @@ -1,13 +0,0 @@ -# -# NOTICE: This script is *NOT* designed to be used in a standalone fashion. -# It is designed to be used as part of an Appveyor build, and only works if the -# preliminaries from the appveyor.yml 'install' section have been run first. -# -make -C edk2/BaseTools || exit 1 -export GCC5_AARCH64_PREFIX=aarch64-linux-gnu- -export WORKSPACE=$PWD -export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi -export BUILD_FLAGS="-D SECURE_BOOT_ENABLE=TRUE -D INCLUDE_TFTP_COMMAND=TRUE -D NETWORK_ISCSI_ENABLE=TRUE" -source edk2/edksetup.sh || exit 1 -build -a AARCH64 -t GCC5 -p edk2-platforms/Platform/RaspberryPi/RPi4/RPi4.dsc -b DEBUG --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor=L"https://github.com/pftf/RPi4" --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString=L"UEFI Firmware $APPVEYOR_REPO_TAG_NAME (DEBUG)" $BUILD_FLAGS || exit 1 -build -a AARCH64 -t GCC5 -p edk2-platforms/Platform/RaspberryPi/RPi4/RPi4.dsc -b RELEASE --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor=L"https://github.com/pftf/RPi4" --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString=L"UEFI Firmware $APPVEYOR_REPO_TAG_NAME" $BUILD_FLAGS || exit 1