buildgrub.sh 2.02 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

VT_GRUB_DIR=$PWD

rm -rf INSTALL
rm -rf SRC
rm -rf NBP
rm -rf PXE

mkdir SRC
mkdir NBP
mkdir PXE

longpanda's avatar
longpanda committed
14
tar -xf grub-2.04.tar.xz -C ./SRC/
15
16
17
18
19
20

/bin/cp -a ./MOD_SRC/grub-2.04  ./SRC/

cd ./SRC/grub-2.04


longpanda's avatar
longpanda committed
21
# build for x86_64-efi
longpanda's avatar
longpanda committed
22
echo '======== build grub2 for x86_64-efi ==============='
23
24
25
make distclean
./autogen.sh
./configure  --with-platform=efi --prefix=$VT_GRUB_DIR/INSTALL/
longpanda's avatar
longpanda committed
26
make -j 16 || exit 1
27
28
29
sh install.sh  uefi


longpanda's avatar
longpanda committed
30
#build for i386-efi
longpanda's avatar
longpanda committed
31
echo '======== build grub2 for i386-efi ==============='
longpanda's avatar
longpanda committed
32
33
34
make distclean
./autogen.sh
./configure --target=i386 --with-platform=efi  --prefix=$VT_GRUB_DIR/INSTALL/
longpanda's avatar
longpanda committed
35
make -j 16 || exit 1
longpanda's avatar
longpanda committed
36
37
38
sh install.sh  i386efi


longpanda's avatar
longpanda committed
39
40

#build for arm64 EFI
longpanda's avatar
longpanda committed
41
echo '======== build grub2 for arm64-efi ==============='
longpanda's avatar
longpanda committed
42
43
44
45
46
47
48
49
50
51
52
53
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
longpanda's avatar
longpanda committed
54
make -j 16 || exit 1
longpanda's avatar
longpanda committed
55
56
57
sh install.sh arm64


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#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


longpanda's avatar
longpanda committed
75
76

# build for i386-pc
longpanda's avatar
longpanda committed
77
echo '======== build grub2 for i386-pc ==============='
longpanda's avatar
longpanda committed
78
make distclean
longpanda's avatar
longpanda committed
79
./autogen.sh
longpanda's avatar
longpanda committed
80
./configure --target=i386 --with-platform=pc --prefix=$VT_GRUB_DIR/INSTALL/
longpanda's avatar
longpanda committed
81
make -j 16 || exit 1
longpanda's avatar
longpanda committed
82
83
84
85
sh install.sh



86
87
cd ../../