Check for presence of /tmp/net-${device}.conf before sourcing it [Closes: issue1196]
authorMichael Prokop <mika@grml.org>
Mon, 23 Jul 2012 15:06:28 +0000 (17:06 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 23 Jul 2012 15:06:28 +0000 (17:06 +0200)
Quoting Marc from issue1196:

| in recent busyboxes, sourcing a non-existent file makes busybox
| (silently?) exit, which in case of scripts/live leads to an immediate kernel
| panic since the root fs is not yet mounted.

Thanks: Marc 'Zugschlus' Haber for the bugreport and debugging this issue

debian/patches/27_support_static_ip.patch

index 4c6896f..0bef1cb 100644 (file)
@@ -79,7 +79,7 @@
        fi
  
        # split args of ethdevice=eth0,eth1 into "eth0 eth1"
-@@ -374,38 +397,27 @@
+@@ -374,38 +397,29 @@
                devlist="$devlist $device"
        done
  
 -                      export DEVICE="$dev"
 -                      break
 +              IPV4ADDR="0.0.0.0"
-+              . /tmp/net-${device}.conf
++              if [ -e "/tmp/net-${device}.conf" ]; then
++                      . /tmp/net-${device}.conf
++              fi
 +              if [ "${IPV4ADDR}" != "0.0.0.0" ]; then
 +                      export DEVICE="$dev $DEVICE"
 +                      # break  # exit loop as we just use the irst