From 3da58569818885a0d570bc7f6112dddd48e2d162 Mon Sep 17 00:00:00 2001 From: Warren Togami Date: Wed, 27 May 2009 22:41:18 -0400 Subject: [PATCH] Move all files generated during initrd runtime to /tmp --- dracut | 5 +++-- modules.d/40network/dhclient-script | 14 +++++++------- modules.d/40network/ifup | 14 +++++++------- modules.d/40network/kill-dhclient.sh | 4 ++-- modules.d/40nfsroot/nfsroot | 12 ++++++------ 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/dracut b/dracut index 942c420f..69cd88ff 100755 --- 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 + diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index fab61a2a..ff03462c 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -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 diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index f5636203..45106b96 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -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() { diff --git a/modules.d/40network/kill-dhclient.sh b/modules.d/40network/kill-dhclient.sh index d1d15f40..19f258a2 100755 --- a/modules.d/40network/kill-dhclient.sh +++ b/modules.d/40network/kill-dhclient.sh @@ -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 diff --git a/modules.d/40nfsroot/nfsroot b/modules.d/40nfsroot/nfsroot index 516c8227..b8858bc4 100755 --- a/modules.d/40nfsroot/nfsroot +++ b/modules.d/40nfsroot/nfsroot @@ -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"