FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 02-02-2011, 06:10 PM
Bill Nottingham
 
Default Don't write our own udev persistent net rules; use udev's generator.

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)
" % (dev.description,)
- else:
- s = "# %s (rule written by anaconda)
" % (devname,)
- s = s + 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", KERNEL=="%s*", NAME="%s"
' % (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
 
Old 02-02-2011, 08:58 PM
Bill Nottingham
 
Default Don't write our own udev persistent net rules; use udev's generator.

David Cantrell (dcantrell@redhat.com) said:
> 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.

Cloned for RHEL as bug 674685 (and yes, it was 673238.) Probably could stand
some more testing of udev's generator in the anaconda env.

Bill

> 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)
" % (dev.description,)
> >- else:
> >- s = "# %s (rule written by anaconda)
" % (devname,)
> >- s = s + 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", KERNEL=="%s*", NAME="%s"
' % (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
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

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

Thread Tools




All times are GMT. The time now is 07:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org