From: ste-fan Date: Thu, 18 Jun 2015 14:32:22 +0000 (+0200) Subject: Fix relative path detection of ISO files X-Git-Tag: v0.4.6~2 X-Git-Url: https://git.grml.org/?p=grml-rescueboot.git;a=commitdiff_plain;h=f7942b97a5f8de2a2a8f167cd0399bf9b55f3bc8;hp=649ccf97f1b3dc1af4686622f5013d09e1ba25e8 Fix relative path detection of ISO files The problem becomes apparent when using symbolic links in $ISO_LOCATION that point to ISO files on another partition. Calling make_system_path_relative_to_its_root not on the dirname but on the ISO file fixes this. Also avoid a double slash (//...) in $iso_path when $rel_dirname is just the root dir of that other partition (/). --- diff --git a/42_grml b/42_grml index 8cfdb3f..96e5e1f 100755 --- a/42_grml +++ b/42_grml @@ -87,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})" @@ -112,11 +112,11 @@ for grmliso in $iso_list ; do cat << EOF menuentry "${title}" { ${grub_prep} - iso_path="${rel_dirname}/${grml}" + 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 }