X-Git-Url: http://git.grml.org/?p=grml-rescueboot.git;a=blobdiff_plain;f=42_grml;h=96e5e1fc824f2d68b6dfa970f21a4d6839618934;hp=08108a4aaf75f931a7be0404c04f3074fca7a83d;hb=74c0e31416ec2e4412a75d0d510da5e537def629;hpb=0b031803d6dac439c13da92a83cbde301bbce9f3 diff --git a/42_grml b/42_grml index 08108a4..96e5e1f 100755 --- a/42_grml +++ b/42_grml @@ -1,8 +1,7 @@ #!/bin/sh # Filename: 42_grml # Purpose: grub-mkconfig helper script for Grml rescue systems -# Authors: grml-team (grml.org), (c) Andreas Gredler , Michael Prokop -# Bug-Reports: see http://grml.org/bugs/ +# Authors: Grml team (grml.org), (c) Andreas Gredler , Michael Prokop # License: This file is licensed under the GPL v2+. ################################################################################ @@ -12,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" @@ -81,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})" @@ -101,15 +107,16 @@ 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" + loopback loop "${rel_dirname%/}/$grml" set root=(loop) configfile /boot/grub/loopback.cfg }