2004-01-13 23:52:30

by Greg KH

[permalink] [raw]
Subject: [ANNOUNCE] udev 013 release

I've released the 013 version of udev. It can be found at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-013.tar.gz

rpms built against Red Hat FC1 are available at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-013-1.i386.rpm
with the source rpm at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-013-1.src.rpm

udev allows users to have a dynamic /dev and provides the ability to
have persistent device names. It uses sysfs and /sbin/hotplug and runs
entirely in userspace. It requires a 2.6 kernel with CONFIG_HOTPLUG
enabled to run. Please see the udev FAQ for any questions about it:
kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ

For any udev vs devfs questions anyone might have, please see:
kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs

NOTE: The udev.rules file format has changed! If you have a modified
config file it MUST be changed in order to work properly. Here's what
needs to be done:
- The "<METHOD>, " at the beginning of the line should be
removed. <METHOD> is one of the following: LABEL, CALLOUT,
NUMBER, TOPOLOGY, REPLACE.
- 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)

Also note the following changes in the way the udev.rules file is
processed:
- Rules are processed in order they appear in the file. There
are no priorities anymore.
- if NAME="" is given, udev is instructed to ignore this device,
no node or symlink will be created.

As a result of these changes, we can now create much more powerful rules
by combining multiple key fields. Here's two new rules that show how
you can do this:
# 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="/sbin/ide-devfs.sh %k %b %n", RESULT="hd*", NAME="%1c", SYMLINK="%2c %3c"

Also, the result of the PROGRAM call is now cached accross multiple
rules as long as a new PROGRAM key is not specified. As an example:
PROGRAM="/bin/echo abc", RESULT="no_match", NAME="web-no-2"
KERNEL="video*", RESULT="123", NAME="web-no-3"
KERNEL="video*", RESULT="abc", NAME="web-yes"
The last rule would match properly.

Many thanks for these changes go to Kay Sievers. I really appreciate
all of the development effort.

If anyone has any problems converting existing rules files, please see
the example rules that are in the udev tarball, and feel free to ask
questions on the linux-hotplug-devel mailing list.

Thanks again to everyone who has send me patches for this release, a
full list of everyone, and their changes is below.

udev development is done in a BitKeeper repository located at:
bk://linuxusb.bkbits.net/udev

Daily snapshots of udev from the BitKeeper tree can be found at:
http://www.codemonkey.org.uk/projects/bitkeeper/udev/
If anyone ever wants a tarball of the current bk tree, just email me.

thanks,

greg k-h


Summary of changes from v012 to v013
============================================

<eike-hotplug:sf-tec.de>:
o LSB init script and other stuff

<elkropac:students.zcu.cz>:
o fix udev directory for Debian init script

<tiggi:infa.abo.fi>:
o udev 012 old gcc fixup

Christophe Saout:
o add IGNORE rule type
o small cleanup

Greg Kroah-Hartman:
o update TODO with some new, small items
o Cset exclude: [email protected]|ChangeSet|20040113010256|48515
o update the README in a few places
o fix -d typo in the manpage update
o Fix stupid gcc "optimization" of 1 character printk() calls.... Ick
o oops, forgot to fix up the PROGRAM result from ID to RESULT in the config files
o Add alsa device rules and a few other devfs rules
o fix a few stale comments in namedev.c
o convert the default rules files to the new format
o convert the test shell scripts to the config file format
o add bus test for usb-serial bus
o Add some helpful messages if the user uses the older config file format
o added dri rule to the default config file
o added init.d udev script for debian
o add a script that tests the IGNORE rule
o add silly script that names cdrom drives based on the cd in them
o add cdrom rule for ide cdrom
o replace list_for_each with list_for_each_entry, saving a few lines of code
o add a blacklist of class devices we do not want to look at
o 012_bk change
o v012 release TAG: v012

Kay Sievers:
o fix klibc with printf() and gcc
o udev - small script optimization
o udev - introduce format escape char
o udev - more CALLOUT is PROGRAM now
o udev - CALLOUT is PROGRAM now
o update documentation for new config file format
o more advanced user query options
o udev - simple debug tweak
o udev - drop all methods :)
o udev - advanced user query options
o udev - Makefile error
o udev - make exec_callout() reusable
o udev - exec status fix for klibc
o fix Silly udev script


2004-01-14 05:13:21

by Nuno Silva

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

