From 671450057c5a31c6d78bbfc9a2a5aed12f6d40c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Mon, 23 Oct 2023 23:22:40 +0200 Subject: [PATCH] .github/{scripts,worflows}: add support to build ipxe.efi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support to build ipxe.efi and use it in Dasharo (UEFI) build for QEMU Q35. Signed-off-by: Piotr Król --- .github/scripts/build-ipxe.sh | 8 ++++++++ .github/scripts/build-qemu.sh | 1 + .github/workflows/build.yml | 17 +++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100755 .github/scripts/build-ipxe.sh diff --git a/.github/scripts/build-ipxe.sh b/.github/scripts/build-ipxe.sh new file mode 100755 index 0000000000..399fb3f31c --- /dev/null +++ b/.github/scripts/build-ipxe.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +export CROSS_COMPILE="x86_64-elf-" +make -C src bin-x86_64-efi-sb/ipxe.efi EMBED=$PWD/dasharo.ipxe BUILD_ID_CMD="echo 0x1234567890" \ + EXTRA_CFLAGS="-Wno-address-of-packed-member -m64 -fuse-ld=bfd \ + -Wl,--build-id=none -fno-delete-null-pointer-checks -Wlogical-op -march=nocona \ + -malign-data=abi -mcmodel=large -mno-red-zone -fno-pic" + diff --git a/.github/scripts/build-qemu.sh b/.github/scripts/build-qemu.sh index 9b49b06643..9601a60a48 100755 --- a/.github/scripts/build-qemu.sh +++ b/.github/scripts/build-qemu.sh @@ -5,6 +5,7 @@ source ./edksetup.sh export EDK2_PLATFORMS_PATH="$WORKSPACE/edk2-platforms" export PACKAGES_PATH="$WORKSPACE:\ +$HOME/ipxe/src/bin-x86_64-efi-sb/:\ $EDK2_PLATFORMS_PATH/Platform/Intel:\ $EDK2_PLATFORMS_PATH/Silicon/Intel:\ $EDK2_PLATFORMS_PATH/Features/Intel:\ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be70552707..53caabfc57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,23 @@ jobs: git checkout 3323ed481d35096fb6a7eae7b49f35eff00f86cf && \ cd - + - name: Clone iPXE Repository + run: | + git clone https://git.ipxe.org/ipxe.git && \ + cd ipxe && \ + git checkout 4bffe0f0d9d0e1496ae5cfb7579e813277c29b0f && \ + sed -i 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "src/config/general.h" && \ + sed -i 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "src/config/general.h" && \ + wget https://raw.githubusercontent.com/Dasharo/dasharo-blobs/main/dasharo/dasharo.ipxe + + - name: Build iPXE + run: | + docker run --rm -i -v $PWD:/home/coreboot/ipxe:rw \ + -v $PWD/../.github:/home/coreboot/ipxe/.github \ + -u $(id -u):$(id -g) -w /home/coreboot/ipxe \ + coreboot/coreboot-sdk:2021-09-23_b0d87f753c \ + ./.github/scripts/build-ipxe.sh + - name: Build OVMF Firmware Image run: | docker run --rm -i -v $PWD:/home/coreboot/coreboot:rw \