diff options
-rw-r--r-- | changelog | 5 | ||||
-rwxr-xr-x | src.etc/init.d/networking | 28 |
2 files changed, 18 insertions, 15 deletions
@@ -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 } |