]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dhclient.* files become net.* only after successful netboot.
authorWarren Togami <wtogami@redhat.com>
Wed, 10 Jun 2009 14:21:11 +0000 (10:21 -0400)
committerWarren Togami <wtogami@redhat.com>
Wed, 10 Jun 2009 14:21:11 +0000 (10:21 -0400)
This is an attempt to avoid confusing post-boot scripts by having them
consider only net.* files.

modules.d/40network/dhclient-script
modules.d/40network/ifup
modules.d/40network/netroot

index 1ee78fe40a27c61a7a9b05ebf19c5abd1a42632d..8997477a9ca15e4e8ba3713068885bb750f7a4f0 100755 (executable)
@@ -75,7 +75,7 @@ case $reason in
        setup_interface 
        set | while read line; do
            [ "${line#new_}" = "$line" ] && continue
-           echo "$line" >>/tmp/net.$netif.dhcpopts
+           echo "$line" >>/tmp/dhclient.$netif.dhcpopts
        done
        >/tmp/net.$netif.up
        echo online > /sys/class/net/$netif/uevent ;;
index de459c32f60c38112cd0169ddf2d445d9725358a..9e2327425b92ab34ff6535e8436bed86ecd3555b 100755 (executable)
@@ -51,7 +51,7 @@ do_static() {
            hostname $hostname
     }
     [ -n "$srv" ] &&
-       echo "new_dhcp_server_identifier=$srv" > /tmp/net.$netif.dhcpopts
+       echo "new_dhcp_server_identifier=$srv" > /tmp/dhclient.$netif.dhcpopts
 
     >/tmp/net.$netif.up
     echo online > /sys/class/net/$netif/uevent
@@ -70,7 +70,7 @@ do_dhcp() {
     # /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 /tmp/dhclient.$netif.pid -lf /tmp/net.$netif.lease $netif
+    dhclient -1 -q -R ${reqs} -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
 }
 
 ip_to_var() {
index 3d03e7287bbb64ea4f3a4a4c4750f81039f066f5..5ce99c552c326ea72dda0ab9764c9e9417275903 100755 (executable)
@@ -30,7 +30,7 @@ netif=$1
 #
 . /tmp/root.info
 . /tmp/netroot.info
-[ -e /tmp/net.$netif.dhcpopts ] && . /tmp/net.$netif.dhcpopts
+[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
 
 # Now, let the installed network root handlers figure this out
 #
@@ -47,6 +47,8 @@ fi
 # XXX other variables to export?
 export NEWROOT
 if $handler $netif $root; then
+    [ -f /tmp/dhclient.$netif.lease ] &&    cp /tmp/dhclient.$netif.lease    /tmp/net.$netif.lease
+    [ -f /tmp/dhclient.$netif.dhcpopts ] && cp /tmp/dhclient.$netif.dhcpopts /tmp/net.$netif.dhcpopts
     >/tmp/netroot.done
 fi
 exit 0