break
done
echo $dependencies
-
}
-
+get_iso_identifier() {
+ local iso="$1"
+ local id=
+ if isoinfo --version >/dev/null 2>&1 ; then
+ id=$(isoinfo -d -i "${iso}" | grep '^Volume id:' | sed -e 's/^[^:]*: *//')
+ [ -n "${id}" ] || id=$(isoinfo -d -i "${iso}" | grep '^Application id:' | sed -e 's/^[^:]*: *//')
+ fi
+ echo "${id}"
+}
iso_list=""
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)"
dependencies=$(get_dependencies ${device})
dep_string=""
for dep in $dependencies $device ; do
+ case "$dep" in
+ /dev/md*)
+ md_name="$(mdadm --detail --export "$dep" | sed -ne 's/MD_NAME=//p')"
+ dep="/dev/md/$md_name"
+ esac
dep_string="$dep_string,$dep"
done
dep_string=${dep_string#,}
;;
esac
- echo "Found Grml ISO image: $grmliso" >&2
- title="Grml Rescue System ($grml)"
- grub_prep=$(prepare_grub_to_access_device "$device" | sed -e "s/^/ /")
+ echo "Found grml-rescueboot ISO image: ${grmliso}" >&2
+ iso_id=$(get_iso_identifier "${grmliso}")
+ if [ -n "${iso_id}" ] ; then
+ title="${iso_id} (${grml})"
+ else
+ title="${grml}"
+ fi
+ grub_prep=$(prepare_grub_to_access_device "${device}" | sed -e "s/^/${indent}/")
+ grub_iso_path="${rel_dirname%/}/${grml}"
- cat << EOF
+ sed -e "s/^/${submenu_indent}/" << EOF
menuentry "${title}" {
${grub_prep}
- iso_path="${rel_dirname%/}/${grml}"
+ iso_path="${grub_iso_path}"
export iso_path
kernelopts=" $CUSTOM_BOOTOPTIONS $additional_param "
export kernelopts
# support booting recent GRUB versions on UEFI systems
+ # (see bugs.debian.org/959425)
rmmod tpm
- loopback loop "${rel_dirname%/}/$grml"
+ loopback loop "\$iso_path"
set root=(loop)
configfile /boot/grub/loopback.cfg
+ unset root
+ loopback -d loop
+ unset iso_path
+ unset kernelopts
}
EOF
done
+if [ -n "${GRUB_SUBMENU}" ] && [ -n "${iso_list}" ] ; then
+ echo "} # end submenu \"${GRUB_SUBMENU}\""
+fi
+
## END OF FILE #################################################################
+grml-rescueboot (0.6.1) unstable; urgency=medium
+
+ [ Daniel Richard G ]
+ * [cbb6227] Minor tweaks to terminal output, variables, and GRUB stanza
+
+ -- Michael Prokop <mika@grml.org> Fri, 02 Feb 2024 16:13:55 +0100
+
+grml-rescueboot (0.6.0) unstable; urgency=medium
+
+ [ Daniel Richard G ]
+ * [2772778] Add new GRUB_SUBMENU functionality and config parameter
+ * [517bcbd] Try using isoinfo(1) to extract an ISO image identifier
+
+ -- Michael Prokop <mika@grml.org> Fri, 08 Sep 2023 11:34:54 +0200
+
+grml-rescueboot (0.5.2) unstable; urgency=medium
+
+ [ Allan Laal ]
+ * [135c83b] Fix encpasswd value is ignored
+
+ [ sgf ]
+ * [35e968c] Fix booting from mdadm raid
+ * [df317ca] Fix '-f' option and getopts optstring (Closes: #1005935)
+
+ -- Michael Prokop <mika@grml.org> Mon, 21 Mar 2022 16:25:10 +0100
+
+grml-rescueboot (0.5.1) unstable; urgency=medium
+
+ * [81780ff] Fix minor typo (Sucessfully -> Successfully)
+ * [1f30a2c] Unload tpm module to support booting ISOs with GRUB 2.04 on
+ UEFI systems. Thanks to Vasek Opekar <opekar@eccam.com> for the bug
+ report (Closes: #975835)
+
+ -- Michael Prokop <mika@grml.org> Wed, 23 Dec 2020 17:14:37 +0100
+
grml-rescueboot (0.5.0) unstable; urgency=medium
The "你好, first upload from debconf18 @ Taiwan" release
# 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"
+# CUSTOM_BOOTOPTIONS='ssh=password lang=de'