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

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
baseDir="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
printf \
'\033[?47l\012'
@@ -9,7 +9,7 @@ printf \
cat << EOF
#######################################
## ##
## $(cat "${BASEDIR}/title") Script ##
## $(cat "${baseDir}/title") Script ##
## ##
## Jean <jean@easthighnerd.net> ##
## ##
@@ -27,7 +27,7 @@ EOF
source \
/etc/os-release
source \
"${BASEDIR}/system.conf"
"${baseDir}/system.conf"
if [[ ! "${DISK}" == **/dev/disk/by-id/** ]]; then
if [[ "${DISK}" == **/dev/nvme** ]]; then
@@ -227,47 +227,7 @@ if [[ ! "${*}" = *--no-part* ]]; then
fi
if [[ ! "${*}" = *--no-part* ]]; then
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
cp \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI
cp \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/BOOT/BOOTX64.EFI
cp \
/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'
"${baseDir}/efi.sh"
fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
@@ -289,4 +249,4 @@ zfs \
snapshot \
${HOSTNAME,,}/ROOT/${ID}@install
"${BASEDIR}/post-inst.sh"
"${baseDir}/post-inst.sh"