renamed usrmove to convertfs
authorHarald Hoyer <harald@redhat.com>
Thu, 2 Feb 2012 17:50:26 +0000 (18:50 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 2 Feb 2012 17:50:26 +0000 (18:50 +0100)
modules.d/30convertfs/convertfs.sh [moved from modules.d/30usrmove/usrmove-convert.sh with 85% similarity]
modules.d/30convertfs/do-convertfs.sh [moved from modules.d/30usrmove/do-usrmove.sh with 56% similarity]
modules.d/30convertfs/module-setup.sh [moved from modules.d/30usrmove/module-setup.sh with 72% similarity]

similarity index 85%
rename from modules.d/30usrmove/usrmove-convert.sh
rename to modules.d/30convertfs/convertfs.sh
index 8aa8588..6c76a4c 100755 (executable)
@@ -11,7 +11,7 @@ fi
 
 if [[ "$ROOT" -ef / ]]; then
     echo "Can't convert the running system."
-    echo "Please boot with 'usrmove' on the kernel command line,"
+    echo "Please boot with 'rd.convertfs' on the kernel command line,"
     echo "to update with the help of the initramfs,"
     echo "or run this script from a rescue system."
     exit 1
@@ -153,7 +153,24 @@ set +e
 
 echo "Run ldconfig."
 ldconfig -r "$ROOT"
-#echo "Set autorelabel flag."
-#> "$ROOT/.autorelabel"
+
+. $ROOT/etc/selinux/config
+if [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts ]; then
+    echo "Fixing SELinux labels"
+    /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 [ -d $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 [ -d $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
similarity index 56%
rename from modules.d/30usrmove/do-usrmove.sh
rename to modules.d/30convertfs/do-convertfs.sh
index 6596a68..99738e3 100755 (executable)
@@ -2,10 +2,10 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
-if getargbool 0 rd.usrmove; then
+if getargbool 0 rd.convertfs; then
     if getargbool 0 rd.debug; then
-        bash -x usrmove-convert "$NEWROOT" 2>&1 | vinfo
+        bash -x convertfs "$NEWROOT" 2>&1 | vinfo
     else
-        usrmove-convert "$NEWROOT" 2>&1 | vinfo
+        convertfs "$NEWROOT" 2>&1 | vinfo
     fi
 fi
similarity index 72%
rename from modules.d/30usrmove/module-setup.sh
rename to modules.d/30convertfs/module-setup.sh
index 04b44ca..48ffa3e 100755 (executable)
@@ -14,7 +14,7 @@ depends() {
 install() {
     dracut_install bash
     dracut_install find ldconfig mv rm cp ln 
-    inst_hook pre-pivot 99 "$moddir/do-usrmove.sh"
-    inst "$moddir/usrmove-convert.sh" /usr/bin/usrmove-convert
+    inst_hook pre-pivot 99 "$moddir/do-convertfs.sh"
+    inst "$moddir/convertfs.sh" /usr/bin/convertfs
 }