Do not mount --bind /run anymore
authorHarald Hoyer <harald@redhat.com>
Tue, 20 Mar 2012 12:30:42 +0000 (13:30 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 20 Mar 2012 12:31:17 +0000 (13:31 +0100)
switch_root in util-linux 2.21 does mount --move /run also

dracut.spec
modules.d/99base/init.sh

index be7ba8a..d197173 100644 (file)
@@ -76,11 +76,11 @@ Requires: hardlink
 Requires: gzip
 Requires: module-init-tools >= 3.7-9
 Requires: sed
-Requires: udev
+Requires: udev > 166
 %if 0%{?fedora} || 0%{?rhel} > 6
-Requires: util-linux >= 2.20
+Requires: util-linux >= 2.21
 %else
-Requires: util-linux-ng >= 2.17.2
+Requires: util-linux-ng >= 2.21
 %endif
 
 %if 0%{?fedora} || 0%{?rhel} > 6
index 5d51c9d..fa712a7 100755 (executable)
@@ -68,7 +68,7 @@ fi
 if ! ismounted /run; then
     mkdir -m 0755 /newrun
     mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /newrun >/dev/null 
-    cp -a /run/* /newrun
+    mv /run/* /newrun >/dev/null 2>&1
     mount --move /newrun /run
     rm -fr /newrun
 fi
@@ -312,20 +312,10 @@ else
 fi
 [ "$RD_DEBUG" = "yes" ] && set -x
 
-if [ -d "$NEWROOT"/run ]; then
-    NEWRUN="${NEWROOT}/run"
-    mount --bind /run "$NEWRUN"
-    NEWINITRAMFSROOT="$NEWRUN/initramfs"
-
-    if [ "$NEWINITRAMFSROOT/lib" -ef "/lib" ]; then
-        for d in bin etc lib lib64 sbin tmp usr var; do
-            [ -h /$d ] && ln -fsn $NEWINITRAMFSROOT/$d /$d
-        done
-    fi
-else
+if ! [ -d "$NEWROOT"/run ]; then
     NEWRUN=/dev/.initramfs
     mkdir -m 0755 "$NEWRUN"
-    mount --bind /run/initramfs "$NEWRUN"
+    mount --rbind /run/initramfs "$NEWRUN"
 fi
 
 wait_for_loginit