]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
30convertfs/convertfs.sh: move /var/run and /var/lock fix to the start
authorHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 09:24:10 +0000 (10:24 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 09:24:10 +0000 (10:24 +0100)
Even, if the system is already converted, we want to fix /var/run and
/var/lock.

modules.d/30convertfs/convertfs.sh

index eaeb8e4aaa65bfa5b7512e6148ab98e6b77ab4cb..9ee47d32d2fb62499e79e4adeaf166f54d289e69 100755 (executable)
@@ -21,6 +21,18 @@ while [[ "$ROOT" != "${ROOT%/}" ]]; do
     ROOT=${ROOT%/}
 done
 
+if [ ! -L $ROOT/var/run ]; then
+    echo "Converting /var/run to symlink"
+    mv -f $ROOT/var/run $ROOT/var/run.runmove~
+    ln -sfn ../run $ROOT/var/run
+fi
+
+if [ ! -L $ROOT/var/lock ]; then
+    echo "Converting /var/lock to symlink"
+    mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~
+    ln -sfn ../run/lock $ROOT/var/lock
+fi
+
 needconvert() {
     for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64"; do
         if [[ -e "$dir" ]]; then
@@ -160,17 +172,5 @@ if [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/fil
     /usr/sbin/setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || :
 fi
 
-if [ ! -L $ROOT/var/run ]; then
-    echo "Converting /var/run to symlink"
-    mv -f $ROOT/var/run $ROOT/var/run.runmove~
-    ln -sfn ../run $ROOT/var/run
-fi
-
-if [ ! -L $ROOT/var/lock ]; then
-    echo "Converting /var/lock to symlink"
-    mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~
-    ln -sfn ../run/lock $ROOT/var/lock
-fi
-
 echo "Done."
 exit 0