]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
base/init: fixed /dev/.initramfs creation, for no "/run"
authorHarald Hoyer <harald@redhat.com>
Thu, 24 Mar 2011 10:31:49 +0000 (11:31 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 14:43:54 +0000 (15:43 +0100)
modules.d/99base/init
test/TEST-50-MULTINIC/client-init

index 7e0443d31ab910aa1f9bd8a275f13270e91b0586..fcd6ad7250bd724be1fa52c2633004fc5453eee6 100755 (executable)
@@ -355,7 +355,7 @@ fi
 
 # Debug: Copy state
 if getargbool 0 rd.copystate -y rdcopystate; then
-    cp /init.log /tmp/* /run/initramfs/ >/dev/null 2>&1
+    cp -axr /init.log /tmp/* /run/initramfs/ >/dev/null 2>&1
 fi
 
 if getargbool 1 rd.timestamp; then
@@ -373,11 +373,14 @@ export PATH="$OLD_PATH"
 if [ -d "$NEWROOT"/run ]; then
     mount --move /run "$NEWROOT"/run
 else
-    # make compat symlinks for old systems without /run
-    mkdir -m 0755 /dev/.run
-    mount --move /run /dev/.run
-    ln -s /dev/.run/initramfs /dev/.initramfs
-    [ -e /dev/.run/mdadm ] && ln -s /dev/.run/mdadm /dev/.mdadm
+    if [ -e /run/initramfs ]; then
+        mkdir -m 0755 /dev/.initramfs
+        cp -axr /run/initramfs/* /dev/.initramfs >/dev/null 2>&1
+    fi
+    if [ -e /run/mdadm ]; then
+        mkdir -m 0755 /dev/.mdadm
+        cp -axr /run/mdadm/* /dev/.mdadm >/dev/null 2>&1
+    fi
 fi
 
 if [ -f /etc/capsdrop ]; then
index 52b24dd263dcf79d771c71ad64b07e2c582811d1..a65a68684872bf343d049b82f3ab5c28a3e9f949 100755 (executable)
@@ -5,6 +5,6 @@ export TERM=linux
 export PS1='initramfs-test:\w\$ '
 stty sane
 echo "made it to the rootfs! Powering down."
-echo OK $(cat /dev/.run/initramfs/net.ifaces) > /dev/sda
+echo OK $(cat /dev/.initramfs/net.ifaces) > /dev/sda
 #sh -i
 poweroff -f