X-Git-Url: https://git.grml.org/?p=grml-rescueboot.git;a=blobdiff_plain;f=42_grml;h=4a7643225bd576033364a78ca4d7ba3823ec0a36;hp=8fce10c667d3a8488dce44d58e651b4631ab992f;hb=1f30a2c0f64dd0d5780e2756fa0b92f1aaaea2b5;hpb=1415f0a049498487b03482b3f5db8fe47a83e552 diff --git a/42_grml b/42_grml index 8fce10c..4a76432 100755 --- a/42_grml +++ b/42_grml @@ -11,7 +11,14 @@ prefix=/usr exec_prefix=${prefix} bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib -. ${libdir}/grub/grub-mkconfig_lib + +if [ -r ${libdir}/grub/grub-mkconfig_lib ] ; then + . ${libdir}/grub/grub-mkconfig_lib +elif [ -r /usr/share/grub/grub-mkconfig_lib ] ; then # fallback for e.g. Fedora + . /usr/share/grub/grub-mkconfig_lib +else + echo "Could not locate file grub-mkconfig_lib, please report a bug." >&2 +fi # default unless configured otherwise: ISO_LOCATION="/boot/grml" @@ -80,7 +87,7 @@ for file in "${ISO_LOCATION}"/*.iso ; do done for grmliso in $iso_list ; do - rel_dirname="$(make_system_path_relative_to_its_root $(dirname $grmliso))" + rel_dirname="$(dirname $(make_system_path_relative_to_its_root $grmliso))" grml="$(basename $grmliso)" device="$(${grub_probe} -t device ${grmliso})" @@ -100,15 +107,18 @@ for grmliso in $iso_list ; do echo "Found Grml ISO image: $grmliso" >&2 title="Grml Rescue System ($grml)" + grub_prep=$(prepare_grub_to_access_device "$device" | sed -e "s/^/ /") cat << EOF menuentry "${title}" { -$(prepare_grub_to_access_device "$device" | sed -e "s/^/ /") - iso_path="${rel_dirname}/${grml}" +${grub_prep} + iso_path="${rel_dirname%/}/${grml}" export iso_path kernelopts=" $CUSTOM_BOOTOPTIONS $additional_param " export kernelopts - loopback loop "${rel_dirname}/$grml" + # support booting recent GRUB versions on UEFI systems + rmmod tpm + loopback loop "${rel_dirname%/}/$grml" set root=(loop) configfile /boot/grub/loopback.cfg }