]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: inst_dir() handle relative symlinks
authorHarald Hoyer <harald@redhat.com>
Thu, 20 Oct 2011 11:04:30 +0000 (13:04 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 20 Oct 2011 11:06:53 +0000 (13:06 +0200)
dracut-functions

index 1ef5269d7f68a1a7cadd2dc63e7702780c83d4bd..70a467be917fe63e2dfab2d5929a964d0d8b4970 100755 (executable)
@@ -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