devd: Move dhclient part in devd/dhclient.conf

And make it part of the FreeBSD-dhclient package.
This avoid calling dhclient on an installation without dhclient
installed.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38322
This commit is contained in:
Emmanuel Vadot 2023-02-01 08:41:56 +01:00
parent 431b9b6692
commit f4d9116de1
3 changed files with 24 additions and 19 deletions

View File

@ -12,6 +12,11 @@ DEVDDIR= /etc/devd
DEVD+= asus.conf
.endif
CONFGROUPS+= DHCLIENT
DHCLIENTDIR= ${DEVDDIR}
DHCLIENT+= dhclient.conf
DHCLIENTPACKAGE= dhclient
.if ${MK_HYPERV} != "no"
CONFGROUPS+= HYPERV
HYPERVDIR=${DEVDDIR}

View File

@ -44,19 +44,6 @@ notify 0 {
action "/etc/pccard_ether $subsystem start";
};
#
# Try to start dhclient on Ethernet-like interfaces when the link comes
# up. Only devices that are configured to support DHCP will actually
# run it. No link down rule exists because dhclient automatically exits
# when the link goes down.
#
notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "ethernet";
action "service dhclient quietstart $subsystem";
};
#
# Like Ethernet devices, but separate because 802.11 require spawning
# wlan(4) interface.
@ -69,12 +56,6 @@ detach 0 {
device-name "$wifi-driver-regex";
action "/etc/pccard_ether $device-name stopchildren";
};
notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "802.11";
action "service dhclient quietstart $subsystem";
};
# An entry like this might be in a different file, but is included here
# as an example of how to override things. Normally 'ed50' would match

19
sbin/devd/dhclient.conf Normal file
View File

@ -0,0 +1,19 @@
#
# Try to start dhclient on Ethernet-like interfaces when the link comes
# up. Only devices that are configured to support DHCP will actually
# run it. No link down rule exists because dhclient automatically exits
# when the link goes down.
#
notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "ethernet";
action "service dhclient quietstart $subsystem";
};
notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "802.11";
action "service dhclient quietstart $subsystem";
};