summaryrefslogtreecommitdiff
path: root/aports/busybox
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-10-11 18:20:54 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-10-11 18:20:54 +0200
commitfd09e88160c1e1bf42e54fa0488bcf34e0be106d (patch)
treebecef946fa6dd0f78156811ac283f0fcd43275b0 /aports/busybox
parentb1a7cbcafcae8421d002b86bab9d65d3a7c7623c (diff)
downloadfreebsd-wifibox-alpine-fd09e88160c1e1bf42e54fa0488bcf34e0be106d.zip
busybox: Implement daisy chaining for `udhcpc` and `udhcpd`.
Diffstat (limited to 'aports/busybox')
-rw-r--r--aports/busybox/APKBUILD12
-rw-r--r--aports/busybox/default.script33
2 files changed, 35 insertions, 10 deletions
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 <pali.gabor@gmail.com>
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 <<EOF
RESOLV_CONF="/tmp/resolv.conf"
+UDHCPD_CONF_TEMPLATE="/etc/udhcpd.conf"
+UDHCPD_CONF="/tmp/udhcpd.conf"
EOF
# script for udhcpc
@@ -211,14 +215,16 @@ ead4ad65d270d8659e1898fa16f76b6cbcf567d8aba238eacccda3764edb4362240d9359d6389873
22e2fa8f7a6105fd9990f93b71c235980fd4eab62269939a0e3a920fe517ee4f913c6bd0148a554b67fe01d1660bf0fd76a80e9dcac290b4b8b2c304ef6080a9 CVE-2022-30065.patch
aa93095e20de88730f526c6f463cef711b290b9582cdbd8c1ba2bd290019150cbeaa7007c2e15f0362d5b9315dd63f60511878f0ea05e893f4fdfb4a54af3fb1 acpid.logrotate
0b92eafab0722a6c9cc4880e3be4976de9713e1e1c715c6c727a948cbd68268fce01ce308291834f70d0cf3328f7c8a44cbdb5b7c70d90f91b15efcb5b90acb3 config
-c3194ccffe7300a0f55d50fb56d38c8df55d588adac13056fd0be2676594974477f94de5570a5a882bc864c3711cf67aa43b6ad6808e672f4533dd0f7363d2f5 default.script
+e063599f412df919b75584fee9501925418ef21689232792e9d61178f4e34a65c3cff8a3b1b4cf3e5be61efea2065cc303db35c53ec07b361d3a65e888247544 default.script
dd548670114a92404b8e35fb915fdbe5994498b05b0a418583271c3dd72fb7800950e42c095c902a014eb198c046b8a346d43dccd8e7a158048ae33767c572ed acpid.initd
c9d0fb0f8cc27d661d3b4e58c56eb598ca368890576e18ffffd42efdf68ba35537656be9be319b2e2818aa0152d3ca8611bece2433512fbfcd4eed7988765549 crond.initd
1aed59fb048f0636ee8a095a089a20554a20eda84c70485a894ae60b0f97b792b7ce8e832557457258f59a2750735c4a25e247364ccf1180e9652b292a5f9e8d mdev.initd
acfd45bda4526ab551a30faec1742ad1569aa85e0d315959c3e3a3d6a693f94c74efeb57a00b8791524651e8a61d3f7ea3e3e08a4b0291ec46309f594ee8124c syslog.initd
1d4574ec7cc6d7e9952bb50b4fcb10a910868688da03a25aede492835313c686247bde1faa17f50243d61a93bfc1d8fa54cf821d7be908581e365b0f1b6a5588 udhcpd.initd
+23ef7f32447f239b617d5ae221b024c7b47ca4faa9a27f80a4a6a473fd148cb4339a728fee3bb55ce67d531a141ec07c66dca533138652058d3a6a936b68d3c7 defaults.initd
34c6f3197064bb91619b899b28a201bd4d920b18bded3845440b2cb36dc6f16cabf447c96878349b16e46c30184cbe48bac00a01c5f7cf1be038c0b7136064c5 crond.confd
bf8173ee33a5d2b61cbdbc1b070e599a17a21e5433a0d8aa9beef71e4ac831304076af8e7e58dc594cdee61562329793afdc57af91e5496bf5fffb9b734a3d9c syslog.confd
+2947b23728d3ad6839f660fee11fc4c86d0d1a3fc450ceff85480932b0699e7b7293eb7258cf0e957542ed3c7a4416376ebb284992e6682aede61f48069b1043 udhcpd.confd
634fa067629febcdd8ba9516fbaafddd5be2d38ac37bff9eccfacce0fcf3b259426c12ff967b179bd93b2962401a4a2f15709d32da0623bd078688b8611817cd mdev.conf
2873ec2ba41fe96b010b14fe3fc87d347b71eb6079c12e05ac72eac6c7f146e25096c0b29b2b9d69cbe6840e16dbf4a93ee81132de9fac497e41ab5e8bce2243 persistent-storage
"
diff --git a/aports/busybox/default.script b/aports/busybox/default.script
index e2cd521..a00a303 100644
--- a/aports/busybox/default.script
+++ b/aports/busybox/default.script
@@ -7,6 +7,7 @@ UDHCPC="/etc/udhcpc"
UDHCPC_CONF="$UDHCPC/udhcpc.conf"
RESOLV_CONF="/etc/resolv.conf"
+UDHCPD_CONF="no"
[ -f $UDHCPC_CONF ] && . $UDHCPC_CONF
export broadcast
@@ -102,14 +103,10 @@ routes() {
resolvconf() {
local i
- [ -n "$IF_PEER_DNS" ] && [ "$IF_PEER_DNS" != "yes" ] && return
if [ "$RESOLV_CONF" = "no" ] || [ "$RESOLV_CONF" = "NO" ] \
|| [ -z "$RESOLV_CONF" ] || [ -z "$dns" ]; then
return
fi
- for i in $NO_DNS; do
- [ "$i" = "$interface" ] && return
- done
echo -n > "$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