2020-05-20 10:36:27 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
VT_GRUB_DIR=$PWD
|
|
|
|
|
|
|
|
rm -rf INSTALL
|
|
|
|
rm -rf SRC
|
|
|
|
rm -rf NBP
|
|
|
|
rm -rf PXE
|
|
|
|
|
|
|
|
mkdir SRC
|
|
|
|
mkdir NBP
|
|
|
|
mkdir PXE
|
|
|
|
|
2021-01-29 04:54:04 -05:00
|
|
|
tar -xf grub-2.04.tar.xz -C ./SRC/
|
2020-05-20 10:36:27 -04:00
|
|
|
|
|
|
|
/bin/cp -a ./MOD_SRC/grub-2.04 ./SRC/
|
|
|
|
|
|
|
|
cd ./SRC/grub-2.04
|
|
|
|
|
|
|
|
|
2021-01-28 21:11:30 -05:00
|
|
|
# build for x86_64-efi
|
2021-01-29 04:54:04 -05:00
|
|
|
echo '======== build grub2 for x86_64-efi ==============='
|
2020-05-20 10:36:27 -04:00
|
|
|
make distclean
|
|
|
|
./autogen.sh
|
|
|
|
./configure --with-platform=efi --prefix=$VT_GRUB_DIR/INSTALL/
|
2021-02-06 12:01:04 -05:00
|
|
|
make -j 16 || exit 1
|
2020-05-20 10:36:27 -04:00
|
|
|
sh install.sh uefi
|
|
|
|
|
|
|
|
|
2021-01-28 21:11:30 -05:00
|
|
|
#build for i386-efi
|
2021-01-29 04:54:04 -05:00
|
|
|
echo '======== build grub2 for i386-efi ==============='
|
2021-01-07 07:40:30 -05:00
|
|
|
make distclean
|
|
|
|
./autogen.sh
|
|
|
|
./configure --target=i386 --with-platform=efi --prefix=$VT_GRUB_DIR/INSTALL/
|
2021-02-06 12:01:04 -05:00
|
|
|
make -j 16 || exit 1
|
2021-01-07 07:40:30 -05:00
|
|
|
sh install.sh i386efi
|
|
|
|
|
|
|
|
|
2021-01-28 21:11:30 -05:00
|
|
|
|
|
|
|
#build for arm64 EFI
|
2021-01-29 04:54:04 -05:00
|
|
|
echo '======== build grub2 for arm64-efi ==============='
|
2021-01-28 21:11:30 -05:00
|
|
|
PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin
|
|
|
|
make distclean
|
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix=$VT_GRUB_DIR/INSTALL/ \
|
|
|
|
--target=aarch64 --with-platform=efi \
|
|
|
|
--host=x86_64-linux-gnu \
|
|
|
|
HOST_CC=x86_64-linux-gnu-gcc \
|
|
|
|
BUILD_CC=gcc \
|
|
|
|
TARGET_CC=aarch64-linux-gnu-gcc \
|
|
|
|
TARGET_OBJCOPY=aarch64-linux-gnu-objcopy \
|
|
|
|
TARGET_STRIP=aarch64-linux-gnu-strip TARGET_NM=aarch64-linux-gnu-nm \
|
|
|
|
TARGET_RANLIB=aarch64-linux-gnu-ranlib
|
2021-02-06 12:01:04 -05:00
|
|
|
make -j 16 || exit 1
|
2021-01-28 21:11:30 -05:00
|
|
|
sh install.sh arm64
|
|
|
|
|
|
|
|
|
2021-03-05 10:03:34 -05:00
|
|
|
#build for mips64el EFI
|
|
|
|
#http://ftp.loongnix.org/os/loongnix-server/1.7/os/Source/SPackages/grub2-2.02-0.40.lns7.14.loongnix.src.rpm
|
|
|
|
make distclean
|
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix=/home/share/Ventoy/GRUB2/INSTALL/ \
|
|
|
|
--target=mips64el --with-platform=efi \
|
|
|
|
--host=x86_64-linux-gnu \
|
|
|
|
HOST_CC=x86_64-linux-gnu-gcc \
|
|
|
|
BUILD_CC=gcc \
|
|
|
|
TARGET_CC="mips-linux-gnu-gcc -mabi=64 -Wno-error=cast-align -Wno-error=misleading-indentation" \
|
|
|
|
TARGET_OBJCOPY=mips-linux-gnu-objcopy \
|
|
|
|
TARGET_STRIP=mips-linux-gnu-strip TARGET_NM=mips-linux-gnu-nm \
|
|
|
|
TARGET_RANLIB=mips-linux-gnu-ranlib
|
|
|
|
make -j 16 || exit 1
|
|
|
|
sh install.sh mips64el
|
|
|
|
|
|
|
|
|
2021-01-28 21:11:30 -05:00
|
|
|
|
|
|
|
# build for i386-pc
|
2021-01-29 04:54:04 -05:00
|
|
|
echo '======== build grub2 for i386-pc ==============='
|
2021-02-01 23:03:53 -05:00
|
|
|
make distclean
|
2021-01-28 21:11:30 -05:00
|
|
|
./autogen.sh
|
2021-02-01 23:03:53 -05:00
|
|
|
./configure --target=i386 --with-platform=pc --prefix=$VT_GRUB_DIR/INSTALL/
|
2021-02-06 12:01:04 -05:00
|
|
|
make -j 16 || exit 1
|
2021-01-28 21:11:30 -05:00
|
|
|
sh install.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-20 10:36:27 -04:00
|
|
|
cd ../../
|
|
|
|
|