Toolchain: Build grub with efi capabilities

This commit is contained in:
Bananymous 2023-10-16 01:37:12 +03:00
parent dafc016293
commit cb65be3e33
1 changed files with 32 additions and 1 deletions

View File

@ -3,6 +3,7 @@ set -e
BINUTILS_VERSION="binutils-2.39" BINUTILS_VERSION="binutils-2.39"
GCC_VERSION="gcc-12.2.0" GCC_VERSION="gcc-12.2.0"
GRUB_VERSION="grub-2.06"
cd $(dirname "$0") cd $(dirname "$0")
@ -74,7 +75,7 @@ if [ ! -f ${PREFIX}/bin/${TARGET}-g++ ]; then
fi fi
mkdir -p build/${GCC_VERSION}/ mkdir -p build/${GCC_VERSION}/
cd build/${GCC_VERSION}/ pushd build/${GCC_VERSION}/
../../${GCC_VERSION}/configure \ ../../${GCC_VERSION}/configure \
--target="$TARGET" \ --target="$TARGET" \
@ -87,4 +88,34 @@ if [ ! -f ${PREFIX}/bin/${TARGET}-g++ ]; then
make -j $(nproc) all-target-libgcc CFLAGS_FOR_TARGET='-g -O2 -mcmodel=large -mno-red-zone' make -j $(nproc) all-target-libgcc CFLAGS_FOR_TARGET='-g -O2 -mcmodel=large -mno-red-zone'
make install-gcc install-target-libgcc make install-gcc install-target-libgcc
popd
fi
if [ ! -f ${PREFIX}/bin/grub-mkstandalone ]; then
echo "Building ${GRUB_VERSION}"
if [ ! -f ${GRUB_VERSION}.tar.xz ]; then
wget https://ftp.gnu.org/gnu/grub/${GRUB_VERSION}.tar.xz
fi
if [ ! -d $GRUB_VERSION ]; then
tar xvf ${GRUB_VERSION}.tar.xz
fi
mkdir -p build/${GRUB_VERSION}/
pushd build/${GRUB_VERSION}/
../../${GRUB_VERSION}/configure \
--target="$ARCH" \
--prefix="$PREFIX" \
--with-platform="efi" \
--disable-werror
make -j $(nproc)
make install
popd
fi fi