aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-01-16 19:04:00 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-01-16 19:08:06 +0100
commit0883c9ddd66fa981fe993434cb3bab2593e299e4 (patch)
tree7da6f3ac8124fe40f5fae08620a7065e1a729c17
parent5cffcf36bcd88657a1faf4c14959f3f506e5fa9d (diff)
downloadaports-0883c9ddd66fa981fe993434cb3bab2593e299e4.tar.bz2
aports-0883c9ddd66fa981fe993434cb3bab2593e299e4.tar.xz
main/openrc: allow to change interfaces config location
This is basically a backport of 6a467d4a814f4ce4ce59f9022e656fad7a4c79aa but implemented in more cautious way to be more sure that it will surely not cause any compatibility breakages.
-rw-r--r--main/openrc/APKBUILD4
-rw-r--r--main/openrc/networking.initd16
2 files changed, 13 insertions, 7 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD
index 610b906463..ac7cc6d044 100644
--- a/main/openrc/APKBUILD
+++ b/main/openrc/APKBUILD
@@ -2,7 +2,7 @@
pkgname=openrc
pkgver=0.42.1
_ver=${pkgver/_git*/}
-pkgrel=0
+pkgrel=1
pkgdesc="OpenRC manages the services, startup and shutdown of a host"
url="https://github.com/OpenRC/openrc"
arch="all"
@@ -127,7 +127,7 @@ d2b8700f56b05579926352855de8fcee5cf78f0c13200643a5195f8c60e2b5082d476b42cc77b132
c06eac7264f6cc6888563feeae5ca745aae538323077903de1b19102e4f16baa34c18b8c27af5dd5423e7670834e2261e9aa55f2b1ec8d8fdc2be105fe894d55 hwdrivers.initd
b04058ec630e19de0bafefe06198dc1bff8c8d5d2c89e4660dd83dda8bb82a76cdb1d8661cce88e4a406aa6b4152e17efff52d3eb18ffaec0751d0b6cdbcc48a modules.initd
595098085d5a1204e3c5af59bb4a3b3d1fb2980db77925995aa1ec43ef5ae378cef736ddc7924191a99d39c93891d59274fbba08127b15d584c2f82b067ef683 modloop.initd
-68dd99474356c6235efe77e65dbbc3816cbce41c2fd87f451b08c450702d9ea49cd1028f3d9c4aaf582139bb2387483b0ba60a99fa12162bb7a496d5a32e5f03 networking.initd
+e45e8f0f8746d949c4f2a49cdc5451b4722b66f280c844b1895e91e2886b7ed351ab46eae1cdeb88051a0035dd65c5fc72c25bf769db34ed2e2e90f38193e0aa networking.initd
80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd
d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd
f65b061b4272463071022e88a7392d5573f2d95f91e42c8b4f3ef69171604460ddd3d426dfbab382f73a3fac68d4b4ff3a923fdc49fb6fd9f27ebd3ab24e0d0e firstboot.initd"
diff --git a/main/openrc/networking.initd b/main/openrc/networking.initd
index 2f7bec65ec..00613e0a48 100644
--- a/main/openrc/networking.initd
+++ b/main/openrc/networking.initd
@@ -3,9 +3,15 @@
# note that the spoofprotect, syncoockies and ip_forward options are set in
# /etc/sysctl.conf
-ifconf=/etc/network/interfaces
ifstate=/var/run/ifstate
+if [ -f "$cfgfile" ]; then
+ ifopts="-i $cfgfile"
+else
+ ifopts=
+ cfgfile="/etc/network/interfaces"
+fi
+
single_iface="${SVCNAME#*.}"
if [ "$single_iface" = "$SVCNAME" ]; then
single_iface=
@@ -23,7 +29,7 @@ find_ifaces() {
if [ -n "$single_iface" ]; then
echo $single_iface
else
- awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' $ifconf
+ awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' "$cfgfile"
fi
}
@@ -43,8 +49,8 @@ start() {
for iface in $(find_ifaces); do
local r=0
ebegin "$iface"
- if ! ifup $iface >/dev/null; then
- ifdown $iface >/dev/null 2>&1
+ if ! ifup $ifopts $iface >/dev/null; then
+ ifdown $ifopts $iface >/dev/null 2>&1
r=1
fi
# atleast one interface needs to be started for action
@@ -64,7 +70,7 @@ stop() {
eindent
for iface in $(find_running_ifaces); do
ebegin "$iface"
- ifdown -f $iface >/dev/null
+ ifdown $ifopts -f $iface >/dev/null
eend $?
done
eoutdent