From ade782f35d55f27356720dc7af76a62ec8d5a182 Mon Sep 17 00:00:00 2001 From: chenall Date: Fri, 19 Nov 2021 11:57:43 +0800 Subject: [PATCH] Update build-ext.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 判断 bios 和 efi 版本并只编译相应的扩展 bios 版本强制指定 gcc 版本为 4.8 --- build-ext.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build-ext.sh b/build-ext.sh index 121accc..58bf063 100755 --- a/build-ext.sh +++ b/build-ext.sh @@ -3,7 +3,14 @@ set -e git clone --depth=1 https://github.com/chenall/grubutils.git $GITHUB_WORKSPACE/grubutils pushd $GITHUB_WORKSPACE/grubutils -make -C umbr -make -j -C g4dext && mv g4dext/bin g4dext/ext -make -j -C g4eext && mv g4eext/bin g4eext/ext +GRUB4DOS_VER=$(cat $GITHUB_WORKSPACE/grub4dos_version) +if [ "${GRUB4DOS_VER/EFI}" = "${GRUB4DOS_VER}" ]; then + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 + make -C umbr + make -j -C g4dext && mv g4dext/bin g4dext/ext + make -C g4dext clean +else + make -j -C g4eext && mv g4eext/bin g4eext/ext + make -C g4eext clean +fi popd