renamed usrmove to convertfs

master
Harald Hoyer 2012-02-02 18:50:26 +01:00
parent dfbb922ddb
commit 2cf328ad0a
3 changed files with 25 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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
}