9990-grml-networking.sh: display Grml info, update interfaces comment + operate on...
authorMichael Prokop <mika@grml.org>
Fri, 14 Dec 2018 14:27:11 +0000 (15:27 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 14 Dec 2018 14:38:15 +0000 (15:38 +0100)
* By displaying "Preconfiguring Grml networking" it's more
  explicit that we're running the 9990-grml-networking.sh code

* It's not the 23networking live-initramfs hook since quite some time,
  update the comment for generation of /etc/network/interfaces

* Support also new style network device names by iterating over
  /sys/class/net/* and skipping only the loopback interface

components/9990-grml-networking.sh

index 394d011..ace078e 100644 (file)
@@ -8,6 +8,8 @@ if [ -n "${NONETWORKING}" ]; then
    return 0
 fi
 
+log_begin_msg "Preconfiguring Grml networking"
+
 modprobe af_packet # req'd for DHCP
 
 # initialize udev
@@ -37,7 +39,7 @@ fi
 
 # config for loopback networking
 cat > $IFFILE << EOF
-# Initially generated on boot by initramfs' 23networking.
+# Initially generated on boot by initramfs
 
 auto lo
 iface lo inet loopback
@@ -47,8 +49,9 @@ EOF
 unset HOSTNAME
 
 # generate config for each present network device
-for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
+for interface in /sys/class/net/; do
     [ -e ${interface} ] || continue
+    [ "${interface}" = "lo" ] && continue
     interface=$(basename ${interface})
     method="dhcp"