This patch adds the possibility to keep the original
network configuration specified in the root filesystem.
This is necessary in situations with dual stack IPv4 and
IPv6 configurations or different kind on nameservers
(e.g. public ones at boot time, running a dns server
on localhost later on).

Keeping original configuration can be activated by:
networkstatic=yes
on the kernel boot command line.

Signed-off-by: Gerhard Wiesinger <[email protected]>
---
 modules.d/45ifcfg/write-ifcfg.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 803ae8e..033abe5 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -277,7 +277,10 @@ echo "files /etc/sysconfig/network-scripts" >> 
/run/initramfs/rwtab
 echo "files /var/lib/dhclient" >> /run/initramfs/rwtab
 {
     cp /tmp/net.* /run/initramfs/
-    cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/resolv.conf
-    copytree /tmp/ifcfg /run/initramfs/state/etc/sysconfig/network-scripts
+    networkstatic="$(getarg networkstatic=)"
+    if [ -z "${networkstatic}" ]; then
+        cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/resolv.conf
+        copytree /tmp/ifcfg /run/initramfs/state/etc/sysconfig/network-scripts
+    fi
     cp /tmp/ifcfg-leases/* /run/initramfs/state/var/lib/dhclient
 } > /dev/null 2>&1
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to