From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [ANNOUNCE] udev 007 release
Date: Wed, 26 Nov 2003 19:28:43 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-106987507603360@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-106963388124982@msgid-missing>
On Tue, Nov 25, 2003 at 02:29:17PM +0100, Marco d'Itri wrote:
> On Nov 24, Arnd Bergmann <arnd@arndb.de> wrote:
>
> >+ case 'N':
> >+ if (strlen(udev->kernel_number) = 0) {
> >+ strcat(pos, "disk");
> >+ break;
> >+ }
> >+ strcat(pos, "part");
> >+ strcat(pos, udev->kernel_number);
> >+ dbg("substitute kernel number '%s'", udev->kernel_number);
> >+ break;
>
> After seeing this I started thinking about devfs-like devices and I
> tough that, as soon as the kernel will export a node which will allow
> recognizing CD devices, this could part of the default udev.config
> shipped by a distribution (I'd like to do this for debian):
>
> NUMBER, BUS="ide", id="0.0", NAME="ide/host0/bus0/target0/lun0/%N"
> NUMBER, BUS="ide", id="0.1", NAME="ide/host0/bus0/target1/lun0/%N"
> NUMBER, BUS="ide", id="1.0", NAME="ide/host0/bus1/target0/lun0/%N"
> NUMBER, BUS="ide", id="1.1", NAME="ide/host0/bus1/target1/lun0/%N"
> NUMBER, BUS="ide", id="0.0", type="cd", NAME="ide/host0/bus0/target0/lun0/cd"
> NUMBER, BUS="ide", id="0.1", type="cd", NAME="ide/host0/bus0/target1/lun0/cd"
> NUMBER, BUS="ide", id="1.0", type="cd", NAME="ide/host0/bus1/target0/lun0/cd"
> NUMBER, BUS="ide", id="1.1", type="cd", NAME="ide/host0/bus1/target1/lun0/cd"
Hm, two different rules for the same id. Not a good idea, udev can not
handle this. How about a LABEL rule for a cd instead.
But you are going to have to do a CALLOUT rule if you want to create
names like "ide/host0/bus0/target0/lun0" properly, so you might as well
do it all in a external script. Makes it much easier for you :)
> And this could be a possible syntax for managing symlinks: LINK would
> work just like NUMBER, but NAME would be a symlink to the device
> specified:
>
> # a trailing / means that the link will be done to the parent directory
> LINK, BUS="ide", id="0.0", NAME="discs/disc0/"
> LINK, BUS="ide", id="0.1", NAME="discs/disc1/"
> LINK, BUS="ide", id="1.0", NAME="discs/cdrom0"
> LINK, BUS="ide", id="1.1", NAME="discs/cdrom1"
No, I think multiple NAME values on a line would be the best thing, but
that will take some major tweaks to udev to get there. We will get
there...
> Related problem: if the ide-cd driver is modular then at boot time the
> block device nodes will not appear in sysfs, so udev will not create the
> devices in /dev. But if there are no devices which applications can
> open, how can the kernel autoload the module?
> Currently no hotplug method deals with this, so I'm not sure about what
> should load ide-cd at boot time.
That's up to your startup scripts :)
Look at how Red Hat does this for an example of this.
> BTW, how can I configure udev to create devices like vc/%n instead of
> tty%n?
For USB tty devices try:
REPLACE, KERNEL="ttyUSB*", NAME="usb/%n"
So create such a rule for all of the different tty device types.
And then as your last REPLACE rule do:
REPLACE, KERNEL="tty*", NAME="vc/%n"
Hope this helps,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
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
next prev parent reply other threads:[~2003-11-26 19:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
2003-11-24 3:19 ` Arnd Bergmann
2003-11-24 23:40 ` Greg KH
2003-11-25 13:29 ` Marco d'Itri
2003-11-26 19:28 ` Greg KH [this message]
2003-12-01 10:51 ` Marco d'Itri
2003-12-02 0:55 ` Greg KH
2003-12-02 15:16 ` Kay Sievers
2003-12-02 16:27 ` Kay Sievers
2003-12-02 17:21 ` Marco d'Itri
2003-12-02 17:42 ` Kay Sievers
2003-12-02 17:54 ` Greg KH
2003-12-02 17:55 ` Greg KH
2003-12-02 18:04 ` Greg KH
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=marc-linux-hotplug-106987507603360@msgid-missing \
--to=greg@kroah.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).