32 lines
1.1 KiB
Bash
32 lines
1.1 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
K=/path/to/pf/Ventoy/keys
|
|
G=/path/to/pf/ParavisGrub
|
|
D=/mnt/f/efi/Paravis/Boot/grub2
|
|
APPS="$D/apps"
|
|
mkdir -p "$APPS"
|
|
|
|
echo "=== grub core"
|
|
cp -f "$G/grubx64.efi" "$D/grubx64.efi"
|
|
|
|
echo "=== sign helper EFI apps for chainloading under Secure Boot"
|
|
sign_app() {
|
|
local src="$1" dst="$2"
|
|
rm -f /tmp/a.efi /tmp/a2.efi
|
|
python3 /path/to/pf/Ventoy/add-sbat.py "$src" /tmp/a.efi >/dev/null
|
|
if sbattach --detach /tmp/old.p7 /tmp/a.efi >/dev/null 2>&1; then sbattach --remove /tmp/a.efi; fi
|
|
sbsign --key "$K/ventoy.key" --cert "$K/ventoy.crt" --output /tmp/a2.efi /tmp/a.efi >/dev/null
|
|
sbverify --cert "$K/ventoy.crt" /tmp/a2.efi >/dev/null
|
|
cp -f /tmp/a2.efi "$dst"
|
|
printf " %-16s %s\n" "$(basename "$dst")" "$(stat -c %s "$dst")"
|
|
}
|
|
sign_app /mnt/f/efi/Paravis/Boot/super/x64.efi "$APPS/super.efi"
|
|
sign_app /mnt/f/efi/Paravis/Boot/gfm/x64.efi "$APPS/gfm.efi"
|
|
sign_app /mnt/f/EFI/Boot/memtest.efi "$APPS/memtest.efi"
|
|
|
|
echo "=== font (for later theme)"
|
|
cp -f /path/to/pf/Ventoy/vtoyefi/grub/fonts/unicode.pf2 "$D/unicode.pf2"
|
|
|
|
echo "=== done, tree:"
|
|
ls -l "$D" "$APPS"
|