]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
mkdir basic dirs in /run
authorHarald Hoyer <harald@redhat.com>
Wed, 16 Oct 2013 09:47:01 +0000 (11:47 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 16 Oct 2013 09:49:57 +0000 (11:49 +0200)
for systemd initramfs, /run is also mounted
for non-systemd the contents of /run is copied over, when mounting /run

modules.d/98systemd/dracut-cmdline.sh
modules.d/99base/dracut-lib.sh
modules.d/99base/init.sh

index 50b8d6c93ff15de08927579b4b3bc05f816fbebe..aa8a02b6fecdddccf567ba92e277b5671aea1325 100755 (executable)
@@ -2,11 +2,6 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
-[ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
-[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
-[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
-[ -d /run/log ] || mkdir -p -m 0755 /run/log
-
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2>/dev/null
 fi
index 74d7d35269ee70e70e85d3210cc9de72bcced748..0670cf2eb053900bba53d6fb4338f3369f13461c 100755 (executable)
@@ -4,6 +4,13 @@
 
 export DRACUT_SYSTEMD
 export NEWROOT
+if [ -n "$NEWROOT" ]; then
+    [ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
+fi
+
+[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
+[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
+[ -d /run/log ] || mkdir -p -m 0755 /run/log
 
 debug_off() {
     set +x
index 3ba440a06df94a259df4e4062df3fec763ece5bc..2364f4fccd9eca9fc55b75cc8b37d18d9780075a 100755 (executable)
@@ -56,17 +56,17 @@ fi
 
 if ! ismounted /dev/pts; then
     mkdir -m 0755 /dev/pts
-    mount -t devpts -o gid=5,mode=620,noexec,nosuid devpts /dev/pts >/dev/null 
+    mount -t devpts -o gid=5,mode=620,noexec,nosuid devpts /dev/pts >/dev/null
 fi
 
 if ! ismounted /dev/shm; then
     mkdir -m 0755 /dev/shm
-    mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime tmpfs /dev/shm >/dev/null 
+    mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime tmpfs /dev/shm >/dev/null
 fi
 
 if ! ismounted /run; then
     mkdir -m 0755 /newrun
-    mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun >/dev/null 
+    mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun >/dev/null
     cp -a /run/* /newrun >/dev/null 2>&1
     mount --move /newrun /run
     rm -fr -- /newrun
@@ -88,10 +88,6 @@ fi
 
 trap "action_on_fail Signal caught!" 0
 
-[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
-[ -d /run/log ] || mkdir -p -m 0755 /run/log
-[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
-
 export UDEVVERSION=$(udevadm --version)
 if [ $UDEVVERSION -gt 166 ]; then
     # newer versions of udev use /run/udev/rules.d