refactor(zbm): Add ZBM postconf hook (#3)
We're adding this to our chroot after we've generated a ZBM UEFI image file /without/ this hook script. It's meant to run only in our real OS.
This commit is contained in:
parent
dcc3cf7d93
commit
598b176ec6
22
setup.sh
22
setup.sh
@ -18,6 +18,7 @@ exec 3>&1
|
|||||||
|
|
||||||
declare this_script_url
|
declare this_script_url
|
||||||
this_script_url="${SCRIPT_URL:?}"
|
this_script_url="${SCRIPT_URL:?}"
|
||||||
|
postconf_hook="$(dirname "${this_script_url}")"'/zbm_set_new_uefi_boot_entries.sh'
|
||||||
|
|
||||||
declare zpool_name zfs_arch_dataset_name
|
declare zpool_name zfs_arch_dataset_name
|
||||||
zpool_name='zpool'
|
zpool_name='zpool'
|
||||||
@ -674,21 +675,10 @@ function add_zbm_to_efi () {
|
|||||||
local efi_disks_list
|
local efi_disks_list
|
||||||
efi_disks_list="$(get_disks_with_one_efipart)"
|
efi_disks_list="$(get_disks_with_one_efipart)"
|
||||||
if grep -Piq -- '^'"${efi_drive}"'$' <<<"${efi_disks_list}"; then
|
if grep -Piq -- '^'"${efi_drive}"'$' <<<"${efi_disks_list}"; then
|
||||||
efibootmgr --disk "${efi_drive}" \
|
function insert_zbm_postconf_hook () {
|
||||||
--part 1 \
|
declare postconf_target_abs='/mnt/etc/zfsbootmenu/posthooks.d/'"$(basename "${postconf_hook}")"
|
||||||
--create \
|
curl --silent --location "${postconf_hook}" --output "${postconf_target_abs}"
|
||||||
--label "ZFSBootMenu recovery" \
|
chmod +x "${postconf_target_abs}"
|
||||||
--loader "\EFI\zbm\zfsbootmenu-recovery-vmlinuz-x86_64.EFI" \
|
|
||||||
--verbose
|
|
||||||
efibootmgr --disk "${efi_drive}" \
|
|
||||||
--part 1 \
|
|
||||||
--create \
|
|
||||||
--label "ZFSBootMenu release" \
|
|
||||||
--loader "\EFI\zbm\zfsbootmenu-release-vmlinuz-x86_64.EFI" \
|
|
||||||
--verbose
|
|
||||||
fi
|
|
||||||
efibootmgr
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function umount_all () {
|
function umount_all () {
|
||||||
@ -707,7 +697,7 @@ function finalize_os_setup () {
|
|||||||
configure_zfs #3.6
|
configure_zfs #3.6
|
||||||
configure_zfs_mount_gen #3.7
|
configure_zfs_mount_gen #3.7
|
||||||
configure_zfsbootmenu #3.8
|
configure_zfsbootmenu #3.8
|
||||||
add_zbm_to_efi #3.9
|
insert_zbm_postconf_hook
|
||||||
umount_all #3.11
|
umount_all #3.11
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user