odhcpd: replace leasefile and leasetrigger by leasedir

odhcpd no longer supports the leasetrigger and leasefile options
(openwrt/odhcpd#462): DNS servers watch the hosts directory or use the
dhcp.hosts.update ubus event, and the lease files are internal to
odhcpd, one per interface in leasedir.

Remove odhcpd-update, delete both options from existing configs and set
leasedir if it isn't set yet. It isn't derived from leasefile, as the
two hold different things.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
David Härdeman authored and Robert Marko committed 2026-12-05 15:36:36 +01:00
1 parent 222531f499
commit 35e05433e3
3 files changed
+8 -11

No files matched your search

-1
View File
@@ -76,7 +76,6 @@ endif
define Package/odhcpd/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/odhcpd $(1)/usr/sbin/
$(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd
$(INSTALL_DIR) $(1)/etc/uci-defaults
@@ -1,8 +0,0 @@
#!/bin/sh
# Make dnsmasq reread hostfile by sending SIGHUP signal
initscript=$0
. /lib/functions/procd.sh
procd_send_signal dnsmasq
@@ -18,9 +18,16 @@ uci_drop_option() {
if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
commit=0
if [ -z "$(uci -q get dhcp.odhcpd.leasedir)" ]; then
uci set dhcp.odhcpd.leasedir=/tmp/odhcpd/leases
commit=1
fi
# Options odhcpd no longer supports
uci_drop_option dhcp dhcpv4_forcereconf && commit=1
uci_drop_option odhcpd enable_tz && commit=1
uci_drop_option odhcpd leasefile && commit=1
uci_drop_option odhcpd leasetrigger && commit=1
[ "$commit" -eq 1 ] && uci commit dhcp
@@ -64,11 +71,10 @@ EOF
uci batch <<EOF
set dhcp.odhcpd=odhcpd
set dhcp.odhcpd.maindhcp=$ODHCPDONLY
set dhcp.odhcpd.leasefile=/tmp/odhcpd.leases
set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
set dhcp.odhcpd.loglevel=4
set dhcp.odhcpd.piodir=/tmp/odhcpd-piodir
set dhcp.odhcpd.hostsdir=/tmp/hosts
set dhcp.odhcpd.leasedir=/tmp/odhcpd/leases
set dhcp.lan.dhcpv4=$V4MODE
set dhcp.lan.dhcpv6=$V6MODE
set dhcp.lan.ra=$V6MODE