mkinitrd unification across distributions
 help / color / mirror / Atom feed
* [PATCH] write-ifcfg.sh: Don't overwrite network config in root filesystem
@ 2014-06-21 10:40 Gerhard Wiesinger
       [not found] ` <alpine.LFD.2.02.1406211239250.1876-GinJ0NHkz1PSbTvUbH3RCA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Gerhard Wiesinger @ 2014-06-21 10:40 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

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 <lists-tcxHB8FAk+J54TAoqtyWWQ@public.gmane.org>
---
  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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-25 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-21 10:40 [PATCH] write-ifcfg.sh: Don't overwrite network config in root filesystem Gerhard Wiesinger
     [not found] ` <alpine.LFD.2.02.1406211239250.1876-GinJ0NHkz1PSbTvUbH3RCA@public.gmane.org>
2014-06-25  9:51   ` Harald Hoyer
     [not found]     ` <53AA9B8E.7020801-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-25 11:07       ` Gerhard Wiesinger
     [not found]         ` <53AAAD6E.9010207-tcxHB8FAk+J54TAoqtyWWQ@public.gmane.org>
2014-06-25 12:45           ` Harald Hoyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox