From fd09e88160c1e1bf42e54fa0488bcf34e0be106d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=81LI=20G=C3=A1bor=20J=C3=A1nos?= Date: Tue, 11 Oct 2022 18:20:54 +0200 Subject: busybox: Implement daisy chaining for `udhcpc` and `udhcpd`. --- aports/busybox/APKBUILD | 12 +++++++++--- aports/busybox/default.script | 33 ++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 10 deletions(-) (limited to 'aports/busybox') diff --git a/aports/busybox/APKBUILD b/aports/busybox/APKBUILD index 8539a51..146defc 100644 --- a/aports/busybox/APKBUILD +++ b/aports/busybox/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Gabor Pali pkgname=busybox pkgver=1.35.0 -pkgrel=1 # base: 15, -initscripts: 4.2-r0 +pkgrel=2 # base: 15, -initscripts: 4.2-r0 pkgdesc="Size optimized toolbox of many common UNIX utilities" url="https://busybox.net/" arch="all" @@ -54,9 +54,11 @@ source="https://busybox.net/downloads/busybox-$pkgver.tar.bz2 mdev.initd syslog.initd udhcpd.initd - + defaults.initd + crond.confd syslog.confd + udhcpd.confd mdev.conf persistent-storage " @@ -152,6 +154,8 @@ ttyS0 EOF cat >"$pkgdir"/etc/udhcpc/udhcpc.conf < "$RESOLV_CONF.$$" if [ -n "$search" ]; then echo "search $search" >> "$RESOLV_CONF.$$" @@ -123,11 +120,33 @@ resolvconf() { mv "$RESOLV_CONF.$$" "$RESOLV_CONF" } +udhcpd_conf() { + if [ "$UDHCPD_CONF" = "no" ] || [ "$UDHCPD_CONF" = "NO" ] \ + || [ -z "$UDHCPD_CONF" ]; then + return + fi + cat $UDHCPD_CONF_TEMPLATE \ + | sed "s!%%DNS%%!$dns!" \ + > $UDHCPD_CONF + chmod a+r "$UDHCPD_CONF" + service udhcpd --ifstarted restart +} + +propagate_dns() { + local i + [ -n "$IF_PEER_DNS" ] && [ "$IF_PEER_DNS" != "yes" ] && return + for i in $NO_DNS; do + [ "$i" = "$interface" ] && return + done + resolvconf + udhcpd_conf +} + bound() { ip -4 addr add $ip/$mask ${broadcast:+broadcast $broadcast} dev $interface ip -4 link set dev $interface up routes - resolvconf + propagate_dns } renew() { @@ -145,12 +164,12 @@ renew() { done if ! grep "^search $domain"; then - resolvconf + propagate_dns return fi for i in $dns; do if ! grep "^nameserver $i"; then - resolvconf + propagate_dns return fi done -- cgit v1.2.3