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

Re: [PATCH] Don't write our own udev persistent net rules; use udev's generator.



Ack for the code, but:

1) Is it bug 627328?  BZ #673238 is for Fedora, so if we need that one,
   we should clone it for RHEL.

2) Please follow the docs/commit-log.txt style for the commit messages,
   it helps guide the makebumpver script.

Let me know what to do about the bug number.

On Wed, 2 Feb 2011, Bill Nottingham wrote:

This is for bug #627328. Here's the version for rhel6-branch.

Bill

commit 258b914982422735143fb02b240ab1eae24f2bde
Author: Bill Nottingham <notting redhat com>
Date:   Fri Jan 28 15:54:12 2011 -0500

   Don't write our own udev persistent net rules; use udev's generator.

diff --git a/network.py b/network.py
index bd39b4e..d82bb68 100644
--- a/network.py
+++ b/network.py
@@ -718,40 +718,6 @@ class Network:

            f.close()

-        # /etc/udev/rules.d/70-persistent-net.rules
-        rules = "/etc/udev/rules.d/70-persistent-net.rules"
-        if not os.path.isfile(rules):
-            f = open(rules, "w")
-            f.write("""
-# This file was automatically generated by the /lib/udev/write_net_rules
-# program run by the persistent-net-generator.rules rules file.
-#
-# You can modify it, as long as you keep each rule on a single line.
-
-""")
-            for dev in self.netdevices.values():
-                addr = dev.get("HWADDR")
-                if not addr:
-                    continue
-                devname = dev.get("DEVICE")
-                basename = devname
-                while basename != "" and basename[-1] in string.digits:
-                    basename = basename[:-1]
-
-                # rules are case senstive for address. Lame.
-                addr = addr.lower()
-
-                s = ""
-                if len(dev.description) > 0:
-                    s = "# %s (rule written by anaconda)\n" % (dev.description,)
-                else:
-                    s = "# %s (rule written by anaconda)\n" % (devname,)
-                s = s + 'SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", KERNEL=="%s*", NAME="%s"\n' % (addr, basename, devname,)
-
-                f.write(s)
-
-            f.close()
-
    def waitForDevicesActivation(self, devices):
        waited_devs_props = {}

diff --git a/scripts/mk-images b/scripts/mk-images
index 05b5900..c48134f 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -907,7 +907,9 @@ EOF
    for i in $IMGPATH/lib/udev/*; do
       if [ -f $i ]; then install -m 755 $i $MBD_DIR/lib/udev/${i##*/}; fi
    done
-    rm -f $MBD_DIR/lib/udev/rules.d/*generator*
+    for i in $MBD_DIR/lib/udev/rules.d/*generator* ; do
+       [[ "$i" =~ net-generator ]] || rm -f $i
+    done

    install -m 644 $LOADERBINDIR/$MYLOADERTR $MBD_DIR/etc/loader.tr
    for i in a/ansi d/dumb l/linux s/screen v/vt100 v/vt100-nav v/vt102 x/xterm x/xterm-color g/gnome ; do

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


--
David Cantrell <dcantrell redhat com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10


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