From: Harald Hoyer Date: Fri, 12 Aug 2011 13:56:14 +0000 (+0200) Subject: dracut-functions: fixed inst_dir for symbolic links X-Git-Tag: 013~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ae52e649b990af63b242edc57220be63a22c291;p=thirdparty%2Fdracut.git dracut-functions: fixed inst_dir for symbolic links --- diff --git a/dracut-functions b/dracut-functions index b4e1240bd..936d3c3cf 100755 --- a/dracut-functions +++ b/dracut-functions @@ -270,10 +270,14 @@ check_vol_slaves() { # will create ${initdir}/lib64, ${initdir}/lib64/file, # and a symlink ${initdir}/lib -> lib64. inst_dir() { - local _dir="$1" local _file="" - local IFS="/" + local _oldifs="$IFS" local _part + local _dir="$1" + IFS="/" + set -- $_dir + IFS=$_oldifs + _dir="$@" [[ -e ${initdir}$_dir ]] && return 0 # iterate over parent directories @@ -284,7 +288,7 @@ inst_dir() { if [[ -L $_file ]]; then # create link as the original - local target=$(readlink "$_file") + local target=$(readlink -f "$_file") # resolve relative path and recursively install destination [[ $target == ${target#/} ]] && target="$(dirname "$_file")/$target" inst_dir "$target"