UEFI Shell 24H1 #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux, gcc, EDK2 | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
COMPILER: GCC5 | |
GCC5_ARM_PREFIX: arm-linux-gnueabi- | |
GCC5_AARCH64_PREFIX: aarch64-linux-gnu- | |
GCC5_RISCV64_PREFIX: riscv64-linux-gnu- | |
FULL_SHELL_GUID: EA4BB293-2D7F-4456-A681-1F22F42CD0BC | |
BUILD_TYPES: DEBUG RELEASE | |
ARCHS: X64 IA32 AARCH64 ARM RISCV64 | |
# Shell versions: | |
# 2.2 added on 2017.03.31 | |
# 2.1 added on 2014.08.05 | |
# 2.0 added on 2009.05.11 | |
EDK2_SHELL_VERSION_HEADER: edk2/MdePkg/Include/Protocol/Shell.h | |
# Was edk2/ShellPkg/Include/Protocol/EfiShell.h prior to 2016.10.18 | |
# enum ShellVersion added on 2009.05.11 | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Install toolchains | |
run: | | |
sudo apt-get update | |
sudo apt-get -y --no-install-recommends install gcc-13-multilib gcc-13-aarch64-linux-gnu gcc-13-arm-linux-gnueabi gcc-13-riscv64-linux-gnu nasm genisoimage | |
sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-13 /usr/bin/aarch64-linux-gnu-gcc | |
sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-ar-13 /usr/bin/aarch64-linux-gnu-gcc-ar | |
sudo ln -s /usr/bin/arm-linux-gnueabi-gcc-13 /usr/bin/arm-linux-gnueabi-gcc | |
sudo ln -s /usr/bin/arm-linux-gnueabi-gcc-ar-13 /usr/bin/arm-linux-gnueabi-gcc-ar | |
sudo ln -s /usr/bin/riscv64-linux-gnu-gcc-13 /usr/bin/riscv64-linux-gnu-gcc | |
sudo ln -s /usr/bin/riscv64-linux-gnu-gcc-ar-13 /usr/bin/riscv64-linux-gnu-gcc-ar | |
- name: Check out EDK2 repositories | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set version | |
id: set_version | |
run: | | |
SHELL_MAJOR_VERSION=$(awk '/SHELL_MAJOR_VERSION/{sub("\r", "", $NF); sub(",", "", $NF); print $NF}' ${{ env.EDK2_SHELL_VERSION_HEADER }}) | |
SHELL_MINOR_VERSION=$(awk '/SHELL_MINOR_VERSION/{sub("\r", "", $NF); print $NF}' ${{ env.EDK2_SHELL_VERSION_HEADER }}) | |
# NB: The following only works if the shell is bash | |
echo "shell_version=${SHELL_MAJOR_VERSION}.${SHELL_MINOR_VERSION}" >> $GITHUB_OUTPUT | |
echo "shell_release=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
echo "edk2_tag=$(git --git-dir edk2/.git describe --tags)" >> $GITHUB_OUTPUT | |
echo "build_date=$(date '+%Y.%m.%d')" >> $GITHUB_OUTPUT | |
- name: Set up EDK2 | |
run: make -C edk2/BaseTools | |
- name: Build UEFI binaries | |
run: | | |
cd edk2 | |
source edksetup.sh | |
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do | |
for ARCH in ${{ env.ARCHS }} ; do | |
build -a $ARCH -b $BUILD_TYPE -t ${{ env.COMPILER }} -p ShellPkg/ShellPkg.dsc --pcd gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount=8 --pcd gEfiShellPkgTokenSpaceGuid.PcdShellSupplier=L"${{ steps.set_version.outputs.edk2_tag }} (https://github.com/pbatard/UEFI-Shell)" | |
done | |
done | |
- name: Create individual Shell binaries | |
run: | | |
for ARCH in ${{ env.ARCHS }}; do | |
cp edk2/Build/Shell/RELEASE_${{ env.COMPILER }}/$ARCH/Shell_${{ env.FULL_SHELL_GUID }}.efi ./shell${ARCH,,}.efi | |
done | |
if [ -f ./shellaarch64.efi ]; then | |
mv ./shellaarch64.efi ./shellaa64.efi | |
fi | |
- name: Create ISO filesystem structure | |
run: | | |
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do | |
mkdir -p $BUILD_TYPE/efi/boot | |
for ARCH in ${{ env.ARCHS }}; do | |
mv edk2/Build/Shell/${BUILD_TYPE}_${{ env.COMPILER }}/$ARCH/Shell_${{ env.FULL_SHELL_GUID }}.efi $BUILD_TYPE/efi/boot/boot${ARCH,,}.efi | |
done | |
if [ -f $BUILD_TYPE/efi/boot/bootaarch64.efi ]; then | |
mv $BUILD_TYPE/efi/boot/bootaarch64.efi $BUILD_TYPE/efi/boot/bootaa64.efi | |
fi | |
printf "*** UEFI Shell v%s, release %s%s ***\n\n" ${{ steps.set_version.outputs.shell_version }} ${{ steps.set_version.outputs.shell_release }} "$( [ $BUILD_TYPE == DEBUG ] && echo ' (DEBUG BUILD)')" > $BUILD_TYPE/README.txt | |
printf "This bootable image contains builds of the official UEFI Shell, as provided by\n" >> $BUILD_TYPE/README.txt | |
printf "the Open Source 'EDK2' project (https://github.com/tianocore/edk2).\n\n" >> $BUILD_TYPE/README.txt | |
printf "More specifically, this release, which we call '%s', was produced using the\n" ${{ steps.set_version.outputs.shell_release }} >> $BUILD_TYPE/README.txt | |
printf "'%s' version of the EDK2 source available at:\n" ${{ steps.set_version.outputs.edk2_tag }} >> $BUILD_TYPE/README.txt | |
printf "https://github.com/tianocore/edk2/releases/tag/%s\n\n" ${{ steps.set_version.outputs.edk2_tag }} >> $BUILD_TYPE/README.txt | |
printf "This image supports the following UEFI platform architectures:\n" >> $BUILD_TYPE/README.txt | |
for ARCH in ${{ env.ARCHS }}; do | |
printf "* %s\n" $ARCH >> $BUILD_TYPE/README.txt | |
done | |
printf "\nFor more information on how this release was produced, you are invited to\n" >> $BUILD_TYPE/README.txt | |
printf "visit our official project page at https://github.com/pbatard/UEFI-Shell,\n" >> $BUILD_TYPE/README.txt | |
printf "where you can also validate that all of the binaries contained in this image\n" >> $BUILD_TYPE/README.txt | |
printf "were built from the unmodified EDK2 source, through an automated build process\n" >> $BUILD_TYPE/README.txt | |
printf "that guarantees that no malicious code can have been injected.\n" >> $BUILD_TYPE/README.txt | |
printf "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" > Version.xml | |
printf "<release>\n" >> Version.xml | |
printf " <name>%s (%s)</name>\n" ${{ steps.set_version.outputs.shell_release }} ${{ steps.set_version.outputs.edk2_tag }} >> Version.xml | |
printf " <shell_version>%s</shell_version>\n" ${{ steps.set_version.outputs.shell_version }} >> Version.xml | |
printf " <build_date>%s</build_date>\n" ${{ steps.set_version.outputs.build_date }} >> Version.xml | |
printf " <supported_archs>\n" >> Version.xml | |
for ARCH in ${{ env.ARCHS }}; do | |
printf " <arch>%s</arch>\n" $ARCH >> Version.xml | |
done | |
printf " </supported_archs>\n" >> Version.xml | |
printf "</release>\n" >> Version.xml | |
done | |
- name: Generate ISO images | |
run: | | |
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do | |
genisoimage -v -V "UEFI SHELL ${{ steps.set_version.outputs.shell_version }} ${{ steps.set_version.outputs.shell_release }} ($BUILD_TYPE)" -JR -o "UEFI-Shell-${{ steps.set_version.outputs.shell_version }}-${{ steps.set_version.outputs.shell_release }}-$BUILD_TYPE.iso" $BUILD_TYPE | |
done | |
- name: Display SHA-256 | |
run: | | |
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do | |
sha256sum $BUILD_TYPE/efi/boot/*.efi | |
done | |
sha256sum *.iso | |
sha256sum *.efi | |
- name: Upload ISO artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ISOs | |
path: ./*.iso | |
- name: Create release blurb | |
run: | | |
printf "**UEFI Shell v%s, release %s**\n\n" ${{ steps.set_version.outputs.shell_version }} ${{ steps.set_version.outputs.shell_release }} > body.txt | |
printf "Built from [%s](https://github.com/tianocore/edk2/releases/tag/%s) and supporting:\n" ${{ steps.set_version.outputs.edk2_tag }} ${{ steps.set_version.outputs.edk2_tag }} >> body.txt | |
for ARCH in ${{ env.ARCHS }}; do | |
printf "* \`%s\`\n" $ARCH >> body.txt | |
done | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body_path: ./body.txt | |
files: | | |
./*.iso | |
./*.efi | |
./Version.xml |