linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Svetoslav Slavtchev" <svetljo@gmx.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] multple rules files support/symlink rules support
Date: Thu, 22 Jan 2004 17:44:53 +0000	[thread overview]
Message-ID: <26586.1074793493@www1.gmx.net> (raw)
In-Reply-To: <200401172313.00189.arvidjaar@mail.ru>

[-- Attachment #1: Type: text/plain, Size: 2111 bytes --]

> On Sat, Jan 17, 2004 at 11:13:00PM +0300, Andrey Borzenkov wrote:
> > Attached patch adds support for
> > 
> > - multiple rules files. You can now do
> > 
> > udev_rules="file1 dir2 file3 ..."
> > 
> > directory is scanned and all files are read. Currently it does not
> descend 
> > into subdirs.
> 
> Ok, that is nice.  I like that part of the patch.
> 
> > - to make the above really useful it allows multiple rules with
> symlinks; all 
> > rules are collected and applied (note 100 characters limit for total
> names 
> > length currently). It still takes the first found name and warns if more
> were 
> > seen.
> 
> I don't really understand this.  Can you give an example of how this
> would work?  Why do we want to have multiple symlinks from different
> rules?


please take a look in the attached files

- the first should create layout as the one of static /dev (00-lsb)
- the second adds  devfs symlinks (01-devfs)
- additional one's could be used by the configuration 
  tools of the distribution( e.g. to create /dev/cd-writer or /dev/dvd)
- and at the end would come the personal  rules of the 
  owner of the system

in this way the device would be accessable from the standard 
static /dev, devfs, and the additional system/personal  namespaces

in this way, if the owner changes only his rule file, he can not harm the
system
he only add's a personal symlink, devices are created as in static dev, 
with symlink for devfs 

best,

svetljo

PS.
small  example
in 00-lsb
---------------
KERNEL="psaux",		SYMLINK="psmouse"
KERNEL="video0",	SYMLINK="video"
KERNEL="radio0",	SYMLINK="radio"
KERNEL="vbi0",		SYMLINK="vbi"
KERNEL="vtx0",		SYMLINK="vtx"
-----------------
in 01-devfs
---------------
KERNEL="psaux",		SYMLINK="misc/%k"
KERNEL="video[0-9]",	SYMLINK="v4l/video%n"
KERNEL="radio[0-9]",	SYMLINK="v4l/radio%n"
KERNEL="vbi[0-9]",	SYMLINK="v4l/vbi%n"
KERNEL="vtx[0-9]",	SYMLINK="v4l/vtx%n"

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail

[-- Attachment #2: 00-lsb.txt --]
[-- Type: text/plain, Size: 1759 bytes --]

# There are a number of modifiers that are allowed to be used in the NAME or PROGRAM fields.
# They provide the following subsitutions:
# %n - the "kernel number" of the device.
#      for example, 'sda3' has a "kernel number" of '3'
# %k - the kernel name for the device.
# %M - the kernel major number for the device
# %m - the kernel minor number for the device
# %b - the bus id for the device
# %c - the return value for the CALLOUT program (note, this doesn't work within
#      the PROGRAM field for the obvious reason.)
# %D - use the devfs style disk name for this device.
#      For partitions, this will result in 'part%n'
#      If this is not a partition, it will result in 'disc'
#

# block
# ignore dm
KERNEL="dm-[0-9]*",	NAME=""
KERNEL="device-mapper",	NAME="mapper/control"

KERNEL="raw[0-9]*",	NAME="raw/%k"

#KERNEL="dri-card[1-9]*",NAME="dri/card%n"

# some stuff is commented out below, as IIRC the max of tv cards == 8
KERNEL="video0",	SYMLINK="video"
KERNEL="radio0",	SYMLINK="radio"
KERNEL="vbi0",		SYMLINK="vbi"
KERNEL="vtx0",		SYMLINK="vtx"


KERNEL="em8300",	NAME="video/%k"
KERNEL="em8300_ma",	NAME="video/%k"
KERNEL="em8300_mv",	NAME="video/%k"
KERNEL="em8300_sp",	NAME="video/%k"

# input 
KERNEL="psaux",					SYMLINK="psmouse mouse"
KERNEL="mice",		NAME="input/%k",	SYMLINK="usbmouse"
KERNEL="mouse[0-9]*",	NAME="input/%k"
KERNEL="event[0-9]*",	NAME="input/%k"
KERNEL="js0",		NAME="input/%k",	SYMLINK="js"
KERNEL="js[1-9]",	NAME="input/%k",	SYMLINK="js%n"


KERNEL="controlC[0-9]",		NAME="snd/%k" 
KERNEL="hwC[0-9]D[0-9]",	NAME="snd/%k" 
KERNEL="midiC[0-9]D[0-9]",	NAME="snd/%k" 
KERNEL="pcmC[0-9]D[0-9]c",	NAME="snd/%k" 
KERNEL="pcmC[0-9]D[0-9]p",	NAME="snd/%k" 
KERNEL="timer",			NAME="snd/%k" 
KERNEL="seq",			NAME="snd/%k" 

[-- Attachment #3: 01-devfs.txt --]
[-- Type: text/plain, Size: 3275 bytes --]

# There are a number of modifiers that are allowed to be used in the NAME or PROGRAM fields.
# They provide the following subsitutions:
# %n - the "kernel number" of the device.
#      for example, 'sda3' has a "kernel number" of '3'
# %k - the kernel name for the device.
# %M - the kernel major number for the device
# %m - the kernel minor number for the device
# %b - the bus id for the device
# %c - the return value for the CALLOUT program (note, this doesn't work within
#      the PROGRAM field for the obvious reason.)
# %D - use the devfs style disk name for this device.
#      For partitions, this will result in 'part%n'
#      If this is not a partition, it will result in 'disc'
#

# block
BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n",  SYMLINK="%1c %2c %3c %4c %5c"

KERNEL="md[0-9]*",	SYMLINK="md/%n"
KERNEL="loop[0-9]*",	SYMLINK="loop/%n"
KERNEL="fd[0-9]*",	SYMLINK="floppy/%n"
KERNEL="pktcdvd[0-9]*",	SYMLINK="pktcdvd/%n"

KERNEL="ram[0-9]*",	SYMLINK="rd/%n"

KERNEL="raw[0-9]*",	SYMLINK="%k"
KERNEL="rawctl",	SYMLINK="raw/%k"

KERNEL="lp[0-9]*",	SYMLINK="printers/%n"

# char
KERNEL="vcs",		SYMLINK="vcc/0"
KERNEL="vcs[1-9]*",	SYMLINK="vcc/%n"
KERNEL="vcsa",		NAME="%k",		SYMLINK="vcc/a0 vcsa0"
KERNEL="vcsa[0-9]*",	SYMLINK="vcc/a%n"
KERNEL="tty",		NAME="%k",		SYMLINK="vc/0 tty0"
KERNEL="tty[0-9]*",	SYMLINK="vc/%n"
KERNEL="ttyS[0-9]*",	SYMLINK="tts/%n"
KERNEL="ttyUSB[0-9]*",	SYMLINK="tts/USB%n"

# can one have more then one from these ?
KERNEL="agpgart", 	SYMLINK="misc/agpgart",
KERNEL="apm_bios",	SYMLINK="misc/apm_bios"
KERNEL="rtc",		SYMLINK="misc/rtc"

KERNEL="i2c-[0-9]*",	SYMLINK="i2c/%n"

KERNEL="lirc",		SYMLINK="lirc/lirc%n"
KERNEL="lirc[1-9]",	SYMLINK="lirc/%k"

KERNEL="fb[1-9]*",	SYMLINK="fb/%n"

# some stuff is commented out below, as IIRC the max of tv cards == 8
KERNEL="video0",	SYMLINK="v4l/video0"
KERNEL="video[1-9]",	SYMLINK="v4l/video%n"
KERNEL="radio0",	SYMLINK="v4l/radio0"
KERNEL="radio[1-9]",	SYMLINK="v4l/radio%n"
KERNEL="vbi0",		SYMLINK="v4l/vbi0"
KERNEL="vbi[1-9]",	SYMLINK="v4l/vbi%n"
KERNEL="vtx0",		SYMLINK="v4l/vtx0"
KERNEL="vtx[1-9]",	SYMLINK="v4l/vtx%n"

# input 
KERNEL="psaux",		SYMLINK="misc/%k"


############################   sound  ######################################
KERNEL="admmidi",	SYMLINK="sound/admmidi"
KERNEL="admmidi[1-9]",	SYMLINK="sound/admmidi%n"
KERNEL="adsp",		SYMLINK="sound/adsp"
KERNEL="adsp[1-9]",	SYMLINK="sound/adsp%n"
KERNEL="amidi",		SYMLINK="sound/amidi"
KERNEL="amidi[1-9]",	SYMLINK="sound/amidi%n"
KERNEL="amixer",	SYMLINK="sound/amixer"
KERNEL="amixer[1-9]",	SYMLINK="sound/amixer%n"

KERNEL="audio",		SYMLINK="sound/audio"
KERNEL="audio[1-9]",	SYMLINK="sound/audio%n"
KERNEL="dmmidi",	SYMLINK="sound/dmmidi"
KERNEL="dmmidi[1-9]",	SYMLINK="sound/dmmidi%n"
KERNEL="dsp",		SYMLINK="sound/dsp"
KERNEL="dsp[1-9]",	SYMLINK="sound/dsp%n"
KERNEL="dmfm",		SYMLINK="sound/dmfm"
KERNEL="dmfm[1-9]",	SYMLINK="sound/dmfm%n"
KERNEL="midi",		SYMLINK="sound/midi"
KERNEL="midi[1-9]",	SYMLINK="sound/midi%n"
KERNEL="mixer",		SYMLINK="sound/mixer"
KERNEL="mixer[1-9]",	SYMLINK="sound/mixer%n"
KERNEL="music",		SYMLINK="sound/music"
KERNEL="music[1-9]",	SYMLINK="sound/music%n"
KERNEL="sequencer",	SYMLINK="sound/sequencer"
KERNEL="sequencer[1-9]",SYMLINK="sound/%k"

  parent reply	other threads:[~2004-01-22 17:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-17 20:13 [PATCH] multple rules files support/symlink rules support Andrey Borzenkov
2004-01-20 17:09 ` Andrey Borzenkov
2004-01-20 17:57 ` Svetoslav Slavtchev
2004-01-20 18:45 ` Andrey Borzenkov
2004-01-20 23:10 ` Svetoslav Slavtchev
2004-01-21 23:51 ` Greg KH
2004-01-22 17:44 ` Svetoslav Slavtchev [this message]
2004-01-26 17:31 ` Andrey Borzenkov
2004-01-26 23:42 ` Kay Sievers
2004-01-27  9:54 ` "Andrey Borzenkov" 
2004-01-27 11:43 ` Marco d'Itri
2004-02-03  1:04 ` Greg KH
2004-02-03 11:25 ` Gioele Barabucci
2004-02-16 22:34 ` Greg KH
2004-02-17  7:29 ` "Andrey Borzenkov" 
2004-02-17 17:29 ` 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=26586.1074793493@www1.gmx.net \
    --to=svetljo@gmx.de \
    --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).