From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Tourrilhes Date: Wed, 07 Mar 2007 21:11:38 +0000 Subject: Re: [PATCH] udev+ifrename integration Message-Id: <20070307211138.GC22264@bougret.hpl.hp.com> List-Id: References: <20070307194435.GA22264@bougret.hpl.hp.com> In-Reply-To: <20070307194435.GA22264@bougret.hpl.hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Wed, Mar 07, 2007 at 09:35:18PM +0100, Kay Sievers wrote: > On Wed, 2007-03-07 at 11:44 -0800, Jean Tourrilhes wrote: > > Integration of ifrename into udev has been a thorn in the side > > of some major distro (Unbuntu, Debian...). >=20 > That's all because it's just not needed. Udev ships a full-featured > solution for persistent network names, and that's what these distros > use. When it comes to renaming network interfaces, I would not call udev full featured. It has basic renaming, that work for 99% of users, but there are plenty of things that udev doesn't know how to do. And that's ok, because we can use ifrename in those cases. And it's probably a good idea to keep udev small and tiny and push the bloat in ifrename, because ifrename is optional. > There is no known add/remove race since we killed the /sbin/hotplug > fork-bomb. Care to explain what you mean? Let's keep this issue in its own separate thread. > > Finally, the udev rules would look like : > > ---------------------------------------------------- > > ENV{UDEVTEST}=3D"yes", SUBSYSTEM=3D"net", PROGRAM=3D"/usr/local/sbin/if= rename -D -V -i %k", NAME:=3D"%c", OPTIONS+=3D"skip_netrename", OPTIONS+=3D= "last_rule" > > SUBSYSTEM=3D"net", PROGRAM=3D"/usr/local/sbin/ifrename -i %k", NAME:=3D= "%c", OPTIONS+=3D"skip_netrename", OPTIONS+=3D"last_rule" > > ---------------------------------------------------- >=20 > You can almost never use "last_rule", that will break a lot of stuff > that wants to see event from udev, including HAL. Good to know. I was not sure, and I can drop it. > > --- udev-105-pristine/udev.h 2007-02-02 16:24:48.000000000 -0800 > > +++ udev-105/udev.h 2007-02-28 17:26:03.000000000 -0800 > > @@ -85,6 +85,7 @@ struct udevice { > > int partitions; > > int ignore_device; > > int ignore_remove; > > + int skip_netrename; >=20 > You ask udev to rename a netif, but want to skip that part, but use the > rest of the logic in NAME=3D, huh? > Why not just instruct your external tool, not to actually rename the > interface (dry run), but return the name, and udev will do the rename? Because you would loose the following features of ifrename : o wildcard renaming o takeover There is also another feature that I have not yet implemented in ifrename that you could not implement with that, which is alternate renaming. And I have other more nebulous ideas. > > --- udev-105-pristine/udevtest.c 2007-02-02 16:24:48.000000000 -0800 > > +++ udev-105/udevtest.c 2007-02-28 16:53:29.000000000 -0800 > > @@ -110,6 +110,8 @@ int main(int argc, char *argv[], char *e > > setenv("DEVPATH", udev->dev->devpath, 1); > > setenv("SUBSYSTEM", udev->dev->subsystem, 1); > > setenv("ACTION", "add", 1); > > + /* Allow rules to know it's debugging time */ > > + setenv("UDEVTEST", "yes", 1); >=20 > There is no real need for that, just match on UDEV_LOG, if you want to > add debugging rules. Udevtest has at least LOG_INFO, the udev default is > LOG_ERR.=20 Good to know. > Also the udevtest program doesn't really work today, and is kind of > useless, because we match on all the kernel supplied variables which are > not available. So, what is its replacement ? > Kay Have fun... Jean ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel