dracut network module uses a primitive dhclient-script.sh that doesn't honnor dhclient-enter-hooks and dhclient-exit-hooks. patch provided

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The network module doesn't honnor the enter and exit hooks.
Thus I'm unable to retrieve specific dhcp fields.
My workaround is to overwrite it with my patched version, but it's ugly.

--- 40network/dhclient-script.sh        2016-11-11 19:27:27.000000000 +0100
+++ 39systemimager/dhclient-script.sh   2017-03-21 17:49:47.000000000 +0100
@@ -7,6 +7,17 @@
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
 
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -x /etc/dhcp/dhclient-enter-hooks ]; then
+    exit_status=0
+    . /etc/dhclient-enter-hooks
+    # allow the local script to abort processing of this state
+    # local script must set exit_status variable to nonzero.
+    if [ $exit_status -ne 0 ]; then
+        exit $exit_status
+    fi
+fi
+
 # We already need a set netif here
 netif=$interface
 
@@ -239,4 +250,9 @@
     *) echo "dhcp: $reason";;
 esac
 
+# Invokes the local dhcp client exit hooks, if any.
+if [ -x /etc/dhcp/dhclient-exit-hooks ]; then
+  . /etc/dhcp/dhclient-exit-hooks
+fi
+
 exit 0
-- 
   Olivier LAHAYE
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux