Merge remote-tracking branch 'origin/github/pr/14'
authorMichael Prokop <mika@grml.org>
Fri, 8 Sep 2023 08:59:32 +0000 (10:59 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 8 Sep 2023 08:59:32 +0000 (10:59 +0200)
42_grml
etc/default/grml-rescueboot

diff --git a/42_grml b/42_grml
index e8e8200..d84d169 100755 (executable)
--- a/42_grml
+++ b/42_grml
@@ -93,6 +93,13 @@ for file in "${ISO_LOCATION}"/*.iso ; do
      fi
 done
 
+indent='        '
+submenu_indent=
+if [ -n "${GRUB_SUBMENU}" ] && [ -n "${iso_list}" ] ; then
+  echo "submenu \"${GRUB_SUBMENU}\" \$menuentry_id_option \"grml-rescueboot\" {"
+  submenu_indent="${indent}"
+fi
+
 for grmliso in $iso_list ; do
   rel_dirname="$(dirname $(make_system_path_relative_to_its_root $grmliso))"
   grml="$(basename $grmliso)"
@@ -126,7 +133,7 @@ for grmliso in $iso_list ; do
   fi
   grub_prep=$(prepare_grub_to_access_device "$device" | sed -e "s/^/        /")
 
-  cat << EOF
+  sed -e "s/^/${submenu_indent}/" << EOF
 menuentry "${title}" {
 ${grub_prep}
         iso_path="${rel_dirname%/}/${grml}"
@@ -142,4 +149,8 @@ ${grub_prep}
 EOF
 done
 
+if [ -n "${GRUB_SUBMENU}" ] && [ -n "${iso_list}" ] ; then
+  echo "} # end submenu \"${GRUB_SUBMENU}\""
+fi
+
 ## END OF FILE #################################################################
index 306f08e..4f4f80f 100644 (file)
@@ -3,6 +3,10 @@
 # Location of ISOs:
 # ISO_LOCATION="/boot/grml/"
 
+# To place the rescue boot entries into a GRUB submenu,
+# set this to the desired menu name:
+# GRUB_SUBMENU='Grml Rescue Boot menu'
+
 # To set any specific bootoptions for rescue images
 # present in /boot/grml just set and enable the following option:
 # CUSTOM_BOOTOPTIONS='ssh=password lang=de'