IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
> Hi,
> as promised yesterday, here is a patch that drops the explicit methods
> given in the udev config and implement only one type of rule.
>
> A rule now consists only of a number of keys to match. All known keys
> are valid in any combination. The former configs should work with a few
> changes:
>
> o the "<METHOD>, " at the beginning of the line should be removed
>
> o the result of the externel program is matched with RESULT= instead if ID=
> the PROGRAM= key is only valid if the program exits with zero
> (just exit with nozero in a script if the rule should not match)
>
> o rules are processed in order they appear in the file, no priority
>
> o if NAME="" is given, udev is instructed to ignore this device,
> no node will be created
>
>
> EXAMPLE:
>
> # combined BUS, SYSFS and KERNEL
> BUS="usb", KERNEL="video*", SYSFS_model="Creative Labs WebCam*", NAME="test/webcam%n"
>
> # exec script only for the first ide drive (hda), all other will be skipped
> BUS="ide", KERNEL="hda*", PROGRAM="/home/kay/src/udev.kay/extras/ide-devfs.sh %k %b %n", RESULT="hd*", NAME="%1c", SYMLINK="%2c %3c"
>
>
> The udev-test.pl and test.block works fine here.
> Please adapt your config and give it a try.
>
Here is a slightly better version of the patch.
After a conversation with Patrick, we are now able to execute the PROGRAM
and also match in all following rules with the RESULT value from this exec.
EXAMPLE:
We have 7 rules with RESULT and 2 with PROGRAM.
Only the 5th rule matches with the callout result from the exec in the 4th rule.
RULES:
PROGRAM="/bin/echo abc", RESULT="no_match", NAME="web-no-2"
KERNEL="video*", RESULT="123", NAME="web-no-3"
KERNEL="video*", RESULT="123", NAME="web-no-4"
PROGRAM="/bin/echo 123", RESULT="no_match", NAME="web-no-5"
KERNEL="video*", RESULT="123", NAME="web-yes"
RESULT:
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check PROGRAM
Jan 11 23:36:52 pim udev[26050]: execute_program: executing '/bin/echo abc'
Jan 11 23:36:52 pim udev[26050]: execute_program: result is 'abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: PROGRAM returned successful
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='no_match', udev->program_result='abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for KERNEL dev->kernel='video*' class_dev->name='video0'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: KERNEL matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='123', udev->program_result='abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for KERNEL dev->kernel='video*' class_dev->name='video0'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: KERNEL matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='123', udev->program_result='abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check PROGRAM
Jan 11 23:36:52 pim udev[26050]: execute_program: executing '/bin/echo 123'
Jan 11 23:36:52 pim udev[26050]: execute_program: result is '123'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: PROGRAM returned successful
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='no_match', udev->program_result='123'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for KERNEL dev->kernel='video*' class_dev->name='video0'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: KERNEL matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='123', udev->program_result='123'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: found matching rule, 'video*' becomes ''
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: name, 'web-yes' is going to have owner='', group='', mode = 0600
This patch improves the user options for udev.
It is possible now to query for the name, the symlinks or owner/group.
If asked for the name of the node we are able to prepend the udev_root
with the -r option.
SAMPLE:
kay@pim:~/src/udev.test$ ./udev -V
udev, version 012_bk
kay@pim:~/src/udev.test$ ./udev -h
Usage: [-qrVh]
-q <name> query database for the specified value
-p <path> device path used for query
-r print udev root
-V print udev version
-h print this help text
kay@pim:~/src/udev.test$ ./udev -r
/udev/
kay@pim:~/src/udev.test$ ./udev -q name -p /class/video4linux/video0
video/webcam0
kay@pim:~/src/udev.test$ ./udev -q symlink -p /class/video4linux/video0
camera0 kamera0
kay@pim:~/src/udev.test$ ./udev -q owner -p /class/video4linux/video0
501
kay@pim:~/src/udev.test$ ./udev -r -q name -p /class/video4linux/video0
/udev/video/webcam0
I get the following error on install:
pim:/home/kay/src/udev.test# make install
sed -e "s:@udevdir@:/udev:" < etc/udev/udev.conf.in > etc/udev/udev.conf
/usr/bin/install -c -d /etc/udev/
/usr/bin/install -c -d /udev
/usr/bin/install -c -d /etc/hotplug.d/default
/usr/bin/install -c -D udev /sbin/udev
/bin/sh: -c: line 2: syntax error: unexpected end of file
make: *** [install] Error 2
I had too much time during the holidays, so I played a bit with udev. The
changes are like last time mostly on the init stuff. I'm sending you this as
a great diff which is just for comments.
What it does:
-fix a typo in Makefile
-use only one "grep -v" instead of many
-don't include BK-Files into release (shrinks the stuff to 30%!)
-add a new init script which is LSB compliant
-add some flags to choose which one to use
-use /etc/udev/udev.conf in Redhat init script as the source for the udev
directory. If this is not done then the init script may create a directory
which udev itself isn't using (I changed /udev to /Udev to avoid collisions
with /usr and ran into this)
-first check for sysfs_dir before creating udev_root (maybe someone else has
already fixed this, I saw this discussion on lkml)
Hey, this is funny.
I couldn't resist to give it a try and we need a few changes:
- it's %2c otherwise nearly all my CD's are "good", but sure I also have bad ones :)
- remove the node first, cause get_cddb() dies and leaves the old one there
- remove spaces in name, cause this is our separator
/udev/
|-- The_Cure-The_Peel_Sessions
|-- cdrom -> ./The_Cure-The_Peel_Sessions
|-- hda
|-- hda1
|-- hda2
|-- hda4
Hello,
without this patch:
wolf@duel:/tmp/ud/udev-012>gcc -v
Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/2.95.3/specs
gcc version 2.95.3 20010315 (release)
cannot compile udev.
On Wed, Dec 31, 2003 at 11:24:53AM -0800, Greg KH wrote:
> > There should be a possibility to tell udev not to create a device node.
> >
> > device-mapper: Usually set up by libdevmapper (or EVMS tools) which
> > creates the device node on its own under /dev/mapper/<name>.
> >
> > With udev a second device is created named /dev/dm-<minor> which is not
> > really needed.
>
> Good point. Ok, I'll agree with you. Care to make up a patch for this
> kind of feature?
Yes, I can try.
There was no way to tell not to do anything so I created one. Errors
are signalled via negative return values, so I thought that a positive,
non-zero one could mean to ignore the device. I don't like it but
perhaps you have a better solution.
This one is nothing important, just add some quotes to be more consistent
with the rest and make sure that the return value is positive (since the
error return values are negative). Hmm?
More udev spec file updates. This one from David Zeuthen.
Attached patch, against udev-011, makes sure we pass USE_DBUS and also
makes sure we install the D-BUS policy file, if the %{dbus} option is
set.
Here is a slightly better version that prints the usage if a unknown option is given:
kay@pim:~/src/udev.kay$ ./udev -x
./udev: invalid option -- x
Usage: [-qrVh]
-q arg query database
-r print udev root
-V print udev version
-h print this help text
> Here is a patch that makes it possible to call udev with options on the command line.
> Valid options are for now:
>
> -V for the udev version:
> kay@pim:~/src/udev.kay$ ./udev -V
> udev, version 011_bk
>
> -r for the udev root:
> kay@pim:~/src/udev.kay$ ./udev -r
> /udev/
>
> -q to query the database with the sysfs path for the name of the node:
> kay@pim:~/src/udev.kay$ ./udev -q /class/video4linux/video0
> test/video/webcam0
If a file that is not a symlink (node, socket, fifo, etc) already
exist where udev need to create a symlink, symlink() fails. This
patch basically test for an existing file, and unlink it.