Skip to content

Bump Grub to 2.12

Bump Grub to 2.12 #46

Workflow file for this run

name: Linux, gcc, EDK2
on:
push:
paths-ignore:
- '.gitignore'
- '.gitattributes'
- '**.cmd'
- '!set_grub_cpu.cmd'
- '**.md'
- '**.sh'
- '!set_grub_cpu.sh'
- '**.txt'
- '**.vbs'
pull_request:
paths-ignore:
- '.gitignore'
- '.gitattributes'
- '**.cmd'
- '!set_grub_cpu.cmd'
- '**.md'
- '**.sh'
- '!set_grub_cpu.sh'
- '**.txt'
- '**.vbs'
env:
BUILD_TYPE: RELEASE
COMPILER: GCC5
GCC5_ARM_PREFIX: arm-linux-gnueabi-
GCC5_AARCH64_PREFIX: aarch64-linux-gnu-
GCC5_RISCV64_PREFIX: riscv64-linux-gnu-
NASM_VERSION: 2.15.05
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [X64, IA32, AARCH64, ARM, RISCV64]
include:
- arch: X64
short: x64
pkgs: python3-distutils uuid-dev
- arch: IA32
short: ia32
pkgs: gcc-multilib python3-distutils uuid-dev
- arch: AARCH64
short: aa64
pkgs: gcc-aarch64-linux-gnu python3-distutils uuid-dev
- arch: ARM
short: arm
pkgs: gcc-arm-linux-gnueabi python3-distutils uuid-dev
- arch: RISCV64
short: riscv64
pkgs: gcc-riscv64-linux-gnu python3-distutils uuid-dev
steps:
- name: Install toolchain
run: sudo apt install ${{ matrix.pkgs }}
- name: Install nasm ${{ env.NASM_VERSION }}
# https://edk2.groups.io/g/devel/topic/89637409#87359
if: matrix.arch == 'X64' || matrix.arch == 'IA32'
run: |
curl -O https://www.nasm.us/pub/nasm/releasebuilds/${{ env.NASM_VERSION }}/nasm-${{ env.NASM_VERSION }}.tar.bz2
tar -xjf nasm-${{ env.NASM_VERSION }}.tar.bz2
cd nasm-${{ env.NASM_VERSION }}
./autogen.sh
./configure --prefix=/usr/local/
make
sudo make install
- name: Fix missing Risc-V header
if: matrix.arch == 'riscv64'
run: sudo ln -s /usr/riscv64-linux-gnu/include/gnu/stubs-lp64d.h /usr/riscv64-linux-gnu/include/gnu/stubs-lp64.h
- name: Set up EDK2
run: |
git clone --recursive https://github.com/tianocore/edk2.git
make -C edk2/BaseTools
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
path: edk2/EfiFsPkg
- name: Patch GRUB
run: |
cd edk2/EfiFsPkg/grub
git apply ../0001-GRUB-fixes.patch
- name: Build UEFI drivers
run: |
cd edk2
source edksetup.sh
./EfiFsPkg/set_grub_cpu.sh ${{ matrix.arch }}
build -a ${{ matrix.arch }} -b ${{ env.BUILD_TYPE }} -t ${{ env.COMPILER }} -p EfiFsPkg/EfiFsPkg.dsc
for f in Build/EfiFs/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.arch }}/*.efi; do mv "$f" "${f%.efi}_${{ matrix.short }}.efi"; done
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'push' }}
with:
name: gcc_edk2
path: edk2/Build/EfiFs/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.arch }}/*.efi
- name: Display SHA-256
if: startsWith(github.ref, 'refs/tags/')
run: |
mv edk2/Build/EfiFs/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.arch }}/*.efi .
sha256sum *.efi
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: ./*.efi
- name: Create web artifacts
if: startsWith(github.ref, 'refs/tags/')
run: |
GIT_VERSION=$(git --git-dir edk2/EfiFsPkg/.git describe --tags --abbrev=0)
DIR_VERSION=${GIT_VERSION:1}
mkdir -p web/${{ matrix.short }}
curl -L https://raw.githubusercontent.com/pbatard/efifs/gh-pages/downloads/header.html -o web/${{ matrix.short }}/index.html
printf "<pre><img src=\"/icons/blank.png\" alt=\"Icon\" width=\"32\" height=\"32\"> Name Last modified Size Description<hr><a href=\"/downloads/efifs-%s/\"><img src=\"/icons/back.png\" alt=\"[PARENTDIR]\" width=\"32\" height=\"32\"></a> <a href=\"/downloads/efifs-%s/\">Parent Directory</a> -\n" ${DIR_VERSION} ${DIR_VERSION} >> web/${{ matrix.short }}/index.html
for f in *.efi; do
TIMESTAMP=$(date -r $f "+%Y-%m-%d %H:%M");
SIZE=$(du --apparent-size -sh $f | awk '{ print $1 }');
LINK=https://github.com/pbatard/efifs/releases/download/${GIT_VERSION}/$f;
FILE_AND_TAG="$f</a>";
printf "<a href=\"%s\"><img src=\"/icons/uefi.svg\" alt=\"[EFI]\" width=\"32\" height=\"32\"></a> <a href=\"%s\">%-31s%-19s%-5s\n" "${LINK}" "${LINK}" "${FILE_AND_TAG}" "${TIMESTAMP}" "${SIZE}" >> web/${{ matrix.short }}/index.html;
done
printf "<hr></pre>\n </body>\n</html>\n" >> web/${{ matrix.short }}/index.html
- name: Upload web artifacts
uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: web_files
path: web/*/index.html