29 lines
1.0 KiB
Bash
29 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
ROOT=/root/vtbuild-arm64
|
|
SRC=$ROOT/GRUB2/SRC/grub-2.04
|
|
LIB=$ROOT/GRUB2/INSTALL/lib/grub/arm64-efi
|
|
cd "$SRC"
|
|
|
|
rm -f "$LIB/gcry_sha256.mod"
|
|
net_modules_uefi="efinet net tftp http"
|
|
arm64_modules=$(sed -n 's/^all_modules_arm64_uefi="\(.*\)"$/\1/p' install.sh)
|
|
mods="crypto gcry_crc gcry_sha1 gcry_md5 gcry_sha512"
|
|
for m in $net_modules_uefi $arm64_modules; do
|
|
[ "$m" = "gcry_sha256" ] && continue
|
|
case " $mods " in *" $m "*) ;; *) mods="$mods $m" ;; esac
|
|
done
|
|
echo "modules: $(echo $mods | wc -w)"
|
|
|
|
echo "--- machines of crypto modules:"
|
|
for m in crypto gcry_crc gcry_sha1 gcry_md5 gcry_sha512 gzio ventoy; do
|
|
printf " %-12s %s\n" "$m" "$(readelf -h "$LIB/$m.mod" | awk -F: '/Machine:/{print $2}')"
|
|
done
|
|
|
|
./grub-mkimage -O arm64-efi -o /tmp/BOOTAA64_new.EFI -p '(,2)/grub' -d "$LIB" --compression auto $mods
|
|
echo "image: $(stat -c %s /tmp/BOOTAA64_new.EFI)"
|
|
file /tmp/BOOTAA64_new.EFI
|
|
for s in '(,2)/grub' 'VTOY_DATA_PART_IDX' 'ISO/Ventoy/ventoy.json'; do
|
|
echo " $s : $(grep -c -a -F "$s" /tmp/BOOTAA64_new.EFI)"
|
|
done
|