From: Harald Hoyer Date: Tue, 7 Feb 2012 09:24:10 +0000 (+0100) Subject: 30convertfs/convertfs.sh: move /var/run and /var/lock fix to the start X-Git-Tag: 015~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d5e3ed74025a179f632daad933322f376b96f05;p=thirdparty%2Fdracut.git 30convertfs/convertfs.sh: move /var/run and /var/lock fix to the start Even, if the system is already converted, we want to fix /var/run and /var/lock. --- diff --git a/modules.d/30convertfs/convertfs.sh b/modules.d/30convertfs/convertfs.sh index eaeb8e4aa..9ee47d32d 100755 --- a/modules.d/30convertfs/convertfs.sh +++ b/modules.d/30convertfs/convertfs.sh @@ -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