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
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
# -*- 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
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
}