Re: [PATCH 25/25] Use separate method for copying network configuration to system (#520146).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steffen Maier wrote:
Radek, I got one question below.

On 05/05/2010 09:15 AM, Radek Vykydal wrote:
        # /etc/udev/rules.d/70-persistent-net.rules
        rules = "/etc/udev/rules.d/70-persistent-net.rules"
-        destRules = instPath + rules
-        if (not instPath) or (not os.path.isfile(destRules)) or \
-           flags.livecdInstall:
-            if not os.path.isdir("%s/etc/udev/rules.d" %(instPath,)):
-                iutil.mkdirChain("%s/etc/udev/rules.d" %(instPath,))
-
-            if os.path.isfile(rules) and rules != destRules:
-                shutil.copy(rules, destRules)

Sorry, I couldn't follow the whole thread on your patch set, so please
bear with me if my question has been answered already.
Is this part that copies an existing rules file if it already exists
moved to somewhere else or dropped completely?
We need this for network on s390x and other platforms. David introduced
it in 0ba6cb516da384e30efdd0dbd70a6c12336fd4f5 for bug 526322 (and
updated it in d1efd7c6ef7e68639a778bedf8250c86db86df2f for bug 527707).

It is copied in copyConfigToPath() to which I moved copying
from write() method in the patch, see below (*)

+    def copyConfigToPath(self, instPath=''):

-        if len(devices) == 0:
+        if len(self.netdevices) == 0:
            return

-        sysconfig = instPath + sysconfigDir
-        netscripts = instPath + netscriptsDir
-        destnetwork = instPath + networkConfFile
+        # /etc/sysconfig/network-scripts/ifcfg-DEVICE
+        # /etc/sysconfig/network-scripts/keys-DEVICE
+        # /etc/dhclient-DEVICE.conf
+        # TODORV: do we really don't want overwrite on live cd?
+        for devName, device in self.netdevices.items():
+            self._copyFileToPath(device.path, instPath)
+            self._copyFileToPath(device.keyfilePath, instPath)
+            dhclientfile = os.path.join("/etc/dhclient-%s.conf" % devName)
+            self._copyFileToPath(dhclientfile, instPath)
+
+        # /etc/sysconfig/network
+        self._copyFileToPath(networkConfFile, instPath,
+                             overwrite=flags.livecdInstall)

-        if not os.path.isdir(netscripts):
-            iutil.mkdirChain(netscripts)
+        # /etc/resolv.conf
+        self._copyFileToPath("/etc/resolv.conf", instPath,
+                             overwrite=flags.livecdInstall)
+
+        # /etc/udev/rules.d/70-persistent-net.rules
+        self._copyFileToPath("/etc/udev/rules.d/70-persistent-net.rules",
+                             instPath, overwrite=flags.livecdInstall)

(*) here

Radek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux