From e43df9e3425bfd281ba39fd9598b497adbe4b98e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 24 Mar 2011 11:31:49 +0100 Subject: [PATCH] base/init: fixed /dev/.initramfs creation, for no "/run" --- modules.d/99base/init | 15 +++++++++------ test/TEST-50-MULTINIC/client-init | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules.d/99base/init b/modules.d/99base/init index 7e0443d31..fcd6ad725 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -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 diff --git a/test/TEST-50-MULTINIC/client-init b/test/TEST-50-MULTINIC/client-init index 52b24dd26..a65a68684 100755 --- a/test/TEST-50-MULTINIC/client-init +++ b/test/TEST-50-MULTINIC/client-init @@ -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 -- 2.47.3