Jan 14 05:04:36 puma kernel: hub 4-0:1.0: new USB device on port 1, assigned address 20
Jan 14 05:04:37 puma udev[15057]: main: version 013
Jan 14 05:04:37 puma udev[15057]: get_dirs: sysfs_path='/sys'
Jan 14 05:04:37 puma udev[15057]: parse_config_file: reading '/etc/udev/udev.conf' as config file
Jan 14 05:04:37 puma udev[15057]: main: called by hotplug
Jan 14 05:04:37 puma udev[15057]: udev_hotplug: looking at '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0'
Jan 14 05:04:37 puma udev[15057]: udev_hotplug: not a block or class device
Jan 14 05:04:38 puma udev[15059]: main: version 013
Jan 14 05:04:38 puma udev[15059]: get_dirs: sysfs_path='/sys'
Jan 14 05:04:38 puma udev[15059]: parse_config_file: reading '/etc/udev/udev.conf' as config file
Jan 14 05:04:38 puma udev[15059]: main: called by hotplug
Jan 14 05:04:38 puma udev[15059]: udev_hotplug: looking at '/devices/pci0000:00/0000:00:1d.2/usb4/4-1'
Jan 14 05:04:38 puma udev[15059]: udev_hotplug: not a block or class device
Jan 14 05:04:40 puma udev[15069]: main: version 013
Jan 14 05:04:40 puma udev[15069]: get_dirs: sysfs_path='/sys'
Jan 14 05:04:40 puma udev[15069]: parse_config_file: reading '/etc/udev/udev.conf' as config file
Jan 14 05:04:40 puma udev[15069]: main: called by hotplug
Jan 14 05:04:40 puma udev[15069]: udev_hotplug: looking at '/class/scsi_host/host19'
Jan 14 05:04:40 puma udev[15069]: udev_hotplug: don't care about 'scsi_host' devices
Jan 14 05:04:40 puma kernel: scsi19 : SCSI emulation for USB Mass Storage devices
Jan 14 05:04:40 puma scsi.agent[15071]: how to add device type= at /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/host19/19:0:0:0 ??
Jan 14 05:04:40 puma udev[15082]: main: version 013
Jan 14 05:04:40 puma udev[15082]: get_dirs: sysfs_path='/sys'
Jan 14 05:04:40 puma udev[15082]: parse_config_file: reading '/etc/udev/udev.conf' as config file
Jan 14 05:04:40 puma udev[15082]: main: called by hotplug
Jan 14 05:04:40 puma udev[15082]: udev_hotplug: looking at '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/host19/19:0:0:0'
Jan 14 05:04:40 puma udev[15082]: udev_hotplug: not a block or class device
Jan 14 05:04:40 puma kernel: Vendor: HP Model: CD-Writer cd4f Rev: 1.0A
Jan 14 05:04:40 puma kernel: Type: CD-ROM ANSI SCSI revision: 02
Jan 14 05:04:40 puma udev[15089]: main: version 013
Jan 14 05:04:40 puma udev[15089]: get_dirs: sysfs_path='/sys'
Jan 14 05:04:40 puma udev[15089]: parse_config_file: reading '/etc/udev/udev.conf' as config file
Jan 14 05:04:40 puma udev[15089]: main: called by hotplug
Jan 14 05:04:40 puma udev[15089]: udev_hotplug: looking at '/block/sr0'
Jan 14 05:04:40 puma udev[15089]: namedev_init_rules: reading '/etc/udev/udev.rules' as rules file
Jan 14 05:04:40 puma udev[15089]: namedev_init_permissions: reading '/etc/udev/udev.permissions' as permissions file
Jan 14 05:04:40 puma udev[15089]: sleep_for_dev: looking for '/sys/block/sr0/dev'
Jan 14 05:04:40 puma udev[15089]: get_class_dev: looking at '/sys/block/sr0'
Jan 14 05:04:40 puma udev[15089]: get_class_dev: class_dev->name='sr0'
Jan 14 05:04:40 puma udev[15089]: get_major_minor: dev='11:0 '
Jan 14 05:04:40 puma udev[15089]: get_major_minor: found major=11, minor=0
Jan 14 05:04:40 puma udev[15096]: main: version 013
Jan 14 05:04:40 puma udev[15096]: get_dirs: sysfs_path='/sys'
Jan 14 05:04:40 puma udev[15089]: get_sysfs_device: filename = /sys/block/sr0
Jan 14 05:04:40 puma udev[15096]: parse_config_file: reading '/etc/udev/udev.conf' as config file
Jan 14 05:04:40 puma udev[15089]: get_sysfs_device: temp2 =
Jan 14 05:04:40 puma udev[15096]: main: called by hotplug
Jan 14 05:04:40 puma udev[15089]: get_sysfs_device: looking for '/sys/block/device'
Jan 14 05:04:40 puma udev[15096]: udev_hotplug: looking at '/class/scsi_device/19:0:0:0'
Jan 14 05:04:40 puma udev[15096]: udev_hotplug: don't care about 'scsi_device' devices
Jan 14 05:04:40 puma kernel: sr0: scsi3-mmc drive: 20x/20x writer cd/rw xa/form2 cdda pop-up
Jan 14 05:04:40 puma kernel: Attached scsi CD-ROM sr0 at scsi19, channel 0, id 0, lun 0
Jan 14 05:04:40 puma kernel: Attached scsi generic sg0 at scsi19, channel 0, id 0, lun 0, type 5
Jan 14 05:04:40 puma kernel: WARNING: USB Mass Storage data integrity not assured
Jan 14 05:04:40 puma kernel: USB Mass Storage device found at 20
Jan 14 05:04:41 puma udev[15089]: get_sysfs_device: looking for '/sys/block/device'
Jan 14 05:04:42 puma udev[15089]: sysfs_path_is_link: stat() failed
Jan 14 05:04:42 puma udev[15089]: sysfs_path_is_link: stat() failed
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: sysfs_device->path='/sys/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/host19/19:0:0:0'
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: sysfs_device->bus_id='19:0:0:0'
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: sysfs_device->bus='scsi'
Jan 14 05:04:42 puma udev[15089]: wait_for_device_to_initialize: looking for file 'vendor' on bus 'scsi'
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: kernel_number='0'
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: check for BUS dev->bus='scsi' sysfs_device->bus='scsi'
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: BUS matches
Jan 14 05:04:42 puma udev[15089]: namedev_name_device: check PROGRAM
Jan 14 05:04:42 puma udev[15089]: apply_format: substitute bus_id '19:0:0:0'
Jan 14 05:04:42 puma udev[15089]: execute_program: executing '/bin/echo -n test-19:0:0:0'
Jan 14 05:04:43 puma udev[15089]: execute_program: result is 'test-19:0:0:0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: PROGRAM returned successful
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for RESULT dev->result='test-42:0:0:1', udev->program_result='test-19:0:0:0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: RESULT is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='usb' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='usb' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='usb' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='pci' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='pci' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='usb' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='usb' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='usb' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='ttyUSB1' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='ttyUSB0' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for BUS dev->bus='ide' sysfs_device->bus='scsi'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: BUS is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='dm-[0-9]*' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='card*' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='controlC[0-9]*' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='hw[CD0-9]*' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='pcm[CD0-9cp]*' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='midi[CD0-9]*' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='timer' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: process rule
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: check for KERNEL dev->kernel='seq' class_dev->name='sr0'
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: KERNEL is not matching
Jan 14 05:04:43 puma udev[15089]: namedev_name_device: name, 'sr0' is going to have owner='', group='', mode = 0600
Jan 14 05:04:43 puma udev[15089]: udev_add_device: name='sr0'
Jan 14 05:04:43 puma udev[15089]: create_node: mknod(/udev/sr0, 060600, 11, 0)
Jan 14 05:04:43 puma udev[15089]: create_node: chmod(/udev/sr0, 060600)


