From 642e1b389347bcb8d6e44b483c327e45225427f4 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 22 Nov 2018 23:54:10 +0100 Subject: [PATCH] Ensure GRUB finds the running ISO Instead of relying on the presence of the /conf/bootid.txt file, which might be present on several Grml ISOs, let's generate a unique filename which GRUB then can search for. JFTR: The redirection within the layers (scripts/GRMLBASE/45-grub-images vs main grml-live script) is necessary, because the GRUB image is generated from within the rootfs (grml_chroot), but the rootfs is compressed within a squashfs file, while we can only access files available directly inside the ISO (corresponding to the files inside grml_cd, and not the files inside grml_chroot which scripts/GRMLBASE/45-grub-images has access to). --- etc/grml/fai/config/scripts/GRMLBASE/45-grub-images | 9 +++++++-- grml-live | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images b/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images index 84bc178..16c0e9a 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images +++ b/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images @@ -11,12 +11,17 @@ set -u TMP_CONFIG="/tmp/grub_config_efi" +# this allows us to find this specific Grml ISO, +# even if there are multiple Grml ISOs present +bootfile="${GRML_NAME}_$(TZ=UTC date +%s)" +echo "$bootfile" > "${target}/"boot/grub/bootfile.txt + cat > "${target}/${TMP_CONFIG}" < \ + "${BUILD_OUTPUT}"/conf/bootfile.txt + echo "# This file is relevant for GRUB boot with the Grml ISO." > \ + "${BUILD_OUTPUT}"/conf/bootfile_"$(cat "${CHROOT_OUTPUT}"/boot/grub/bootfile.txt)" + eend $? + fi + grub_setup # EFI boot files -- 2.1.4