linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@hpl.hp.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] udev+ifrename integration
Date: Wed, 07 Mar 2007 21:11:38 +0000	[thread overview]
Message-ID: <20070307211138.GC22264@bougret.hpl.hp.com> (raw)
In-Reply-To: <20070307194435.GA22264@bougret.hpl.hp.com>

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...).
> 
> 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}="yes", SUBSYSTEM="net", PROGRAM="/usr/local/sbin/ifrename -D -V -i %k", NAME:="%c", OPTIONS+="skip_netrename", OPTIONS+="last_rule"
> > SUBSYSTEM="net", PROGRAM="/usr/local/sbin/ifrename -i %k", NAME:="%c", OPTIONS+="skip_netrename", OPTIONS+="last_rule"
> > ----------------------------------------------------
> 
> 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;
> 
> You ask udev to rename a netif, but want to skip that part, but use the
> rest of the logic in NAME=, 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);
> 
> 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. 

	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=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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

  parent reply	other threads:[~2007-03-07 21:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 19:44 [PATCH] udev+ifrename integration Jean Tourrilhes
2007-03-07 20:35 ` Kay Sievers
2007-03-07 21:11 ` Jean Tourrilhes [this message]
2007-03-08 11:24 ` Scott James Remnant
2007-03-08 18:15 ` Jean Tourrilhes
2007-03-09 11:57 ` Scott James Remnant
2007-03-09 13:59 ` Kay Sievers
2007-03-09 17:11 ` Jean Tourrilhes
2007-03-09 17:17 ` Jean Tourrilhes
2007-03-10  1:50 ` Jean Tourrilhes
2007-03-10 13:28 ` Kay Sievers
2007-03-12 16:07 ` Jean Tourrilhes
2007-03-12 16:51 ` Kay Sievers
2007-03-15 23:27 ` Jean Tourrilhes
2007-03-16  0:14 ` Kay Sievers
2007-03-16  0:24 ` Jean Tourrilhes
2007-04-30 10:02 ` Kay Sievers
2007-04-30 17:00 ` Jean Tourrilhes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070307211138.GC22264@bougret.hpl.hp.com \
    --to=jt@hpl.hp.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).