From 64eafcb816befa821b2d3ba9ee5168ab881737b6 Mon Sep 17 00:00:00 2001 From: cyteen Date: Tue, 17 Mar 2026 12:42:30 +0000 Subject: [PATCH] Fixed missing @ in path to kernel and initrd, added output of the new grub.cfg entries. --- 020_grub_zbm_payload.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/020_grub_zbm_payload.sh b/020_grub_zbm_payload.sh index c9aa848..8738ceb 100644 --- a/020_grub_zbm_payload.sh +++ b/020_grub_zbm_payload.sh @@ -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 `@` isn’t 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 <