-
Notifications
You must be signed in to change notification settings - Fork 140
80 lines (76 loc) · 4.08 KB
/
linux_edk2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright (c) 2021, Pete Batard <[email protected]>
# 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 firmware
- 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