* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
@ 2004-01-14 1:38 ` Frédéric L. W. Meunier
2004-01-14 2:14 ` Jon Smirl
` (12 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Frédéric L. W. Meunier @ 2004-01-14 1:38 UTC (permalink / raw)
To: linux-hotplug
On Tue, 13 Jan 2004, Greg KH wrote:
> I've released the 013 version of udev. It can be found at:
> kernel.org/pub/linux/utils/kernel/hotplug/udev-013.tar.gz
Is it intentional to leave all those BitKeeper/ and SCCS/
directories ? I thought they'd only be in the snapshots. A
tarball without them is around 30% the size of the original.
--
http://www.pervalidus.net/contact.html
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
2004-01-14 1:38 ` Frédéric L. W. Meunier
@ 2004-01-14 2:14 ` Jon Smirl
2004-01-14 5:15 ` Nuno Silva
` (11 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Jon Smirl @ 2004-01-14 2:14 UTC (permalink / raw)
To: linux-hotplug
The fedora rpm --erase script errors out when you run it.
Not a fatal problem.
[root@smirl jonsmirl]# rpm --erase udev
error reading information on service udev: No such file or directory
error: %postun(udev-013-1) scriptlet failed, exit status 1
--- Greg KH <greg@kroah.com> wrote:
> 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
==Jon Smirl
jonsmirl@yahoo.com
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
2004-01-14 1:38 ` Frédéric L. W. Meunier
2004-01-14 2:14 ` Jon Smirl
@ 2004-01-14 5:15 ` Nuno Silva
2004-01-14 17:15 ` Greg KH
2004-01-14 17:27 ` Greg KH
` (10 subsequent siblings)
13 siblings, 1 reply; 25+ messages in thread
From: Nuno Silva @ 2004-01-14 5:15 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]
[I'm in lkml, but not in linux-hotplug-devel, so please CC: me]
Hi!
I'm trying udev for the first time and I must say good work!
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
- 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.
The kernel detects it:
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
The full udev run, from syslog, is attached.
Do I need a new rule? The log sugests that in that single run udev only
cares about sr0, but I can be reading it wrong :) Or sysfs/udev doesn't
support scsi_generic yet?
Thanks,
Nuno Silva
Greg KH wrote:
> I've released the 013 version of udev. It can be found at:
> kernel.org/pub/linux/utils/kernel/hotplug/udev-013.tar.gz
[-- Attachment #2: syslog --]
[-- Type: text/plain, Size: 11129 bytes --]
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)
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-14 5:15 ` Nuno Silva
@ 2004-01-14 17:15 ` Greg KH
2004-01-14 17:46 ` Chris Friesen
0 siblings, 1 reply; 25+ messages in thread
From: Greg KH @ 2004-01-14 17:15 UTC (permalink / raw)
To: Nuno Silva; +Cc: linux-hotplug-devel, linux-kernel
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
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 17:15 ` Greg KH
@ 2004-01-14 17:46 ` Chris Friesen
2004-01-14 19:23 ` Nuno Silva
2004-01-14 20:34 ` Clay Haapala
0 siblings, 2 replies; 25+ messages in thread
From: Chris Friesen @ 2004-01-14 17:46 UTC (permalink / raw)
To: Greg KH; +Cc: Nuno Silva, linux-hotplug-devel, linux-kernel
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: cfriesen@nortelnetworks.com
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 17:46 ` Chris Friesen
@ 2004-01-14 19:23 ` Nuno Silva
2004-01-14 21:14 ` Greg KH
2004-01-14 20:34 ` Clay Haapala
1 sibling, 1 reply; 25+ messages in thread
From: Nuno Silva @ 2004-01-14 19:23 UTC (permalink / raw)
To: Chris Friesen; +Cc: Greg KH, linux-hotplug-devel, linux-kernel
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
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 19:23 ` Nuno Silva
@ 2004-01-14 21:14 ` Greg KH
2004-01-15 7:48 ` Nuno Silva
0 siblings, 1 reply; 25+ messages in thread
From: Greg KH @ 2004-01-14 21:14 UTC (permalink / raw)
To: Nuno Silva; +Cc: Chris Friesen, linux-hotplug-devel, linux-kernel
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
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 21:14 ` Greg KH
@ 2004-01-15 7:48 ` Nuno Silva
2004-01-15 23:03 ` Greg KH
0 siblings, 1 reply; 25+ messages in thread
From: Nuno Silva @ 2004-01-15 7:48 UTC (permalink / raw)
To: linux-hotplug-devel; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
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 :)
Thanks,
Nuno Silva
[-- Attachment #2: udev-report-details.diff --]
[-- Type: text/plain, Size: 1696 bytes --]
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); \
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-15 7:48 ` Nuno Silva
@ 2004-01-15 23:03 ` Greg KH
0 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-15 23:03 UTC (permalink / raw)
To: Nuno Silva; +Cc: linux-hotplug-devel, linux-kernel
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
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 17:46 ` Chris Friesen
2004-01-14 19:23 ` Nuno Silva
@ 2004-01-14 20:34 ` Clay Haapala
2004-01-14 20:47 ` Chris Friesen
2004-01-14 21:10 ` Greg KH
1 sibling, 2 replies; 25+ messages in thread
From: Clay Haapala @ 2004-01-14 20:34 UTC (permalink / raw)
To: Chris Friesen; +Cc: Greg KH, Nuno Silva, linux-hotplug-devel, linux-kernel
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 (chaapala@cisco.com) 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 /.
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 20:34 ` Clay Haapala
@ 2004-01-14 20:47 ` Chris Friesen
2004-01-14 21:12 ` Greg KH
2004-01-14 21:10 ` Greg KH
1 sibling, 1 reply; 25+ messages in thread
From: Chris Friesen @ 2004-01-14 20:47 UTC (permalink / raw)
To: Clay Haapala; +Cc: Greg KH, Nuno Silva, linux-hotplug-devel, linux-kernel
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: cfriesen@nortelnetworks.com
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 20:47 ` Chris Friesen
@ 2004-01-14 21:12 ` Greg KH
0 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-14 21:12 UTC (permalink / raw)
To: Chris Friesen; +Cc: Clay Haapala, Nuno Silva, linux-hotplug-devel, linux-kernel
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
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-14 20:34 ` Clay Haapala
2004-01-14 20:47 ` Chris Friesen
@ 2004-01-14 21:10 ` Greg KH
1 sibling, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-14 21:10 UTC (permalink / raw)
To: Clay Haapala; +Cc: Chris Friesen, Nuno Silva, linux-hotplug-devel, linux-kernel
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
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (2 preceding siblings ...)
2004-01-14 5:15 ` Nuno Silva
@ 2004-01-14 17:27 ` Greg KH
2004-01-15 4:14 ` Kay Sievers
` (9 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-14 17:27 UTC (permalink / raw)
To: linux-hotplug
On Tue, Jan 13, 2004 at 11:38:17PM -0200, Frédéric L. W. Meunier wrote:
> On Tue, 13 Jan 2004, Greg KH wrote:
>
> > I've released the 013 version of udev. It can be found at:
> > kernel.org/pub/linux/utils/kernel/hotplug/udev-013.tar.gz
>
> Is it intentional to leave all those BitKeeper/ and SCCS/
> directories ?
Yes. It gives anyone a entire bitkeeper tree, showing all change
history, which is pretty informative.
If it really annoys you, send me a patch to the Makefile release target
:)
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (3 preceding siblings ...)
2004-01-14 17:27 ` Greg KH
@ 2004-01-15 4:14 ` Kay Sievers
2004-01-15 14:32 ` Kay Sievers
` (8 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Kay Sievers @ 2004-01-15 4:14 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 855 bytes --]
On Wed, Jan 14, 2004 at 01:10:43PM -0800, Greg KH wrote:
> 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... :)
How about this in the syslog after connect/disconnect?
Jan 15 05:07:45 pim udev[28007]: configured rule in '/etc/udev/udev.rules' at line 17 applied, 'video*' becomes 'video/webcam%n'
Jan 15 05:07:45 pim udev[28007]: creating device node '/udev/video/webcam0'
Jan 15 05:07:47 pim udev[28015]: removing device node '/udev/video/webcam0'
Kay
[-- Attachment #2: 00-simple-syslog.patch --]
[-- Type: text/plain, Size: 4577 bytes --]
diff -Nru a/Makefile b/Makefile
--- a/Makefile Thu Jan 15 05:11:38 2004
+++ b/Makefile Thu Jan 15 05:11:38 2004
@@ -16,6 +16,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+# Use of syslog
+LOG= true
+
# Set the following to `true' to make a debuggable build.
# Leave this set to `false' for production use.
DEBUG = false
@@ -102,6 +105,10 @@
CFLAGS+=-pipe
else
CFLAGS+=-pipe
+endif
+
+ifeq ($(strip $(LOG)),true)
+ CFLAGS += -DLOG
endif
# if DEBUG is enabled, then we do not strip or optimize
diff -Nru a/logging.c b/logging.c
--- a/logging.c Thu Jan 15 05:11:37 2004
+++ b/logging.c Thu Jan 15 05:11:37 2004
@@ -27,7 +27,7 @@
#include <syslog.h>
#include "udev.h"
-#ifdef DEBUG
+#ifdef LOG
static int logging_init = 0;
static unsigned char udev_logname[42];
diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c Thu Jan 15 05:11:38 2004
+++ b/namedev.c Thu Jan 15 05:11:38 2004
@@ -295,12 +295,12 @@
/* sleep to give the kernel a chance to create the file */
sleep(1);
}
- dbg("Timed out waiting for '%s' file, continuing on anyway...", b->file);
+ dbg("timed out waiting for '%s' file, continuing on anyway...", b->file);
goto exit;
}
b++;
}
- dbg("Did not find bus type '%s' on list of bus_id_files, contact greg@kroah.com", sysfs_device->bus);
+ dbg("did not find bus type '%s' on list of bus_id_files, contact greg@kroah.com", sysfs_device->bus);
exit:
return; /* here to prevent compiler warning... */
}
@@ -544,7 +544,7 @@
if (sysfs_device != NULL)
goto device_found;
}
- dbg("Timed out waiting for device symlink, continuing on anyway...");
+ dbg("timed out waiting for device symlink, continuing on anyway...");
device_found:
/* We have another issue with just the wait above - the sysfs part of
@@ -569,10 +569,10 @@
if (sysfs_device->bus[0] != '\0')
goto bus_found;
}
- dbg("Timed out waiting to find the device bus, continuing on anyway\n");
+ dbg("timed out waiting to find the device bus, continuing on anyway");
goto exit;
bus_found:
- dbg("Device %s is registered with bus %s\n",
+ dbg("device %s is registered with bus '%s'",
sysfs_device->name, sysfs_device->bus);
}
exit:
@@ -704,7 +704,8 @@
}
/* Yup, this rule belongs to us! */
- dbg("found matching rule, '%s' becomes '%s'", dev->kernel, dev->name);
+ info("configured rule in '%s' at line %i applied, '%s' becomes '%s'",
+ udev_rules_filename, dev->config_line, dev->kernel, dev->name);
strfieldcpy(udev->name, dev->name);
strfieldcpy(udev->symlink, dev->symlink);
goto found;
diff -Nru a/namedev.h b/namedev.h
--- a/namedev.h Thu Jan 15 05:11:37 2004
+++ b/namedev.h Thu Jan 15 05:11:37 2004
@@ -65,6 +65,7 @@
char name[NAME_SIZE];
char symlink[NAME_SIZE];
struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
+ int config_line;
};
struct perm_device {
diff -Nru a/namedev_parse.c b/namedev_parse.c
--- a/namedev_parse.c Thu Jan 15 05:11:37 2004
+++ b/namedev_parse.c Thu Jan 15 05:11:37 2004
@@ -249,6 +249,7 @@
goto error;
}
+ dev.config_line = lineno;
retval = add_config_dev(&dev);
if (retval) {
dbg("add_config_dev returned with error %d", retval);
diff -Nru a/udev-add.c b/udev-add.c
--- a/udev-add.c Thu Jan 15 05:11:38 2004
+++ b/udev-add.c Thu Jan 15 05:11:38 2004
@@ -141,6 +141,7 @@
if (strrchr(dev->name, '/'))
create_path(filename);
+ info("creating device node '%s'", filename);
dbg("mknod(%s, %#o, %u, %u)", filename, dev->mode, dev->major, dev->minor);
retval = mknod(filename, dev->mode, res);
if (retval)
diff -Nru a/udev-remove.c b/udev-remove.c
--- a/udev-remove.c Thu Jan 15 05:11:37 2004
+++ b/udev-remove.c Thu Jan 15 05:11:37 2004
@@ -73,7 +73,7 @@
strncpy(filename, udev_root, sizeof(filename));
strncat(filename, dev->name, sizeof(filename));
- dbg("unlinking node '%s'", filename);
+ info("removing device node '%s'", filename);
retval = unlink(filename);
if (retval) {
dbg("unlink(%s) failed with error '%s'",
diff -Nru a/udev.h b/udev.h
--- a/udev.h Thu Jan 15 05:11:38 2004
+++ b/udev.h Thu Jan 15 05:11:38 2004
@@ -26,8 +26,17 @@
#include "libsysfs/libsysfs.h"
#include <sys/param.h>
-#ifdef DEBUG
+#ifdef LOG
#include <syslog.h>
+#define info(format, arg...) \
+ do { \
+ log_message (LOG_INFO , format , ## arg); \
+ } while (0)
+#else
+ #define info(format, arg...) do { } while (0)
+#endif
+
+#ifdef DEBUG
#define dbg(format, arg...) \
do { \
log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (4 preceding siblings ...)
2004-01-15 4:14 ` Kay Sievers
@ 2004-01-15 14:32 ` Kay Sievers
2004-01-15 22:40 ` Greg KH
` (7 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Kay Sievers @ 2004-01-15 14:32 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
On Thu, Jan 15, 2004 at 05:14:16AM +0100, Kay Sievers wrote:
> On Wed, Jan 14, 2004 at 01:10:43PM -0800, Greg KH wrote:
> > 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... :)
>
> How about this in the syslog after connect/disconnect?
>
> Jan 15 05:07:45 pim udev[28007]: configured rule in '/etc/udev/udev.rules' at line 17 applied, 'video*' becomes 'video/webcam%n'
> Jan 15 05:07:45 pim udev[28007]: creating device node '/udev/video/webcam0'
> Jan 15 05:07:47 pim udev[28015]: removing device node '/udev/video/webcam0'
Here is a slightly better version. I've created a logging.h file and
moved the debug macros from udev.h in there.
If you type:
'make' - you will get a binary that prints one or two lines to syslog
if a device node is created or deleted
'make LOG=false' - you get a binary that prints asolutely nothing
'make DEBUG=true' - the same as today, it will print all debug lines
thanks,
Kay
[-- Attachment #2: 00-simple-syslog.patch --]
[-- Type: text/plain, Size: 9257 bytes --]
diff -Nru a/Makefile b/Makefile
--- a/Makefile Thu Jan 15 15:22:25 2004
+++ b/Makefile Thu Jan 15 15:22:25 2004
@@ -16,7 +16,12 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# Set the following to `true' to make a debuggable build.
+# Set the following to control the use of syslog
+# Set it to `false' to remove all logging
+LOG = true
+
+# Set the following to `true' to log the debug
+# and make a unstripped, unoptimized binary.
# Leave this set to `false' for production use.
DEBUG = false
@@ -104,6 +109,10 @@
CFLAGS+=-pipe
endif
+ifeq ($(strip $(LOG)),true)
+ CFLAGS += -DLOG
+endif
+
# if DEBUG is enabled, then we do not strip or optimize
ifeq ($(strip $(DEBUG)),true)
CFLAGS += $(WARNINGS) -O1 -g -DDEBUG -D_GNU_SOURCE
@@ -216,7 +225,7 @@
$(OBJS): $(GEN_HEADERS)
-$(ROOT): $(OBJS) udev.h namedev.h udev_version.h udev_dbus.h udevdb.h klibc_fixups.h list.h
+$(ROOT): $(OBJS) udev.h namedev.h udev_version.h udev_dbus.h udevdb.h klibc_fixups.h logging.h list.h
$(LD) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
$(STRIPCMD) $(ROOT)
diff -Nru a/logging.c b/logging.c
--- a/logging.c Thu Jan 15 15:22:25 2004
+++ b/logging.c Thu Jan 15 15:22:25 2004
@@ -25,9 +25,9 @@
#include <sys/types.h>
#include <unistd.h>
#include <syslog.h>
-#include "udev.h"
-#ifdef DEBUG
+#include "logging.h"
+
static int logging_init = 0;
static unsigned char udev_logname[42];
@@ -54,5 +54,3 @@
va_end(args);
return 1;
}
-
-#endif
diff -Nru a/logging.h b/logging.h
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/logging.h Thu Jan 15 15:22:25 2004
@@ -0,0 +1,60 @@
+/*
+ * udev.h
+ *
+ * Userspace devfs
+ *
+ * Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
+ * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef LOGGING_H
+#define LOGGING_H
+
+#ifdef LOG
+#include <syslog.h>
+#define info(format, arg...) \
+ do { \
+ log_message (LOG_INFO , format , ## arg); \
+ } while (0)
+#else
+ #define info(format, arg...) do { } while (0)
+#endif
+
+#ifdef DEBUG
+#define dbg(format, arg...) \
+ do { \
+ log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
+ } while (0)
+#else
+ #define dbg(format, arg...) do { } while (0)
+#endif
+
+/* Parser needs it's own debugging statement, we usually don't care about this at all */
+#ifdef DEBUG_PARSER
+#define dbg_parse(format, arg...) \
+ do { \
+ log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
+ } while (0)
+#else
+ #define dbg_parse(format, arg...) do { } while (0)
+#endif
+
+
+extern int log_message (int level, const char *format, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+#endif
diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c Thu Jan 15 15:22:25 2004
+++ b/namedev.c Thu Jan 15 15:22:25 2004
@@ -36,6 +36,7 @@
#include "list.h"
#include "udev.h"
#include "udev_version.h"
+#include "logging.h"
#include "namedev.h"
#include "libsysfs/libsysfs.h"
#include "klibc_fixups.h"
@@ -295,12 +296,12 @@
/* sleep to give the kernel a chance to create the file */
sleep(1);
}
- dbg("Timed out waiting for '%s' file, continuing on anyway...", b->file);
+ dbg("timed out waiting for '%s' file, continuing on anyway...", b->file);
goto exit;
}
b++;
}
- dbg("Did not find bus type '%s' on list of bus_id_files, contact greg@kroah.com", sysfs_device->bus);
+ dbg("did not find bus type '%s' on list of bus_id_files, contact greg@kroah.com", sysfs_device->bus);
exit:
return; /* here to prevent compiler warning... */
}
@@ -544,7 +545,7 @@
if (sysfs_device != NULL)
goto device_found;
}
- dbg("Timed out waiting for device symlink, continuing on anyway...");
+ dbg("timed out waiting for device symlink, continuing on anyway...");
device_found:
/* We have another issue with just the wait above - the sysfs part of
@@ -569,10 +570,10 @@
if (sysfs_device->bus[0] != '\0')
goto bus_found;
}
- dbg("Timed out waiting to find the device bus, continuing on anyway\n");
+ dbg("timed out waiting to find the device bus, continuing on anyway");
goto exit;
bus_found:
- dbg("Device %s is registered with bus %s\n",
+ dbg("device %s is registered with bus '%s'",
sysfs_device->name, sysfs_device->bus);
}
exit:
@@ -704,7 +705,8 @@
}
/* Yup, this rule belongs to us! */
- dbg("found matching rule, '%s' becomes '%s'", dev->kernel, dev->name);
+ info("configured rule in '%s' at line %i applied, '%s' becomes '%s'",
+ udev_rules_filename, dev->config_line, udev->kernel_name, dev->name);
strfieldcpy(udev->name, dev->name);
strfieldcpy(udev->symlink, dev->symlink);
goto found;
diff -Nru a/namedev.h b/namedev.h
--- a/namedev.h Thu Jan 15 15:22:25 2004
+++ b/namedev.h Thu Jan 15 15:22:25 2004
@@ -65,6 +65,7 @@
char name[NAME_SIZE];
char symlink[NAME_SIZE];
struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
+ int config_line;
};
struct perm_device {
diff -Nru a/namedev_parse.c b/namedev_parse.c
--- a/namedev_parse.c Thu Jan 15 15:22:25 2004
+++ b/namedev_parse.c Thu Jan 15 15:22:25 2004
@@ -36,6 +36,7 @@
#include <errno.h>
#include "udev.h"
+#include "logging.h"
#include "namedev.h"
static int add_config_dev(struct config_device *new_dev)
@@ -249,6 +250,7 @@
goto error;
}
+ dev.config_line = lineno;
retval = add_config_dev(&dev);
if (retval) {
dbg("add_config_dev returned with error %d", retval);
diff -Nru a/udev-add.c b/udev-add.c
--- a/udev-add.c Thu Jan 15 15:22:25 2004
+++ b/udev-add.c Thu Jan 15 15:22:25 2004
@@ -37,6 +37,7 @@
#include "udev.h"
#include "udev_version.h"
#include "udev_dbus.h"
+#include "logging.h"
#include "namedev.h"
#include "udevdb.h"
#include "libsysfs/libsysfs.h"
@@ -141,6 +142,7 @@
if (strrchr(dev->name, '/'))
create_path(filename);
+ info("creating device node '%s'", filename);
dbg("mknod(%s, %#o, %u, %u)", filename, dev->mode, dev->major, dev->minor);
retval = mknod(filename, dev->mode, res);
if (retval)
diff -Nru a/udev-remove.c b/udev-remove.c
--- a/udev-remove.c Thu Jan 15 15:22:25 2004
+++ b/udev-remove.c Thu Jan 15 15:22:25 2004
@@ -31,6 +31,7 @@
#include "udev.h"
#include "udev_version.h"
#include "udev_dbus.h"
+#include "logging.h"
#include "namedev.h"
#include "udevdb.h"
#include "libsysfs/libsysfs.h"
@@ -73,7 +74,7 @@
strncpy(filename, udev_root, sizeof(filename));
strncat(filename, dev->name, sizeof(filename));
- dbg("unlinking node '%s'", filename);
+ info("removing device node '%s'", filename);
retval = unlink(filename);
if (retval) {
dbg("unlink(%s) failed with error '%s'",
diff -Nru a/udev.c b/udev.c
--- a/udev.c Thu Jan 15 15:22:25 2004
+++ b/udev.c Thu Jan 15 15:22:25 2004
@@ -34,6 +34,7 @@
#include "udev.h"
#include "udev_version.h"
#include "udev_dbus.h"
+#include "logging.h"
#include "namedev.h"
#include "udevdb.h"
#include "libsysfs/libsysfs.h"
diff -Nru a/udev.h b/udev.h
--- a/udev.h Thu Jan 15 15:22:25 2004
+++ b/udev.h Thu Jan 15 15:22:25 2004
@@ -26,30 +26,6 @@
#include "libsysfs/libsysfs.h"
#include <sys/param.h>
-#ifdef DEBUG
-#include <syslog.h>
-#define dbg(format, arg...) \
- do { \
- log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
- } while (0)
-#else
- #define dbg(format, arg...) do { } while (0)
-#endif
-
-/* Parser needs it's own debugging statement, we usually don't care about this at all */
-#ifdef DEBUG_PARSER
-#define dbg_parse(format, arg...) \
- do { \
- log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
- } while (0)
-#else
- #define dbg_parse(format, arg...) do { } while (0)
-#endif
-
-
-extern int log_message (int level, const char *format, ...)
- __attribute__ ((format (printf, 2, 3)));
-
#define COMMENT_CHARACTER '#'
#define NAME_SIZE 100
@@ -71,7 +47,6 @@
unsigned char program_result[NAME_SIZE];
unsigned char kernel_number[NAME_SIZE];
unsigned char kernel_name[NAME_SIZE];
-
};
#define strfieldcpy(to, from) \
diff -Nru a/udev_config.c b/udev_config.c
--- a/udev_config.c Thu Jan 15 15:22:25 2004
+++ b/udev_config.c Thu Jan 15 15:22:25 2004
@@ -34,6 +34,7 @@
#include "udev.h"
#include "udev_version.h"
+#include "logging.h"
#include "namedev.h"
#include "libsysfs/libsysfs.h"
diff -Nru a/udevdb.c b/udevdb.c
--- a/udevdb.c Thu Jan 15 15:22:25 2004
+++ b/udevdb.c Thu Jan 15 15:22:25 2004
@@ -35,6 +35,7 @@
#include "udev_version.h"
#include "udev.h"
+#include "logging.h"
#include "namedev.h"
#include "udevdb.h"
#include "tdb/tdb.h"
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (5 preceding siblings ...)
2004-01-15 14:32 ` Kay Sievers
@ 2004-01-15 22:40 ` Greg KH
2004-01-16 2:25 ` Nuno Silva
` (6 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-15 22:40 UTC (permalink / raw)
To: linux-hotplug
On Thu, Jan 15, 2004 at 03:32:26PM +0100, Kay Sievers wrote:
> On Thu, Jan 15, 2004 at 05:14:16AM +0100, Kay Sievers wrote:
> > On Wed, Jan 14, 2004 at 01:10:43PM -0800, Greg KH wrote:
> > > 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... :)
> >
> > How about this in the syslog after connect/disconnect?
> >
> > Jan 15 05:07:45 pim udev[28007]: configured rule in '/etc/udev/udev.rules' at line 17 applied, 'video*' becomes 'video/webcam%n'
> > Jan 15 05:07:45 pim udev[28007]: creating device node '/udev/video/webcam0'
> > Jan 15 05:07:47 pim udev[28015]: removing device node '/udev/video/webcam0'
>
> Here is a slightly better version. I've created a logging.h file and
> moved the debug macros from udev.h in there.
Nice, I've applied this, and made a few tweaks to the build stuff to
make it more like the other build options (USE_LOG instead of just LOG).
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (6 preceding siblings ...)
2004-01-15 22:40 ` Greg KH
@ 2004-01-16 2:25 ` Nuno Silva
2004-01-16 3:24 ` Kay Sievers
` (5 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Nuno Silva @ 2004-01-16 2:25 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
[CC to lkml removed and I'm not in linux-hotplug-devl]
Hi!
Greg KH wrote:
>
> Hm, I just took Kay's patch instead. Care to make up a patch for this
> based off of it?
>
You did the right thing :-) Now it's simplier and is almost a one-liner.
(Anyway, still missing the SYSFS_* details).
Sample output:
Jan 16 01:53:42 puma udev[18505]: New device! Metrics: BUS='scsi',
ID='71:0:0:0', KERNEL='sr0'
Jan 16 01:53:42 puma udev[18505]: name, 'sr0' is going to have owner='',
group='', mode = 0600
Jan 16 01:53:42 puma udev[18505]: creating device node '/udev/sr0'
...
Jan 16 01:57:07 puma udev[18779]: New device! Metrics: BUS='scsi',
ID='72:0:0:0', KERNEL='sda'
Jan 16 01:57:07 puma udev[18779]: name, 'sda' is going to have owner='',
group='', mode = 0600
Jan 16 01:57:07 puma udev[18779]: creating device node '/udev/sda'
...
Jan 16 01:57:18 puma udev[18791]: New device! Metrics: BUS='usb',
ID='5-1:1.1', KERNEL='lp0'
Jan 16 01:57:18 puma udev[18791]: name, 'lp0' is going to have owner='',
group='', mode = 0600
Jan 16 01:57:18 puma udev[18791]: creating device node '/udev/lp0'
I think this output is nice, easy to read and /etc/udev/rules oriented
so, sooner or later, people will find it "natural".
Thanks,
Nuno Silva
[-- Attachment #2: udev-bk-details.diff --]
[-- Type: text/plain, Size: 730 bytes --]
diff -Naur udev/namedev.c udev-report/namedev.c
--- udev/namedev.c 2004-01-16 01:59:03.000000000 +0000
+++ udev-report/namedev.c 2004-01-16 01:53:10.000000000 +0000
@@ -723,6 +723,13 @@
udev->owner[0] = 0x00;
udev->group[0] = 0x00;
}
+ /* notify syslog and report some of the configuration: */
+ /* FIXME: add SYSFS_* nodes, too */
+ info("New device! Metrics: BUS='%s', ID='%s', KERNEL='%s'",
+ sysfs_device->bus, sysfs_device->bus_id, class_dev->name);
+ info("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);
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (7 preceding siblings ...)
2004-01-16 2:25 ` Nuno Silva
@ 2004-01-16 3:24 ` Kay Sievers
2004-01-16 3:45 ` Nuno Silva
` (4 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Kay Sievers @ 2004-01-16 3:24 UTC (permalink / raw)
To: linux-hotplug
On Fri, Jan 16, 2004 at 02:25:08AM +0000, Nuno Silva wrote:
> Greg KH wrote:
> >
> >Hm, I just took Kay's patch instead. Care to make up a patch for this
> >based off of it?
> >
>
> You did the right thing :-) Now it's simplier and is almost a one-liner.
> (Anyway, still missing the SYSFS_* details).
>
> Sample output:
> Jan 16 01:53:42 puma udev[18505]: New device! Metrics: BUS='scsi',
> ID='71:0:0:0', KERNEL='sr0'
> Jan 16 01:53:42 puma udev[18505]: name, 'sr0' is going to have owner='',
> group='', mode = 0600
> Jan 16 01:53:42 puma udev[18505]: creating device node '/udev/sr0'
>
> I think this output is nice, easy to read and /etc/udev/rules oriented
> so, sooner or later, people will find it "natural".
>
> + info("New device! Metrics: BUS='%s', ID='%s', KERNEL='%s'",
> + sysfs_device->bus, sysfs_device->bus_id, class_dev->name);
Huh, what if sysfs_device = NULL ?
And why print it, if we apply a configured rule to a known device?
Kay
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (8 preceding siblings ...)
2004-01-16 3:24 ` Kay Sievers
@ 2004-01-16 3:45 ` Nuno Silva
2004-01-19 20:29 ` Olaf Hering
` (3 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Nuno Silva @ 2004-01-16 3:45 UTC (permalink / raw)
To: linux-hotplug
Hi!
Kay Sievers wrote:
>>
>>+ info("New device! Metrics: BUS='%s', ID='%s', KERNEL='%s'",
>>+ sysfs_device->bus, sysfs_device->bus_id, class_dev->name);
>
>
> Huh, what if sysfs_device = NULL ?
This is only to show what I'd like to see.
That combined with the 15 mins that I looked at it and my lack of
understandaing about sysfslib/udev can be dangerous :-)
But, (bad) implementations apart, don't you think it's a good ideia to
report information in this format?
> And why print it, if we apply a configured rule to a known device?
>
I don't have rules for any of those devices. They were caught by the
catch-all rule.
Regards,
Nuno Silva
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (9 preceding siblings ...)
2004-01-16 3:45 ` Nuno Silva
@ 2004-01-19 20:29 ` Olaf Hering
2004-01-19 20:40 ` Greg KH
` (2 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Olaf Hering @ 2004-01-19 20:29 UTC (permalink / raw)
To: linux-hotplug
On Thu, Jan 15, Kay Sievers wrote:
> +++ b/logging.h Thu Jan 15 15:22:25 2004
> +#ifdef LOG
> +#include <syslog.h>
> +#ifdef DEBUG
> +#define dbg(format, arg...) \
> + do { \
> + log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
This breaks with:
make udevdir=/dev USE_LOGúlse USE_KLIBC=true DEBUG=true STRIP=/bin/true -j
syslog.h does not depend on -DLOG
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (10 preceding siblings ...)
2004-01-19 20:29 ` Olaf Hering
@ 2004-01-19 20:40 ` Greg KH
2004-01-19 20:44 ` Olaf Hering
2004-01-19 20:50 ` Greg KH
13 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-19 20:40 UTC (permalink / raw)
To: linux-hotplug
On Mon, Jan 19, 2004 at 09:29:00PM +0100, Olaf Hering wrote:
> On Thu, Jan 15, Kay Sievers wrote:
>
> > +++ b/logging.h Thu Jan 15 15:22:25 2004
>
> > +#ifdef LOG
> > +#include <syslog.h>
>
> > +#ifdef DEBUG
> > +#define dbg(format, arg...) \
> > + do { \
> > + log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
>
> This breaks with:
>
> make udevdir=/dev USE_LOGúlse USE_KLIBC=true DEBUG=true STRIP=/bin/true -j
>
> syslog.h does not depend on -DLOG
Ick. This patch should fix this problem.
If you make USE_LOGúlse, no debug messages will be sent out.
thanks,
greg k-h
=== logging.h 1.2 vs edited ==--- 1.2/logging.h Thu Jan 15 14:00:58 2004
+++ edited/logging.h Mon Jan 19 12:37:42 2004
@@ -24,35 +24,37 @@
#ifndef LOGGING_H
#define LOGGING_H
+#define info(format, arg...) do { } while (0)
+#define dbg(format, arg...) do { } while (0)
+#define dbg_parse(format, arg...) do { } while (0)
+
#ifdef LOG
#include <syslog.h>
+
+#undef info
#define info(format, arg...) \
do { \
log_message (LOG_INFO , format , ## arg); \
} while (0)
-#else
- #define info(format, arg...) do { } while (0)
-#endif
#ifdef DEBUG
+#undef dbg
#define dbg(format, arg...) \
do { \
log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
} while (0)
-#else
- #define dbg(format, arg...) do { } while (0)
#endif
/* Parser needs it's own debugging statement, we usually don't care about this at all */
#ifdef DEBUG_PARSER
+#undef dbg_parse
#define dbg_parse(format, arg...) \
do { \
log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
} while (0)
-#else
- #define dbg_parse(format, arg...) do { } while (0)
#endif
+#endif /* LOG */
extern int log_message (int level, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (11 preceding siblings ...)
2004-01-19 20:40 ` Greg KH
@ 2004-01-19 20:44 ` Olaf Hering
2004-01-19 20:50 ` Greg KH
13 siblings, 0 replies; 25+ messages in thread
From: Olaf Hering @ 2004-01-19 20:44 UTC (permalink / raw)
To: linux-hotplug
On Mon, Jan 19, Greg KH wrote:
> On Mon, Jan 19, 2004 at 09:29:00PM +0100, Olaf Hering wrote:
> > On Thu, Jan 15, Kay Sievers wrote:
> >
> > > +++ b/logging.h Thu Jan 15 15:22:25 2004
> >
> > > +#ifdef LOG
> > > +#include <syslog.h>
> >
> > > +#ifdef DEBUG
> > > +#define dbg(format, arg...) \
> > > + do { \
> > > + log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
> >
> > This breaks with:
> >
> > make udevdir=/dev USE_LOGúlse USE_KLIBC=true DEBUG=true STRIP=/bin/true -j
> >
> > syslog.h does not depend on -DLOG
>
> Ick. This patch should fix this problem.
>
> If you make USE_LOGúlse, no debug messages will be sent out.
Is this correct? LOG_DEBUG is defined in syslog.h, this patch is
probably better.
--- udev.bk/logging.h~ 2004-01-15 22:00:58.000000000 +0000
+++ udev.bk/logging.h 2004-01-19 20:31:46.000000000 +0000
@@ -24,8 +24,9 @@
#ifndef LOGGING_H
#define LOGGING_H
-#ifdef LOG
#include <syslog.h>
+
+#ifdef LOG
#define info(format, arg...) \
do { \
log_message (LOG_INFO , format , ## arg); \
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [ANNOUNCE] udev 013 release
2004-01-13 23:52 [ANNOUNCE] udev 013 release Greg KH
` (12 preceding siblings ...)
2004-01-19 20:44 ` Olaf Hering
@ 2004-01-19 20:50 ` Greg KH
13 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2004-01-19 20:50 UTC (permalink / raw)
To: linux-hotplug
On Mon, Jan 19, 2004 at 09:44:15PM +0100, Olaf Hering wrote:
> On Mon, Jan 19, Greg KH wrote:
>
> > On Mon, Jan 19, 2004 at 09:29:00PM +0100, Olaf Hering wrote:
> > > On Thu, Jan 15, Kay Sievers wrote:
> > >
> > > > +++ b/logging.h Thu Jan 15 15:22:25 2004
> > >
> > > > +#ifdef LOG
> > > > +#include <syslog.h>
> > >
> > > > +#ifdef DEBUG
> > > > +#define dbg(format, arg...) \
> > > > + do { \
> > > > + log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
> > >
> > > This breaks with:
> > >
> > > make udevdir=/dev USE_LOGúlse USE_KLIBC=true DEBUG=true STRIP=/bin/true -j
> > >
> > > syslog.h does not depend on -DLOG
> >
> > Ick. This patch should fix this problem.
> >
> > If you make USE_LOGúlse, no debug messages will be sent out.
>
> Is this correct? LOG_DEBUG is defined in syslog.h, this patch is
> probably better.
Hm, but my patch will fix the problem when DEBUGúlse, yet someone goes
and enables DEBUG_PARSER on their own. That always annoys me :)
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
^ permalink raw reply [flat|nested] 25+ messages in thread