Move EFI related commands/tasks into dedicated script

This commit is contained in:
2025-11-05 12:18:37 -05:00
parent 82871fc03a
commit 0b033e852c
3 changed files with 67 additions and 46 deletions

61
efi.sh Normal file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(basename "${0}")")"
source \
"${baseDir}/system.conf"
mkdir \
-p \
/boot/efi/EFI/ZBM
mkdir \
-p \
/boot/efi/EFI/BOOT
curl \
--progress-bar \
--show-error \
--output \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
--location \
https://get.zfsbootmenu.org/efi
rsync \
-pogAXtlHrDx \
--stats \
--info=progress2 \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI
rsync \
-pogAXtlHrDx \
--stats \
--info=progress2 \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/BOOT/BOOTX64.EFI
rsync \
-pogAXtlHrDx \
--stats \
--info=progress2 \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/BOOT/shellx64.efi
efibootmgr \
-c \
-d "${disk}" \
-p '1' \
-L 'ZFSBootMenu (Backup)' \
-l '\EFI\ZBM\VMLINUZ-BACKUP.EFI'
efibootmgr \
-c \
-d "${disk}" \
-p '1' \
-L 'ZFSBootMenu' \
-l '\EFI\ZBM\VMLINUZ.EFI'