We accidentally tried to make upwards symlinks when directories existed.

Signed-off-by: Michal Soltys <sol...@ziu.info>
---
 dracut |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dracut b/dracut
index 4cfcab8..72af2c0 100755
--- a/dracut
+++ b/dracut
@@ -543,7 +543,9 @@ else
 fi
 # initial sewing pass
 for d in "${initdir}${imgdir}"/*; do
-    ln -sfn "${imgdir#/}/${d##*/}" "${initdir}/${d##*/}"
+    if [[ ! -e "${initdir}/${d##*/}" ]]; then
+        ln -sfn "${imgdir#/}/${d##*/}" "${initdir}/${d##*/}"
+    fi
 done
 
 # check all our modules to see if they should be sourced.
@@ -684,7 +686,7 @@ for d in "${initdir}${imgdir}"/*; do
             dfatal "dracut: symlink mismatch ${d##*/} -/-> ${d#${initdir}/}"
             exit 1
         fi
-    else
+    elif [[ ! -e ${s} ]]; then
         ln -sfn "${d#${initdir}/}" "${s}"
     fi
 done
-- 
1.7.5.3

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to