From f7942b97a5f8de2a2a8f167cd0399bf9b55f3bc8 Mon Sep 17 00:00:00 2001 From: ste-fan Date: Thu, 18 Jun 2015 16:32:22 +0200 Subject: [PATCH] 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 (/). --- 42_grml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 } -- 2.1.4