From: Harald Hoyer Date: Thu, 20 Oct 2011 11:04:30 +0000 (+0200) Subject: dracut-functions: inst_dir() handle relative symlinks X-Git-Tag: 014~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b01885338bb0b3daa087f71cfbf895e999e90b9f;p=thirdparty%2Fdracut.git dracut-functions: inst_dir() handle relative symlinks --- diff --git a/dracut-functions b/dracut-functions index 1ef5269d7..70a467be9 100755 --- a/dracut-functions +++ b/dracut-functions @@ -290,12 +290,12 @@ inst_dir() { inst_dir "$target" inst_symlink "$_file" else - [[ -h ${initdir}$_file ]] && _file=$(readlink "${initdir}$_file") + [[ -h ${initdir}/$_file ]] && _file=$(readlink "${initdir}/$_file") # create directory - mkdir -m 0755 -p "${initdir}$_file" || return 1 + [[ -e "${initdir}/$_file" ]] || mkdir -m 0755 -p "${initdir}/$_file" || return 1 if [[ -d "$_file" ]]; then - chmod --reference="$_file" "${initdir}$_file" - chmod u+w "${initdir}$_file" + chmod --reference="$_file" "${initdir}/$_file" + chmod u+w "${initdir}/$_file" fi fi done