From 2cf328ad0ae7fb5ee7de8fac5652e4cd58adca1a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 2 Feb 2012 18:50:26 +0100 Subject: [PATCH] renamed usrmove to convertfs --- .../convertfs.sh} | 23 ++++++++++++++++--- .../do-convertfs.sh} | 6 ++--- .../module-setup.sh | 4 ++-- 3 files changed, 25 insertions(+), 8 deletions(-) rename modules.d/{30usrmove/usrmove-convert.sh => 30convertfs/convertfs.sh} (85%) rename modules.d/{30usrmove/do-usrmove.sh => 30convertfs/do-convertfs.sh} (56%) rename modules.d/{30usrmove => 30convertfs}/module-setup.sh (72%) diff --git a/modules.d/30usrmove/usrmove-convert.sh b/modules.d/30convertfs/convertfs.sh similarity index 85% rename from modules.d/30usrmove/usrmove-convert.sh rename to modules.d/30convertfs/convertfs.sh index 8aa858845..6c76a4c46 100755 --- a/modules.d/30usrmove/usrmove-convert.sh +++ b/modules.d/30convertfs/convertfs.sh @@ -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 diff --git a/modules.d/30usrmove/do-usrmove.sh b/modules.d/30convertfs/do-convertfs.sh similarity index 56% rename from modules.d/30usrmove/do-usrmove.sh rename to modules.d/30convertfs/do-convertfs.sh index 6596a68ec..99738e3be 100755 --- a/modules.d/30usrmove/do-usrmove.sh +++ b/modules.d/30convertfs/do-convertfs.sh @@ -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 diff --git a/modules.d/30usrmove/module-setup.sh b/modules.d/30convertfs/module-setup.sh similarity index 72% rename from modules.d/30usrmove/module-setup.sh rename to modules.d/30convertfs/module-setup.sh index 04b44ca19..48ffa3e8a 100755 --- a/modules.d/30usrmove/module-setup.sh +++ b/modules.d/30convertfs/module-setup.sh @@ -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 } -- 2.47.3