5 rm -rf $VT_DIR/GRUB
2/INSTALL
6 rm -rf $VT_DIR/GRUB
2/PXE
7 mkdir -p $VT_DIR/GRUB
2/INSTALL
8 mkdir -p $VT_DIR/GRUB
2/PXE
12 PATH
=$VT_DIR/GRUB
2/INSTALL
/bin
/:$VT_DIR/GRUB
2/INSTALL
/sbin
/:$PATH
14 net_modules_legacy
="net tftp http"
15 all_modules_legacy
="file setkey date drivemap blocklist regexp newc vga_text ntldr search at_keyboard usb_keyboard gcry_md5 hashsum gzio xzio lzopio lspci pci ext2 xfs ventoy chain read halt iso9660 linux16 test true sleep reboot echo videotest videoinfo videotest_checksum video_colors video_cirrus video_bochs vga vbe video_fb font video gettext extcmd terminal linux minicmd help configfile tr trig boot biosdisk disk ls tar squash4 password_pbkdf2 all_video png jpeg part_gpt part_msdos fat exfat ntfs loopback gzio normal udf gfxmenu gfxterm gfxterm_background gfxterm_menu smbios"
17 net_modules_uefi
="efinet net tftp http"
18 all_modules_uefi
="file setkey blocklist ventoy test true regexp newc search at_keyboard usb_keyboard gcry_md5 hashsum gzio xzio lzopio ext2 xfs read halt sleep serial terminfo png password_pbkdf2 gcry_sha512 pbkdf2 part_gpt part_msdos ls tar squash4 loopback part_apple minicmd diskfilter linux relocator jpeg iso9660 udf hfsplus halt acpi mmap gfxmenu video_colors trig bitmap_scale gfxterm bitmap font fat exfat ntfs fshelp efifwsetup reboot echo configfile normal terminal gettext chain priority_queue bufio datetime cat extcmd crypto gzio boot all_video efi_gop efi_uga video_bochs video_cirrus video video_fb gfxterm_background gfxterm_menu mouse fwload smbios"
20 all_modules_arm64_uefi
="file setkey blocklist ventoy test true regexp newc search gcry_md5 hashsum gzio xzio lzopio ext2 xfs read halt sleep serial terminfo png password_pbkdf2 gcry_sha512 pbkdf2 part_gpt part_msdos ls tar squash4 loopback part_apple minicmd diskfilter linux jpeg iso9660 udf hfsplus halt acpi mmap gfxmenu video_colors trig bitmap_scale gfxterm bitmap font fat exfat ntfs fshelp efifwsetup reboot echo configfile normal terminal gettext chain priority_queue bufio datetime cat extcmd crypto gzio boot all_video efi_gop video video_fb gfxterm_background gfxterm_menu"
22 all_modules_mips64el_uefi
="file setkey blocklist ventoy test true regexp newc search gcry_md5 hashsum gzio xzio lzopio ext2 xfs read halt sleep serial terminfo png password_pbkdf2 gcry_sha512 pbkdf2 part_gpt part_msdos ls tar squash4 loopback part_apple minicmd diskfilter linux jpeg iso9660 udf hfsplus halt acpi mmap gfxmenu video_colors trig bitmap_scale gfxterm bitmap font fat exfat ntfs fshelp efifwsetup reboot echo configfile normal terminal gettext chain priority_queue bufio datetime cat extcmd crypto gzio boot all_video efi_gop video video_fb gfxterm_background gfxterm_menu"
25 if [ "$1" = "uefi" ]; then
26 all_modules
="$net_modules_uefi $all_modules_uefi "
28 grub
-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/x86_64-efi" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/EFI/BOOT/grubx64_real.efi" --format 'x86_64-efi' --compression 'auto' $all_modules_uefi
30 #grub-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/x86_64-efi" -c "$VT_DIR/LiveCD/GRUB/embed.cfg" --prefix '/EFI/boot' --output "$VT_DIR/LiveCD/GRUB/bootx64.efi" --format 'x86_64-efi' --compression 'auto' $all_modules_uefi 'fat' 'part_msdos'
31 elif [ "$1" = "i386efi" ]; then
32 all_modules
="$net_modules_uefi $all_modules_uefi "
34 grub
-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/i386-efi" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/EFI/BOOT/grubia32_real.efi" --format 'i386-efi' --compression 'auto' $all_modules_uefi
35 elif [ "$1" = "arm64" ]; then
36 all_modules
="$net_modules_uefi $all_modules_arm64_uefi "
38 grub
-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/arm64-efi" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/EFI/BOOT/BOOTAA64.EFI" --format 'arm64-efi' --compression 'auto' $all_modules_arm64_uefi
39 elif [ "$1" = "mips64el" ]; then
40 all_modules
="$net_modules_uefi $all_modules_mips64el_uefi "
42 grub
-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/mips64el-efi" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/EFI/BOOT/BOOTMIPS.EFI" --format 'mips64el-efi' --compression 'auto' $all_modules_mips64el_uefi
44 all_modules
="$net_modules_legacy $all_modules_legacy "
45 grub
-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/grub/i386-pc/core.img" --format 'i386-pc' --compression 'auto' $all_modules_legacy 'fat' 'part_msdos' 'biosdisk'
47 #grub-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc" -c "$VT_DIR/LiveCD/GRUB/embed.cfg" --prefix '/EFI/boot' --output "$VT_DIR/LiveCD/GRUB/cdrom.img" --format 'i386-pc-eltorito' --compression 'auto' $all_modules_legacy 'biosdisk' 'iso9660' 'fat' 'part_msdos'
48 #rm -f $VT_DIR/LiveCD/GRUB/boot_hybrid.img
49 #cp -a $VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc/boot_hybrid.img $VT_DIR/LiveCD/GRUB/boot_hybrid.img
52 grub
-mknetdir --modules="$all_modules" --net-directory=$VT_DIR/GRUB
2/PXE
--subdir=grub2
--locales=en@quot
|| exit 1
54 if [ "$1" = "uefi" ]; then
55 rm -f $VT_DIR/GRUB
2/NBP
/core.efi
56 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/x86_64
-efi/core.efi
$VT_DIR/GRUB
2/NBP
/core.efi
|| exit 1
58 rm -rf $VT_DIR/INSTALL
/grub
/x86_64
-efi
59 mkdir -p $VT_DIR/INSTALL
/grub
/x86_64
-efi
61 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/x86_64
-efi/normal.mod
$VT_DIR/INSTALL
/grub
/x86_64
-efi/normal.mod
|| exit 1
64 ls -1 $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/x86_64
-efi/ | egrep '\.(lst|mod)$' | while read line
; do
65 if ! echo $all_modules | grep -q " ${line%.mod} "; then
67 cp -a $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/x86_64
-efi/$line $VT_DIR/INSTALL
/grub
/x86_64
-efi/
70 elif [ "$1" = "i386efi" ]; then
71 rm -f $VT_DIR/GRUB
2/NBP
/core.efi
72 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/i386
-efi/core.efi
$VT_DIR/GRUB
2/NBP
/core.efi
|| exit 1
74 rm -rf $VT_DIR/INSTALL
/grub
/i386
-efi
75 mkdir -p $VT_DIR/INSTALL
/grub
/i386
-efi
77 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/i386
-efi/normal.mod
$VT_DIR/INSTALL
/grub
/i386
-efi/normal.mod
|| exit 1
80 ls -1 $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/i386
-efi/ | egrep '\.(lst|mod)$' | while read line
; do
81 if ! echo $all_modules | grep -q " ${line%.mod} "; then
83 cp -a $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/i386
-efi/$line $VT_DIR/INSTALL
/grub
/i386
-efi/
86 elif [ "$1" = "arm64" ]; then
87 rm -f $VT_DIR/GRUB
2/NBP
/core.efi
88 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/arm64
-efi/core.efi
$VT_DIR/GRUB
2/NBP
/core.efi
|| exit 1
90 rm -rf $VT_DIR/INSTALL
/grub
/arm64
-efi
91 mkdir -p $VT_DIR/INSTALL
/grub
/arm64
-efi
93 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/arm64
-efi/normal.mod
$VT_DIR/INSTALL
/grub
/arm64
-efi/normal.mod
|| exit 1
96 ls -1 $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/arm64
-efi/ | egrep '\.(lst|mod)$' | while read line
; do
97 if ! echo $all_modules | grep -q " ${line%.mod} "; then
99 cp -a $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/arm64
-efi/$line $VT_DIR/INSTALL
/grub
/arm64
-efi/
100 xz
$VT_DIR/INSTALL
/grub
/arm64
-efi/$line
101 mv $VT_DIR/INSTALL
/grub
/arm64
-efi/${line}.xz
$VT_DIR/INSTALL
/grub
/arm64
-efi/${line}
104 elif [ "$1" = "mips64el" ]; then
105 rm -f $VT_DIR/GRUB
2/NBP
/core.efi
106 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/mips64el
-efi/core.efi
$VT_DIR/GRUB
2/NBP
/core.efi
|| exit 1
108 rm -rf $VT_DIR/INSTALL
/grub
/mips64el
-efi
109 mkdir -p $VT_DIR/INSTALL
/grub
/mips64el
-efi
111 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/mips64el
-efi/normal.mod
$VT_DIR/INSTALL
/grub
/mips64el
-efi/normal.mod
|| exit 1
114 ls -1 $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/mips64el
-efi/ | egrep '\.(lst|mod)$' | while read line
; do
115 if ! echo $all_modules | grep -q " ${line%.mod} "; then
116 echo "Copy $line ..."
117 cp -a $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/mips64el
-efi/$line $VT_DIR/INSTALL
/grub
/mips64el
-efi/
118 xz
$VT_DIR/INSTALL
/grub
/mips64el
-efi/$line
119 mv $VT_DIR/INSTALL
/grub
/mips64el
-efi/${line}.xz
$VT_DIR/INSTALL
/grub
/mips64el
-efi/${line}
123 rm -f $VT_DIR/GRUB
2/NBP
/core
.0
124 cp -a $VT_DIR/GRUB
2/PXE
/grub
2/i386
-pc/core
.0 $VT_DIR/GRUB
2/NBP
/core
.0 || exit 1
126 rm -f $VT_DIR/INSTALL
/grub
/i386
-pc/boot.img
127 cp -a $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/i386
-pc/boot.img
$VT_DIR/INSTALL
/grub
/i386
-pc/boot.img
|| exit 1
130 ls -1 $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/i386
-pc/ | egrep '\.(lst|mod)$' | while read line
; do
131 if ! echo $all_modules | grep -q " ${line%.mod} "; then
132 echo "Copy $line ..."
133 rm -f $VT_DIR/INSTALL
/grub
/i386
-pc/$line
134 cp -a $VT_DIR/GRUB
2/INSTALL
/lib
/grub
/i386
-pc/$line $VT_DIR/INSTALL
/grub
/i386
-pc/