Attachments:
syslog (10.87 kB)

2004-01-14 17:24:29

by Greg KH

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

On Wed, Jan 14, 2004 at 05:15:48AM +0000, Nuno Silva wrote:
> I'm trying udev for the first time and I must say good work!

Thanks.

> A sugestion and a question:
>
> - Make udev print a /etc/udev/udev.rules line every time a device is
> found because default behaviour is too silent and "make DEBUG=true" is
> too noisy. This would make adding our private/static entries easily.
> Something like:
>
> udev[1234]: found device BUS="scsi", SYSFS_model="CD-Writer cd4f",
> KERNEL="sr0", SYSFS_serial="AAAAAAAA"
>
> This way one can easily make entries for a device with copy+paste,
> remove a few parameters and adding a few *'s

Yeah, but what exactly would udev print out? All of the sysfs files in
the device it found? Would it print it out for every device that comes
through? Or just for ones that no rule applied to?

> - I have a USB cd-writer and udev makes /udev/sr0 but it doesn't create
> /udev/sg0. In the first run I had the hotplug packege from debian but I
> just installed hotplug-2004_01_05 and it's the same, no sg0 is created.

There is currently no sg sysfs support that works properly with udev.
The scsi people know about this and are working on fixing it.

thanks,

greg k-h

2004-01-14 17:47:01

