Move all files generated during initrd runtime to /tmp
parent
6941b1b556
commit
3da5856981
5
dracut
5
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
|
||||
exit 0
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue