s#/dev/.run#/run#g
authorHarald Hoyer <harald@redhat.com>
Fri, 18 Mar 2011 16:19:26 +0000 (17:19 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 18 Mar 2011 17:23:44 +0000 (18:23 +0100)
Move things where they really belong to.

modules.d/40network/dhclient-script
modules.d/40network/ifup
modules.d/45ifcfg/write-ifcfg.sh
modules.d/50plymouth/plymouth-pretrigger.sh
modules.d/90dmsquash-live/dmsquash-live-root
modules.d/90mdraid/mdmon-pre-udev.sh
modules.d/95fcoe/fcoe-up
modules.d/95iscsi/iscsiroot
modules.d/95rootfs-block/mount-root.sh
modules.d/99base/init

index a05a3ae..0bc6463 100755 (executable)
@@ -47,7 +47,7 @@ setup_interface() {
 PATH=$PATH:/sbin:/usr/sbin
 
 export PS4="dhclient.$interface.$$ + "
-exec >>/dev/.run/initramfs/initlog.pipe 2>>/dev/.run/initramfs/initlog.pipe
+exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
 . /lib/dracut-lib.sh
 
 # We already need a set netif here
index 5feeb2a..74e8a48 100755 (executable)
@@ -83,7 +83,7 @@ do_static() {
 PATH=$PATH:/sbin:/usr/sbin
 
 export PS4="ifup.$1.$$ + "
-exec >>/dev/.run/initramfs/initlog.pipe 2>>/dev/.run/initramfs/initlog.pipe
+exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
 . /lib/dracut-lib.sh
 
 # Huh? No $1?
index b845ccb..fe72dbe 100755 (executable)
@@ -134,9 +134,9 @@ for netif in $IFACES ; do
 done
 
 # Pass network opts
-mkdir -p /dev/.run/initramfs
-cp /tmp/net.* /dev/.run/initramfs/ >/dev/null 2>&1
-mkdir -p /dev/.run/initramfs/state/etc/sysconfig/network-scripts/
-cp /tmp/net.$netif.resolv.conf /dev/.run/initramfs/state/etc/ >/dev/null 2>&1
-echo "files /etc/sysconfig/network-scripts" > /dev/.run/initramfs/rwtab
-cp -a /tmp/ifcfg/* /dev/.run/initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1
+mkdir -p /run/initramfs
+cp /tmp/net.* /run/initramfs/ >/dev/null 2>&1
+mkdir -p /run/initramfs/state/etc/sysconfig/network-scripts/
+cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/ >/dev/null 2>&1
+echo "files /etc/sysconfig/network-scripts" > /run/initramfs/rwtab
+cp -a /tmp/ifcfg/* /run/initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1
index f7f7997..eae0be2 100755 (executable)
@@ -18,7 +18,7 @@ if getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
 
     info "Starting plymouth daemon"
     [ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
-    >/dev/.run/initramfs/plymouth
+    >/run/initramfs/plymouth
     /lib/udev/console_init tty0
     /bin/plymouth --show-splash 2>&1 | vinfo
 fi
index 16262b6..20b0a47 100755 (executable)
@@ -43,7 +43,7 @@ getarg ro && liverw=ro
 getarg rw && liverw=rw
 [ -z "$liverw" ] && liverw=ro
 # mount the backing of the live image first
-mkdir -p /dev/.run/initramfs/live
+mkdir -p /run/initramfs/live
 if [ -f $livedev ]; then
     # no mount needed - we've already got the LiveOS image in initramfs
     case $livedev in
@@ -51,7 +51,7 @@ if [ -f $livedev ]; then
         *ext3fs.img|*rootfs.img) FSIMG=$livedev ;;
     esac
 else
-    mount -n -t $fstype -o $liverw $livedev /dev/.run/initramfs/live
+    mount -n -t $fstype -o $liverw $livedev /run/initramfs/live
     RES=$?
     if [ "$RES" != "0" ]; then
         die "Failed to mount block device of live image"
@@ -116,8 +116,8 @@ do_live_from_base_loop() {
 }
 
 # we might have a genMinInstDelta delta file for anaconda to take advantage of
-if [ -e /dev/.run/initramfs/live/${live_dir}/osmin.img ]; then
-    OSMINSQFS=/dev/.run/initramfs/live/${live_dir}/osmin.img
+if [ -e /run/initramfs/live/${live_dir}/osmin.img ]; then
+    OSMINSQFS=/run/initramfs/live/${live_dir}/osmin.img
 fi
 
 if [ -n "$OSMINSQFS" ]; then
@@ -133,10 +133,10 @@ if [ -n "$OSMINSQFS" ]; then
 fi
 
 # we might have an embedded fs image to use as rootfs (uncompressed live)
-if [ -e /dev/.run/initramfs/live/${live_dir}/ext3fs.img ]; then
-    FSIMG="/dev/.run/initramfs/live/${live_dir}/ext3fs.img"
-elif [ -e /dev/.run/initramfs/live/${live_dir}/rootfs.img ]; then
-    FSIMG="/dev/.run/initramfs/live/${live_dir}/rootfs.img"
+if [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
+    FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
+elif [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
+    FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
 fi
 
 if [ -n "$FSIMG" ] ; then
@@ -147,8 +147,8 @@ if [ -n "$FSIMG" ] ; then
 fi
 
 # we might have an embedded fs image on squashfs (compressed live)
-if [ -e /dev/.run/initramfs/live/${live_dir}/squashfs.img ]; then
-    SQUASHED="/dev/.run/initramfs/live/${live_dir}/squashfs.img"
+if [ -e /run/initramfs/live/${live_dir}/squashfs.img ]; then
+    SQUASHED="/run/initramfs/live/${live_dir}/squashfs.img"
 fi
 
 if [ -e "$SQUASHED" ] ; then
@@ -156,7 +156,7 @@ if [ -e "$SQUASHED" ] ; then
         echo "Copying live image to RAM..."
         echo "(this may take a few minutes)"
         dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
-        umount -n /dev/.run/initramfs/live
+        umount -n /run/initramfs/live
         echo "Done copying live image to RAM."
         eject -p $livedev || :
         SQUASHED="/squashed.img"
index 4bd9197..e38163b 100755 (executable)
@@ -2,6 +2,5 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 # save state dir for mdmon/mdadm for the real root
-mkdir -m 0755 /dev/.run/mdadm
+mkdir -m 0755 /run/mdadm
 # backward compat link
-ln -s .run/mdadm /dev/.mdadm
index ad72317..def843c 100755 (executable)
@@ -14,7 +14,7 @@ PATH=$PATH:/sbin:/usr/sbin
 [ -z "$1" -o -z "$2" ] && exit 1
 
 export PS4="fcoe-up.$1.$$ + "
-exec >>/dev/.run/initramfs/initlog.pipe 2>>/dev/.run/initramfs/initlog.pipe
+exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
 . /lib/dracut-lib.sh
 
 netif=$1
index a2006fd..4d98792 100755 (executable)
@@ -151,8 +151,8 @@ handle_netroot()
         iscsi_lun=0
     fi
 
-    echo "InitiatorName='$iscsi_initiator'" > /dev/.run/initiatorname.iscsi
-    ln -s .run/initiatorname.iscsi /dev/.initiatorname.iscsi
+    echo "InitiatorName='$iscsi_initiator'" > /run/initiatorname.iscsi
+    ln -s /run/initiatorname.iscsi /dev/.initiatorname.iscsi
 
 # FIXME $iscsi_protocol??
 
index 40795a1..f29af88 100755 (executable)
@@ -117,7 +117,7 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
         info fsck -T -t noopts=_netdev -A $fsckoptions
         out=$(fsck -T -t noopts=_netdev -A $fsckoptions) 
         export RD_ROOTFS_FSCK=$?
-        echo $RD_ROOTFS_FSCK > /dev/.run/initramfs/root-fsck
+        echo $RD_ROOTFS_FSCK > /run/initramfs/root-fsck
         
         # A return of 4 or higher means there were serious problems.
         if [ $RD_ROOTFS_FSCK -gt 3 ]; then
index 4177187..7e0443d 100755 (executable)
@@ -33,7 +33,7 @@ wait_for_loginit()
         done
         set -x
     fi
-    rm -f /dev/.run/initramfs/initlog.pipe
+    rm -f /run/initramfs/initlog.pipe
 }
 
 emergency_shell()
@@ -79,7 +79,6 @@ RDDEBUG=""
 mount -t proc -o nosuid,noexec,nodev /proc /proc >/dev/null 2>&1
 mount -t sysfs -o nosuid,noexec,nodev /sys /sys >/dev/null 2>&1
 
-
 if [ -x /lib/systemd/systemd-timestamp ]; then
     RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp)
 else
@@ -105,32 +104,38 @@ ln -s /proc/self/fd /dev/fd >/dev/null 2>&1
 ln -s /proc/self/fd/0 /dev/stdin >/dev/null 2>&1
 ln -s /proc/self/fd/1 /dev/stdout >/dev/null 2>&1
 ln -s /proc/self/fd/2 /dev/stderr >/dev/null 2>&1
-mkdir -m 0755 /dev/shm /dev/pts /dev/.run 
+mkdir -m 0755 /dev/shm /dev/pts /run 
 mount -t devpts -o gid=5,mode=620,noexec,nosuid devpts /dev/pts >/dev/null 2>&1
 mount -t tmpfs -o mode=1777,nosuid,nodev  tmpfs /dev/shm >/dev/null 2>&1
-# create /dev/.run which will be /var/run
-mount -t tmpfs -o mode=0755,nodev,noexec,nosuid tmpfs /dev/.run >/dev/null 2>&1
+# create /run which will obsolete /var/run
+mount -t tmpfs -o mode=0755,nodev,noexec,nosuid tmpfs /run >/dev/null 2>&1
 
-mkdir -m 0755 /dev/.run/initramfs
+mkdir -m 0755 /run/initramfs
 
 UDEVVERSION=$(udevadm --version)
 if [ $UDEVVERSION -gt 166 ]; then
-    # newer versions of udev use /dev/.run/udev/rules.d
-    mkdir -m 0755 /dev/.run/udev /dev/.run/udev/rules.d  
-    export UDEVRULESD=/dev/.run/udev/rules.d
+    # newer versions of udev use /run/udev/rules.d
+    mkdir -m 0755 /run/udev /run/udev/rules.d  
+    export UDEVRULESD=/run/udev/rules.d
 else
     mkdir -m 0755 /dev/.udev /dev/.udev/rules.d  
     export UDEVRULESD=/dev/.udev/rules.d
 fi
 
-[ -e /var/run ] && rm -fr /var/run
-ln -fs /dev/.run /var/run
+[ -e /var/run ] &&  mv /var/run /var/run.bak
+[ -e /var/lock ] &&  mv /var/lock /var/lock.bak
+ln -fs /run /var/run
+mkdir -m 0755 /run/lock
+ln -fs /run/lock /var/lock
+# copy over any possible directory structure
+cp -ar /var/run.bak/* /run/ 2>/dev/null
+cp -ar /var/lock.bak/* /run/lock/ 2>/dev/null
 
 if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then
     getarg quiet && DRACUT_QUIET="yes"
-    mkfifo /dev/.run/initramfs/initlog.pipe
-    /sbin/loginit $DRACUT_QUIET </dev/.run/initramfs/initlog.pipe >/dev/console 2>&1 &
-    exec >/dev/.run/initramfs/initlog.pipe 2>&1
+    mkfifo /run/initramfs/initlog.pipe
+    /sbin/loginit $DRACUT_QUIET </run/initramfs/initlog.pipe >/dev/console 2>&1 &
+    exec >/run/initramfs/initlog.pipe 2>&1
 else
     exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
 fi
@@ -350,7 +355,7 @@ fi
 
 # Debug: Copy state
 if getargbool 0 rd.copystate -y rdcopystate; then
-    cp /init.log /tmp/* /dev/.run/initramfs/ >/dev/null 2>&1
+    cp /init.log /tmp/* /run/initramfs/ >/dev/null 2>&1
 fi
 
 if getargbool 1 rd.timestamp; then
@@ -365,6 +370,16 @@ wait_for_loginit
 
 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
+fi
+
 if [ -f /etc/capsdrop ]; then
     . /etc/capsdrop
     info "Calling $INIT with capabilities $CAPS_INIT_DROP dropped."