refactor(zbm): Streamline ZBM image creation (#3)

This commit is contained in:
hygienic-books 2023-10-21 05:05:17 +02:00
parent be63ed90ad
commit dcc3cf7d93

View File

@ -493,14 +493,29 @@ function paru_install () {
fi
}
function install_zbm_image () {
#2.8
# This takes image files written earlier in our Arch Linux live CD ISO
# image at prepare_zfsbootmenu_efi_bin_pkg() and installs them via their
# locally built package file. When done we delete the manually built
# package file from pacman's cache dir.
pacman -U "${ZFSBOOTMENU_EFI_BIN_PKG_PATH}" --noconfirm
rm "${ZFSBOOTMENU_EFI_BIN_PKG_PATH}"
function configure_zfsbootmenu () {
#3.8
#FIXME
paru_install 'zfsbootmenu'
mkdir -p '/etc/zfsbootmenu/posthooks.d'
cat > '/etc/zfsbootmenu/config.yaml' <<EOF
Global:
ManageImages: true
BootMountPoint: /efi
InitCPIO: true
PostHooksDir: /etc/zfsbootmenu/posthooks.d
Components:
Enabled: false
EFI:
ImageDir: /efi/EFI/ZBM
Versions: 1
Enabled: true
Kernel:
CommandLine: ro loglevel=0 zbm.import_policy=hostid
Prefix: vmlinuz
EOF
# Up here maybe 'ro quiet' instead of 'ro'
zfs set org.zfsbootmenu:commandline='rw nowatchdog rd.vconsole.keymap=de-latin1' "${zpool_name}"'/root/'"${zfs_arch_dataset_name}"
}
function keep_initiramfs_root_only_rw () {
@ -579,7 +594,8 @@ function install_os_in_chroot () {
mkinitcpio -P
# Install ZFSBootMenu image
install_zbm_image #2.8
configure_zfsbootmenu #3.8 #FIXME
generate-zbm
}
function set_root_pw () {