by Chris Friesen

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

Greg KH wrote:
> On Wed, Jan 14, 2004 at 05:15:48AM +0000, Nuno Silva wrote:

>>A sugestion and a question:
>>
>>- Make udev print a /etc/udev/udev.rules line every time a device is
>>found because default behaviour is too silent and "make DEBUG=true" is
>>too noisy.

> Yeah, but what exactly would udev print out? All of the sysfs files in
> the device it found? Would it print it out for every device that comes
> through? Or just for ones that no rule applied to?


Maybe for ones with a matching rule, you could print something like:

udev[1234]: new device found matching rule <blah>, creating device node
<nodename>

For ones that don't match any rules, you could dump out all the info:

udev[1234]: new device found with no matching rules, device info: blah blah



Chris




--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: [email protected]

2004-01-14 19:23:52

by Nuno Silva

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release


Hi Chris!
Hi Greg!

Chris Friesen wrote:
> Greg KH wrote:
>
>> Yeah, but what exactly would udev print out? All of the sysfs files in
>> the device it found? Would it print it out for every device that comes
>> through? Or just for ones that no rule applied to?
>
>
>
> Maybe for ones with a matching rule, you could print something like:
>
> udev[1234]: new device found matching rule <blah>, creating device node
> <nodename>
>
> For ones that don't match any rules, you could dump out all the info:
>
> udev[1234]: new device found with no matching rules, device info: blah blah
>

This would be nice but I think that full info for every new hotplugged
device is even better. It's only 1 line :-)

Lame people, like myself, will make this rule:

BUS="scsi", SYSFS_model="CD-Writer cd4f*", KERNEL="sr*", NAME="cdrw"

When I connect a second drive (same model) /udev/cdrw will be
overwritten. So I'd want to check the logs, find some difference between
the two and create a new entry "myfriends-cdrw".

(I know that NAME="cdrw%n" would work but that depends on the order you
plug things).

Regards,
Nuno Silva

2004-01-14 20:34:36

by Clay Haapala

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

On Wed, 14 Jan 2004, Chris Friesen spake thusly:
>
> Maybe for ones with a matching rule, you could print something like:
>
>
Is the act of printing/syslogging a rule in an of itself?
--
Clay Haapala ([email protected]) Cisco Systems SRBU +1 763-398-1056
6450 Wedgwood Rd, Suite 130 Maple Grove MN 55311 PGP: C89240AD
"Too bad marketing doesn't run on my computer."
-- acousticiris, on /.

2004-01-14 20:47:38

by Chris Friesen

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

Clay Haapala wrote:

> Is the act of printing/syslogging a rule in an of itself?

I haven't looked at the capabilities in a while. Can you specify a
default rule if nothing else matches? Can you, in one rule, specify
another rule? (Kind of like iptables jump targets).

If so, then this would allow massive flexibility.

Chris


--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: [email protected]

2004-01-14 21:14:39

by Greg KH

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

On Wed, Jan 14, 2004 at 07:23:11PM +0000, Nuno Silva wrote:
> This would be nice but I think that full info for every new hotplugged
> device is even better. It's only 1 line :-)

Heh, care to make that one line patch? :)

> Lame people, like myself, will make this rule:
>
> BUS="scsi", SYSFS_model="CD-Writer cd4f*", KERNEL="sr*", NAME="cdrw"
>
> When I connect a second drive (same model) /udev/cdrw will be
> overwritten.

No, the node will not be overwritten. The mknod() syscall will fail due
to the node already being present. What would happen is that your new
node would not be created.

> So I'd want to check the logs, find some difference between
> the two and create a new entry "myfriends-cdrw".
>
> (I know that NAME="cdrw%n" would work but that depends on the order you
> plug things).

Heh.

I'm thinking that having such a log message would be a good thing. Now
to go figure out what log level to make those messages...

thanks,

greg k-h

2004-01-14 21:14:33

by Greg KH

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

