From: Michael Prokop Date: Fri, 8 Sep 2023 08:59:32 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/github/pr/14' X-Git-Tag: v0.6.0~1 X-Git-Url: https://git.grml.org/?p=grml-rescueboot.git;a=commitdiff_plain;h=068c824b8154ed30be364cc6f4499c9a821fc1e4;hp=517bcbd5fe394c658e2b6539882535bcd711f146 Merge remote-tracking branch 'origin/github/pr/14' --- diff --git a/42_grml b/42_grml index e8e8200..d84d169 100755 --- 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 ################################################################# diff --git a/etc/default/grml-rescueboot b/etc/default/grml-rescueboot index 306f08e..4f4f80f 100644 --- a/etc/default/grml-rescueboot +++ b/etc/default/grml-rescueboot @@ -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'