summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2023-09-26 10:03:48 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2023-09-26 11:53:45 +0200
commit2646128d92561b62fe4ea863aee9cad4b5fa8eda (patch)
tree122092ba14f8db06bd69c5110112d2494b320d38
parentfdf0ee1aed41faf765016b4571a5d0cadaac70fa (diff)
downloadfreebsd-wifibox-alpine-2646128d92561b62fe4ea863aee9cad4b5fa8eda.zip
Implement daisy-chaining of `dhcpcd` and `radvd`
-rw-r--r--aports/busybox/APKBUILD4
-rw-r--r--aports/busybox/defaults.initd6
-rw-r--r--aports/dhcpcd/99-radvd.conf20
-rw-r--r--aports/dhcpcd/APKBUILD4
-rw-r--r--aports/radvd/APKBUILD4
-rw-r--r--aports/radvd/radvd.confd2
-rw-r--r--aports/radvd/radvd.initd6
7 files changed, 39 insertions, 7 deletions
diff --git a/aports/busybox/APKBUILD b/aports/busybox/APKBUILD
index 40e77d6..633f898 100644
--- a/aports/busybox/APKBUILD
+++ b/aports/busybox/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Gabor Pali <pali.gabor@gmail.com>
pkgname=busybox
pkgver=1.36.1
-pkgrel=0 # base: 2
+pkgrel=1 # base: 2
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url="https://busybox.net/"
arch="all"
@@ -222,7 +222,7 @@ b1e13a736eaf8a621b648d97c2526fe72215a5bfb13277a58c7d631bcee08cbcea20dd3d11ea8a97
fcb532233fd7ba8cad302d037b88cff00ee8b96b37c90b34fc823479208cf7cdda48818c972ce2c4703b7283fd58e99ba8a724818f884f3b09eaa7e2d6ffad21 acpid.initd
34c6f3197064bb91619b899b28a201bd4d920b18bded3845440b2cb36dc6f16cabf447c96878349b16e46c30184cbe48bac00a01c5f7cf1be038c0b7136064c5 crond.confd
f3a104095c659eef79925e8df850cdac499f6c7756fb9647088a24b98dc72f37413c3869da6113bcc578c2178c1c2e5ab8d31a50ad2e472c06aaf408e8924d6a crond.initd
-23ef7f32447f239b617d5ae221b024c7b47ca4faa9a27f80a4a6a473fd148cb4339a728fee3bb55ce67d531a141ec07c66dca533138652058d3a6a936b68d3c7 defaults.initd
+4624388f7e853fc1c2cdb170b31e60888ed9226bb62c3c1f59f06b91a6c9f8d4feb10f5680b1fbebc516967058ad247ecbcd5dc7d4c0ca43d542cdb6b669bad9 defaults.initd
bf8173ee33a5d2b61cbdbc1b070e599a17a21e5433a0d8aa9beef71e4ac831304076af8e7e58dc594cdee61562329793afdc57af91e5496bf5fffb9b734a3d9c syslog.confd
a13a6add6f7fb10a3a2563391b6f8b68161249147e9f50e6d857c5689123f6d974368ce4f13b8d93312fa38d05f604d67c4c976d8a7eef301af50a3a6ad50c23 syslog.initd
2947b23728d3ad6839f660fee11fc4c86d0d1a3fc450ceff85480932b0699e7b7293eb7258cf0e957542ed3c7a4416376ebb284992e6682aede61f48069b1043 udhcpd.confd
diff --git a/aports/busybox/defaults.initd b/aports/busybox/defaults.initd
index a92a942..c11316b 100644
--- a/aports/busybox/defaults.initd
+++ b/aports/busybox/defaults.initd
@@ -8,5 +8,11 @@ start() {
if [ ! -s "$UDHCPD_CONF" ] ; then
sed 's|%%DNS%%||' < "$UDHCPD_CONF_TEMPLATE" > "$UDHCPD_CONF"
fi
+ if [ -f /etc/conf.d/radvd ]; then
+ . /etc/conf.d/radvd
+ if [ ! -s "$CONFIGFILE" ]; then
+ sed 's|%%DNS%%||' < "$CONFIGFILE_TEMPLATE" > "$CONFIGFILE"
+ fi
+ fi
eend $?
}
diff --git a/aports/dhcpcd/99-radvd.conf b/aports/dhcpcd/99-radvd.conf
new file mode 100644
index 0000000..8bab674
--- /dev/null
+++ b/aports/dhcpcd/99-radvd.conf
@@ -0,0 +1,20 @@
+# Update domain name server IPv6 addresses and
+# restart radvd on reconfiguration of the interface.
+
+RESOLV_CONF="/etc/resolv.conf"
+RADVD_CONF="/tmp/radvd.conf"
+RADVD_CONF_TEMPLATE="/etc/radvd.conf"
+
+if $if_configured; then
+ [ ! -f "$RESOLV_CONF" ] && return
+
+ # Filter resolv.conf to get the IPv6 name servers
+ # only.
+ dns=$(grep -F nameserver $RESOLV_CONF | cut -c 12- | grep -E "^[0-9]*:")
+
+ cat $RADVD_CONF_TEMPLATE \
+ | sed "s!%%DNS%%!$dns!" \
+ > $RADVD_CONF
+ chmod a+r "$RADVD_CONF"
+ service radvd --ifstarted restart
+fi
diff --git a/aports/dhcpcd/APKBUILD b/aports/dhcpcd/APKBUILD
index badc610..c42cbfb 100644
--- a/aports/dhcpcd/APKBUILD
+++ b/aports/dhcpcd/APKBUILD
@@ -14,6 +14,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/NetworkConfiguration/dhcpcd/
busybox-logger.patch
dhcpcd.initd
99-udhcpd.conf
+ 99-radvd.conf
"
build() {
@@ -41,6 +42,8 @@ package() {
"$pkgdir"/etc/init.d/dhcpcd
install -Dm555 "$srcdir"/99-udhcpd.conf \
"$pkgdir"/usr/lib/dhcpcd/dhcpcd-hooks/99-udhcpd.conf
+ install -Dm555 "$srcdir"/99-radvd.conf \
+ "$pkgdir"/usr/lib/dhcpcd/dhcpcd-hooks/99-radvd.conf
ln -s /media/etc/dhcpcd.conf "$pkgdir"/etc
}
@@ -51,4 +54,5 @@ bb0d703b4a5142a218e17d320a56537de5f787b119564724fe0c9d5ee5ff84b7e2711b6f1c8e20f3
b6bdaac9fc0d5d2d7e8c5e30d1a45db1cff2284d01f92f8821b2f03aaff4e0dbd8cbfbced96d8d9d934dc11f22b792a8345d634d8e4e3b84f43016b7e866e302 busybox-logger.patch
7fb44b82a6fa25ee6249fc4835853a4c1fc7d327653efabd9fde303b1f306b3aa6956b2621b55a24fc007ec7ad878ce50e7418ebff0b17fece76e2fdd9e5190d dhcpcd.initd
c3d551505e22e253bed29fda5c4766ab8b23f14883df0c342b04c835f7ed50d90714a053c86b281bb9924fd9a83cdc6015ecc51217852f0ab2c63058b5d625a5 99-udhcpd.conf
+f9bb9a7d81e3cc3a83554650f8f5596331ecb8d26259e38d983196d741c726e15bf6822d05b904dd61af4e63dc74681226918685c856e56a95267c08601c0baa 99-radvd.conf
"
diff --git a/aports/radvd/APKBUILD b/aports/radvd/APKBUILD
index 78e4a95..846b9aa 100644
--- a/aports/radvd/APKBUILD
+++ b/aports/radvd/APKBUILD
@@ -37,7 +37,7 @@ package() {
sha512sums="
a1eb40af90fc83ebab2517c16a0f7e85c11338ab276bec400b7c33177748d1e36bc5abd7e373b6742f12f7c690dd7ae6b951bc832c7de9bbb56f7e9bc844ed22 radvd-2.19.tar.xz
-fd78249b8ae25d1c55fc0b5cc2b3dd202388c0ca7be2737ecbd33ed5cd3c8616858aa46350967350fe8e8c0032552126918c8b9c36b13d799f3c5d8fb576fdf8 radvd.initd
-31cca1d48e5f0c4fe96a7a32ca6339e7aa9e478f7e9086f05bbc79ca59b1637d99e46079d7be77ef717a8fb975fada7664058e3bc61117309025b72f3e87d294 radvd.confd
+9f91741b96a2c588ff415d0ddb29d083adfcfa000540b78ca0553ba06d62e646a32fb8927e39e3acfe13c72ae0c8037a22e7e9d6e61e94764360b61a8777bfc5 radvd.initd
+dab393c7b5b6c012fb190c7fb5c35c77de6fb93dae37cd41125caeb1160ad967f115d3f024019abf70fa446045ea8c61dfc391752e91f7d6f7c542c60750c4ba radvd.confd
dffe4167c54c430fc38953e70d546fdf443944eceee4c610f14d63947fe8c04960b48a8acf5742edf8721558c4b811c9a4033ad9abe787ead9cc1bb0721b654c fix-alpine-plz.patch
"
diff --git a/aports/radvd/radvd.confd b/aports/radvd/radvd.confd
index 2c230ea..bd7caf7 100644
--- a/aports/radvd/radvd.confd
+++ b/aports/radvd/radvd.confd
@@ -4,3 +4,5 @@
# Extra options to pass to radvd
OPTIONS=""
+CONFIGFILE_TEMPLATE="/etc/radvd.conf"
+CONFIGFILE="/tmp/radvd.conf"
diff --git a/aports/radvd/radvd.initd b/aports/radvd/radvd.initd
index 108e483..f419e80 100644
--- a/aports/radvd/radvd.initd
+++ b/aports/radvd/radvd.initd
@@ -3,9 +3,9 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd.init,v 1.6 2011/12/04 10:14:13 swegener Exp $
-CONFIGFILE=/etc/radvd.conf
-PIDFILE=/run/radvd/radvd.pid
-SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
+: ${CONFIGFILE:=/etc/radvd.conf}
+: ${PIDFILE:=/run/radvd/radvd.pid}
+: ${SYSCTL_FORWARD:=net.ipv6.conf.all.forwarding}
extra_started_commands="reload"