On Wed, Jan 14, 2004 at 02:34:26PM -0600, Clay Haapala wrote:
> On Wed, 14 Jan 2004, Chris Friesen spake thusly:
> >
> > Maybe for ones with a matching rule, you could print something like:
> >
> >
> Is the act of printing/syslogging a rule in an of itself?

No, as currently the only way stuff ends up in the syslog is if
DEBUG=true is used on the build line.

But it's sounding like we might want to change that... :)

thanks,

greg k-h

2004-01-14 21:16:26

by Greg KH

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

On Wed, Jan 14, 2004 at 03:47:15PM -0500, Chris Friesen wrote:
> Clay Haapala wrote:
>
> >Is the act of printing/syslogging a rule in an of itself?
>
> I haven't looked at the capabilities in a while. Can you specify a
> default rule if nothing else matches?

The "default rule" is to use the kernel name to name the device. That
one is built in.

> Can you, in one rule, specify another rule? (Kind of like iptables
> jump targets).

No.

> If so, then this would allow massive flexibility.

And massive complexity :)

Why would you want to have a rule specify another (in the current
syntax)? These rules aren't that complex, and anything that does grow
to be complex should be shoved out into a separate script/program that a
rule can then call.

Does this help?

thanks,

greg k-h

2004-01-15 07:45:59

by Nuno Silva

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

diff -Naur udev-013.orig/logging.c udev-013/logging.c
--- udev-013.orig/logging.c 2003-12-15 21:57:35.000000000 +0000
+++ udev-013/logging.c 2004-01-15 02:52:36.000000000 +0000
@@ -27,8 +27,6 @@
#include <syslog.h>
#include "udev.h"

-#ifdef DEBUG
-
static int logging_init = 0;
static unsigned char udev_logname[42];

@@ -55,4 +53,3 @@
return 1;
}

-#endif
diff -Naur udev-013.orig/namedev.c udev-013/namedev.c
--- udev-013.orig/namedev.c 2004-01-13 22:52:57.000000000 +0000
+++ udev-013/namedev.c 2004-01-15 07:40:40.000000000 +0000
@@ -748,6 +748,13 @@
udev->owner[0] = 0x00;
udev->group[0] = 0x00;
}
+ /* notify syslog and report some of the configuration: */
+ /* FIXME: add SYSFS_* nodes, too */
+ dbg_syslog("New device! Metrics: BUS='%s', ID='%s', KERNEL='%s'",
+ sysfs_device->bus, sysfs_device->bus_id, class_dev->name);
+ dbg_syslog("name, '%s' is going to have owner='%s', group='%s', mode = %#o",
+ udev->name, udev->owner, udev->group, udev->mode);
+
dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o",
udev->name, udev->owner, udev->group, udev->mode);

diff -Naur udev-013.orig/udev.h udev-013/udev.h
--- udev-013.orig/udev.h 2004-01-13 01:50:34.000000000 +0000
+++ udev-013/udev.h 2004-01-14 23:22:08.000000000 +0000
@@ -25,9 +25,14 @@

#include "libsysfs/libsysfs.h"
#include <sys/param.h>
+#include <syslog.h>
+
+#define dbg_syslog(format, arg...) \
+ do { \
+ log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
+ } while (0)

#ifdef DEBUG
-#include <syslog.h>
#define dbg(format, arg...) \
do { \
log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \


Attachments:
udev-report-details.diff (1.66 kB)

2004-01-15 23:21:24

by Greg KH

[permalink] [raw]
Subject: Re: [ANNOUNCE] udev 013 release

On Thu, Jan 15, 2004 at 07:48:41AM +0000, Nuno Silva wrote:
> Hi!
>
> Greg KH wrote:
> >On Wed, Jan 14, 2004 at 07:23:11PM +0000, Nuno Silva wrote:
> >
> >>This would be nice but I think that full info for every new hotplugged
> >>device is even better. It's only 1 line :-)
> >
> >
> >Heh, care to make that one line patch? :)
> >
>
> Ehehehe I was talking about the extra line ending up in syslog. :-)
>
> Anyway, attached is a simple patch that outputs 50% of what I'd like to
> see - still missing the SYSFS_model, serial, etc because
> sysfs_get_classdev_attributes didn't work at my first try, but that's my
> faulty C showing :)

Hm, I just took Kay's patch instead. Care to make up a patch for this
based off of it?

thanks,

greg k-h