From 9c1994bb9be91a3329d4aa52f3b515ce340f6bdb Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 04 Nov 2020 04:58:32 -0500 Subject: /etc/init.d/networking: Write /var/run/net-ifaces --- 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 + instead of . Users should now edit + instead of + . This also fixes networking on + read-only root file systems. -- Patrick McDermott 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 } -- cgit v0.9.1