]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Move all files generated during initrd runtime to /tmp
authorWarren Togami <wtogami@redhat.com>
Thu, 28 May 2009 02:41:18 +0000 (22:41 -0400)
committerWarren Togami <wtogami@redhat.com>
Thu, 28 May 2009 02:41:18 +0000 (22:41 -0400)
dracut
modules.d/40network/dhclient-script
modules.d/40network/ifup
modules.d/40network/kill-dhclient.sh
modules.d/40nfsroot/nfsroot

diff --git a/dracut b/dracut
index 942c420fe3f41ececb2b46b8cee3dce187c35708..69cd88ffdf4c7f804ab93651adc8f47deee56f1e 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -112,7 +112,7 @@ chmod 755 "$initdir"
 export initdir hookdirs dsrc dracutmodules modules debug beverbose
 
 # Create some directory structure first
-for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot dev/pts var/run; do 
+for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do 
     mkdir -p "$initdir/$d"; 
 done
 
@@ -153,4 +153,5 @@ unset item
 
 [[ "$beverbose" = "yes" ]] && ls -lh "$outfile"
 
-exit 0
\ No newline at end of file
+exit 0
+
index fab61a2a790117d19bb9a86c346f2d6f5f95494e..ff03462ce75d4087a598d5b4ddf099ef2013771c 100755 (executable)
@@ -2,15 +2,15 @@
 # very simple dhclient-script.  All it cares about is bringing the interface
 # up, and it does not even try to do anything else.
 
-LOG=/dhclient.$$.log
-ERR=/network.$$.err
+LOG=/tmp/dhclient.$$.log
+ERR=/tmp/network.$$.err
 PATH=$PATH:/sbin:/usr/sbin
 
 . /lib/dracut-lib
 
 getarg rdnetdebug && {
-    exec >/dhclient.$interface.$$.out
-    exec 2>>/dhclient.$interface.$$.out
+    exec >/tmp/dhclient.$interface.$$.out
+    exec 2>>/tmp/dhclient.$interface.$$.out
     set -x
 }
 
@@ -36,7 +36,7 @@ search=$new_domain_search
 namesrv=$new_domain_name_servers
 hostname=$new_host_name
 
-[ -f /net.$interface.override ] && . /net.$interface.override
+[ -f /tmp/net.$interface.override ] && . /tmp/net.$interface.override
 
 # save the offending command and let udev move on if we have an error
 trap 'log_err; exit 0' EXIT
@@ -75,9 +75,9 @@ case $reason in
        setup_interface 
        set | while read line; do
            [ "${line#new_}" = "$line" ] && continue
-           echo "$line" >>/net.$netif.dhcpopts
+           echo "$line" >>/tmp/net.$netif.dhcpopts
        done
-       >/net.$netif.up
+       >/tmp/net.$netif.up
        echo online > /sys/class/net/$netif/uevent ;;
     *) ;;
 esac
index f56362039e05ca4a28ab198d2b6de133884cc70e..45106b9609ae8126bea43192b5f2428dfdb692df 100755 (executable)
@@ -13,13 +13,13 @@ getarg rdnetdebug && {
 netif=$1
 
 # bail immediatly if the interface is already up
-[ -f "/net.$netif.up" ] && exit 0
+[ -f "/tmp/net.$netif.up" ] && exit 0
 
 # loopback is always handled the same way
 [ "$netif" = "lo" ] && {
     ip link set lo up
     ip addr add 127.0.0.1/8 dev lo
-    >/net.$netif.up
+    >/tmp/net.$netif.up
     exit 0
 }
 
@@ -49,9 +49,9 @@ do_static() {
            hostname $hostname
     }
     [ -n "$srv" ] &&
-       echo "new_dhcp_server_identifier=$srv" > /net.$netif.dhcpopts
+       echo "new_dhcp_server_identifier=$srv" > /tmp/net.$netif.dhcpopts
 
-    >/net.$netif.up
+    >/tmp/net.$netif.up
     echo online > /sys/class/net/$netif/uevent
 }
 
@@ -62,13 +62,13 @@ do_dhcp() {
 
     for i in ip srv gw mask hostname; do
        eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
-    done > /net.$netif.override
-    [ -n "$ip" ] && echo bcast= >> /net.$netif.override
+    done > /tmp/net.$netif.override
+    [ -n "$ip" ] && echo bcast= >> /tmp/net.$netif.override
 
     # /sbin/dhclient-script will mark the netif up and generate the online
     # event for nfsroot
     # XXX add -V vendor class and option parsing per kernel
-    dhclient -1 -q -R ${reqs} -pf /dhclient.$netif.pid $netif
+    dhclient -1 -q -R ${reqs} -pf /tmp/dhclient.$netif.pid $netif
 }
 
 ip_to_var() {
index d1d15f40a606356f1f03cdc44940512a4c3c733f..19f258a282da8c5b6bd1586c94eea6905b46dc21 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-for f in /dhclient.*.pid; do
-    [ "$f" != "/dhclient.*.pid" ] && kill $(cat $f)
+for f in /tmp/dhclient.*.pid; do
+    [ "$f" != "/tmp/dhclient.*.pid" ] && kill $(cat $f)
 done
index 516c8227abc0883bde7fc211d96c23db8b0728bc..b8858bc42454c932865747643e42461037e5e297 100755 (executable)
@@ -9,22 +9,22 @@ PATH=$PATH:/sbin:/usr/sbin
 # XXX need to lock our attempts if we're doing the mount here
 
 getarg rdnetdebug && {
-    exec > /nfsroot.$1.$$.out
-    exec 2>> /nfsroot.$1.$$.out
+    exec > /tmp/nfsroot.$1.$$.out
+    exec 2>> /tmp/nfsroot.$1.$$.out
     set -x
 }
 
 [ "$NFS_LOCKED" ] || {
        NFS_LOCKED=true
        export NFS_LOCKED
-       exec flock -xo /nfs.lock -c "$0 $*"
+       exec flock -xo /tmp/nfs.lock -c "$0 $*"
        exit 1
 }
 
-[ -e /nfsdone ] && exit 0
+[ -e /tmp/nfsdone ] && exit 0
 
 nfs_done() {
-    >/nfsdone
+    >/tmp/nfsdone
     exit 0
 }
 
@@ -43,7 +43,7 @@ esac
 # If we're not doing NFS at all, don't keep banging our head
 [ -n "$type" ] || nfs_done
 
-[ -e /net.$1.dhcpopts ] && . /net.$1.dhcpopts
+[ -e /tmp/net.$1.dhcpopts ] && . /tmp/net.$1.dhcpopts
 
 nfsroot=$(getarg nfsroot)
 [ -n "$nfsroot" ] || nfsroot="$new_root_path"