Fixed missing @ in path to kernel and initrd, added output of the new grub.cfg entries.

This commit is contained in:
cyteen 2026-03-17 12:42:30 +00:00
parent a0ab011100
commit 64eafcb816
1 changed files with 12 additions and 9 deletions

View File

@ -136,16 +136,12 @@ sudo bash -c "
# --- 7. GRUB Integration ---
ZBM_POOL=$(findmnt -n -o SOURCE -T "$ZBM_DIR" | cut -d'/' -f1)
ZBM_SOURCE=$(findmnt -n -o SOURCE -T "$ZBM_DIR") # e.g. rpool/ROOT/devuan-1@
ZBM_DATASET="${ZBM_SOURCE#*/}" # -> ROOT/devuan-1@
ZBM_DATASET_PATH="/${ZBM_DATASET}"
ZBM_SOURCE=$(findmnt -n -o SOURCE -T "$ZBM_DIR") # rpool/ROOT/devuan-1
ZBM_DATASET="${ZBM_SOURCE#*/}" # ROOT/devuan-1
ZBM_DATASET_PATH="/${ZBM_DATASET}@/" # /ROOT/devuan-1@/
# Combine dataset location with the ZBM storage path
REL_PATH="${ZBM_DATASET_PATH}${ZBM_DIR}"
# Normalize: collapse any duplicate slashes and tidy snapshot notation
REL_PATH="${REL_PATH//|\/|@|/}" # ensure `/` before `@` isnt broken
REL_PATH="${REL_PATH//|//|/|}" # reduce any '//' to '/'
REL_PATH="${ZBM_DATASET_PATH}${ZBM_DIR#/}" # /ROOT/devuan-1@/boot/zfsbootmenu
echo "[*] Generating GRUB configuration for pool: $ZBM_POOL..."
@ -168,6 +164,12 @@ echo "[*] Generating GRUB configuration for pool: $ZBM_POOL..."
# The scripts is separated from the settings. Maybe something I would do if I were packaging zbm.
GRUB_DEFAULTS='loglevel=4 zbm.import_delay=5 video=vesafb:1920x1200-32@60 rd.vconsole.keymap=uk'
echo "DEBUG: ZBM_SOURCE='$ZBM_SOURCE'"
echo "DEBUG: ZBM_DATASET='$ZBM_DATASET'"
echo "DEBUG: ZBM_DATASET_PATH='$ZBM_DATASET_PATH'"
echo "DEBUG: REL_PATH='$REL_PATH'"
echo "DEBUG: ZBM_DIR='$ZBM_DIR'"
conf_print_grub_menu_zbm() {
cat <<EOF
#!/bin/sh
@ -218,4 +220,5 @@ else
sudo grub-mkconfig -o /boot/grub/grub.cfg
fi
echo "✔ Deployment complete and verified."
echo "✔ Deployment complete, verify your grub.cfg entries below: "
grep -A5 'ZFSBootMenu' /boot/grub/grub.cfg