]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network:dhclient-script do PREINIT6 for DHCP6
authorHarald Hoyer <harald@redhat.com>
Mon, 17 Mar 2014 12:00:17 +0000 (13:00 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 17 Mar 2014 12:00:17 +0000 (13:00 +0100)
modules.d/40network/dhclient-script.sh
modules.d/40network/ifup.sh

index 5124f0b7b640c38eb5737c1a3e9864abc7c0582b..50e8932627f15befc5c9947f5afd101f0b603b97 100755 (executable)
@@ -2,6 +2,17 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
+
+# We already need a set netif here
+netif=$interface
+
+# Huh? Interface configured?
+[ -f "/tmp/net.$netif.up" ] && exit 0
+
 setup_interface() {
     ip=$new_ip_address
     mtu=$new_interface_mtu
@@ -73,25 +84,17 @@ setup_interface6() {
     [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
 }
 
-PATH=/usr/sbin:/usr/bin:/sbin:/bin
-
-export PS4="dhclient.$interface.$$ + "
-[ -e /run/initramfs/loginit.pipe ] && exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
-type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
-
-# We already need a set netif here
-netif=$interface
-
-# Huh? Interface configured?
-[ -f "/tmp/net.$netif.up" ] && exit 0
-
 case $reason in
     PREINIT)
         echo "dhcp: PREINIT $netif up"
         linkup $netif
         ;;
 
+    PREINIT6)
+        echo "dhcp: PREINIT $netif up"
+        linkup $netif
+        ;;
+
     BOUND)
         echo "dhcp: BOND setting $netif"
         unset layer2
index 02dfc947b3295b1085afb43bd2f2414673cbfc9b..51b0d52872266ee9de25ac7edae2d3540395826b 100755 (executable)
@@ -328,6 +328,7 @@ for p in $(getargs ip=); do
         dhcp|on|any)
             do_dhcp -4 ;;
         dhcp6)
+            load_ipv6
             do_dhcp -6 ;;
         auto6)
             do_ipv6auto ;;