summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-11-04 04:58:32 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-11-04 04:58:32 (EST)
commit9c1994bb9be91a3329d4aa52f3b515ce340f6bdb (patch)
treeccaf461ed2d5dd6f4fc019d2b93cf8a770df9ea6
parent1558d05c62ed90f7d93a14533541c33896b7b733 (diff)
/etc/init.d/networking: Write /var/run/net-ifaces
-rw-r--r--changelog5
-rwxr-xr-xsrc.etc/init.d/networking28
2 files changed, 18 insertions, 15 deletions
diff --git a/changelog b/changelog
index cb07fc3..96ffb99 100644
--- a/changelog
+++ b/changelog
@@ -2,6 +2,11 @@ busybox (1.32.0-1) trunk
* New upstream release.
* Manage all applet links with update-alternatives.
+ * /etc/init.d/networking: Write directly to </var/run/net-ifaces>
+ instead of </etc/network/interfaces>. Users should now edit
+ </etc/network/interfaces> instead of
+ </etc/network/interfaces.local>. This also fixes networking on
+ read-only root file systems.
-- Patrick McDermott <patrick.mcdermott@libiquity.com> Wed, 04 Nov 2020 03:58:13 -0500
diff --git a/src.etc/init.d/networking b/src.etc/init.d/networking
index bfc50e4..b15918a 100755
--- a/src.etc/init.d/networking
+++ b/src.etc/init.d/networking
@@ -3,23 +3,21 @@
start()
{
log 'Configuring network interfaces'
- exec 3>/etc/network/interfaces
- printf '# GENERATED FILE. DO NO EDIT.\n' >&3
- printf '# Edit /etc/network/interfaces.local instead.\n\n' >&3
- printf 'auto lo\niface lo inet loopback\n\n' >&3
- for iface in /sys/class/net/eth* /sys/class/net/wlan*; do
- [ -e "${iface}" ] || continue
- iface="${iface##*/}"
- printf 'auto %s\niface %s inet dhcp\n\n' \
- "${iface}" "${iface}" >&3
- done
- exec 3>&-
- if [ -e /etc/network/interfaces.local ]; then
- file=/etc/network/interfaces.local
+ if [ -e /etc/network/interfaces ]; then
+ cp /etc/network/interfaces /var/run/net-ifaces
else
- file=/etc/network/interfaces
+ exec 3>/var/run/net-ifaces
+ printf '# GENERATED FILE. DO NO EDIT.\n' >&3
+ printf '# Edit /etc/network/interfaces instead.\n\n' >&3
+ printf 'auto lo\niface lo inet loopback\n\n' >&3
+ for iface in /sys/class/net/eth* /sys/class/net/wlan*; do
+ [ -e "${iface}" ] || continue
+ iface="${iface##*/}"
+ printf 'auto %s\niface %s inet dhcp\n\n' \
+ "${iface}" "${iface}" >&3
+ done
+ exec 3>&-
fi
- cp "${file}" /var/run/net-ifaces
ifup -a -i /var/run/net-ifaces
}