chiark / gitweb /
kay.sievers@vrfy.org [Sat, 24 Jan 2004 05:25:17 +0000 (21:25 -0800)]
[PATCH] udev - next round of udev event order daemon
Here is the next round of udevd/udevsend:
udevsend - If the IPC message we send is not catched by a receiver we fork
the udevd daemon to process this and the following events
udevd - We reorder the events we receive and execute our current udev for
every event. If one or more events are missing, we wait
10 seconds and then go ahead in the queue.
If the queue is empty and we don't receive any event for the next
30 seconds, the daemon exits.
The next incoming event will fork the daemon again.
config - The path's to the executable are specified in udevd.h
Now they are pointing to the current directory only.
I don't like daemons hiding secrets (and mem leaks :)) inside,
so I want to try this model. It should be enough logic to get all possible
hotplug events executed in the right order.
If no event, then no daemon! So everybody should be happy :)
Here we see:
1. the daemon fork,
2. the udev work,
3. the 10 sec timeout and the skipped events,
4. the udev work,
...,
5. and the 30 sec timeout and exit.
EVENTS:
pim:/home/kay/src/udev.kay# test/udevd_test.sh
pim:/home/kay/src/udev.kay# SEQNUM=15 ./udevsend block
pim:/home/kay/src/udev.kay# SEQNUM=16 ./udevsend block
pim:/home/kay/src/udev.kay# SEQNUM=17 ./udevsend block
pim:/home/kay/src/udev.kay# SEQNUM=18 ./udevsend block
pim:/home/kay/src/udev.kay# SEQNUM=20 ./udevsend block
pim:/home/kay/src/udev.kay# SEQNUM=21 ./udevsend block
LOG:
Jan 23 15:35:35 pim udev[11795]: message is still in the ipc queue, starting daemon...
Jan 23 15:35:35 pim udev[11799]: configured rule in '/etc/udev/udev.rules' at line 19 applied, 'sda' becomes '%k-flash'
Jan 23 15:35:35 pim udev[11799]: creating device node '/udev/sda-flash'
Jan 23 15:35:35 pim udev[11800]: creating device node '/udev/sdb'
Jan 23 15:35:35 pim udev[11804]: creating device node '/udev/sdc'
Jan 23 15:35:35 pim udev[11805]: removing device node '/udev/sda-flash'
Jan 23 15:35:35 pim udev[11808]: removing device node '/udev/sdb'
Jan 23 15:35:35 pim udev[11809]: removing device node '/udev/sdc'
Jan 23 15:35:45 pim udev[11797]: timeout reached, skip events 7 - 7
Jan 23 15:35:45 pim udev[11811]: creating device node '/udev/sdb'
Jan 23 15:35:45 pim udev[11812]: creating device node '/udev/sdc'
Jan 23 15:36:01 pim udev[11797]: timeout reached, skip events 10 - 14
Jan 23 15:36:01 pim udev[11814]: creating device node '/udev/sdc'
Jan 23 15:36:04 pim udev[11816]: creating device node '/udev/sdc'
Jan 23 15:36:12 pim udev[11818]: creating device node '/udev/sdc'
Jan 23 15:36:16 pim udev[11820]: creating device node '/udev/sdc'
Jan 23 15:36:38 pim udev[11797]: timeout reached, skip events 19 - 19
Jan 23 15:36:38 pim udev[11823]: creating device node '/udev/sdc'
Jan 23 15:36:38 pim udev[11824]: creating device node '/udev/sdc'
Jan 23 15:37:08 pim udev[11797]: we have nothing to do, so daemon exits...
kay.sievers@vrfy.org [Fri, 23 Jan 2004 12:01:09 +0000 (04:01 -0800)]
[PATCH] fix udevd exec
Sorry, some code is missing.
Here is a fix to make the exec functional.
kay.sievers@vrfy.org [Fri, 23 Jan 2004 11:01:02 +0000 (03:01 -0800)]
[PATCH] udev - udevinfo with device chain walk
udevinfo is now capable to print "all" attributes along the device chain
of a sysfs device. Just like udev itself it walks the chain upwards and
prints all usable attributes in the udev key format.
So it should be easy to find unique attributes to compose a rule.
All multiline attribute values and values containing non printable
characters are skipped now. I hope nothing useful gets lost with this :)
NOTE:
The BUS value corresponding with the attributes is printed for every
device. Don't specify BUS= in a rule and mix SYSFS_attributes from
different busses, the rule can't match.
./udevinfo /sys/block/sda/sda1
device '/sys/block/sda/sda1' has major:minor 8:1
looking at class device '/sys/block/sda/sda1':
SYSFS_dev="8:1"
SYSFS_start="32"
SYSFS_size="160"
SYSFS_stat=" 0 0 0 0"
follow the class device's "device"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0/host32/32:0:0:0':
BUS="scsi"
ID="32:0:0:0"
SYSFS_detach_state="0"
SYSFS_type="0"
SYSFS_model="USB 2 HS-CF"
SYSFS_vendor="SMSC "
SYSFS_max_sectors="240"
SYSFS_device_blocked="0"
SYSFS_queue_depth="1"
SYSFS_scsi_level="3"
SYSFS_rev="1.25"
SYSFS_online="1"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0/host32':
BUS=""
ID="host32"
SYSFS_detach_state="0"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0':
BUS="usb"
ID="1-1.3:1.0"
SYSFS_detach_state="0"
SYSFS_bInterfaceNumber="00"
SYSFS_bAlternateSetting=" 0"
SYSFS_bNumEndpoints="02"
SYSFS_bInterfaceClass="08"
SYSFS_bInterfaceSubClass="06"
SYSFS_bInterfaceProtocol="50"
SYSFS_iInterface="00"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3':
BUS="usb"
ID="1-1.3"
SYSFS_detach_state="0"
SYSFS_bNumConfigurations="1"
SYSFS_bNumInterfaces=" 1"
SYSFS_bConfigurationValue="1"
SYSFS_bmAttributes="80"
SYSFS_bMaxPower=" 96mA"
SYSFS_idVendor="0424"
SYSFS_idProduct="20fc"
SYSFS_bcdDevice="0125"
SYSFS_bDeviceClass="00"
SYSFS_bDeviceSubClass="00"
SYSFS_bDeviceProtocol="00"
SYSFS_speed="12"
SYSFS_manufacturer="SMSC"
SYSFS_product="USB 2 Flash Media Device"
SYSFS_serial="
0305037000C2"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1':
BUS="usb"
ID="1-1"
SYSFS_detach_state="0"
SYSFS_bNumConfigurations="1"
SYSFS_bNumInterfaces=" 1"
SYSFS_bConfigurationValue="1"
SYSFS_bmAttributes="e0"
SYSFS_bMaxPower=" 64mA"
SYSFS_idVendor="03eb"
SYSFS_idProduct="3301"
SYSFS_bcdDevice="0300"
SYSFS_bDeviceClass="09"
SYSFS_bDeviceSubClass="00"
SYSFS_bDeviceProtocol="00"
SYSFS_speed="12"
SYSFS_product="Standard USB Hub"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1':
BUS="usb"
ID="usb1"
SYSFS_detach_state="0"
SYSFS_bNumConfigurations="1"
SYSFS_bNumInterfaces=" 1"
SYSFS_bConfigurationValue="1"
SYSFS_bmAttributes="40"
SYSFS_bMaxPower=" 0mA"
SYSFS_idVendor="0000"
SYSFS_idProduct="0000"
SYSFS_bcdDevice="0206"
SYSFS_bDeviceClass="09"
SYSFS_bDeviceSubClass="00"
SYSFS_bDeviceProtocol="00"
SYSFS_speed="12"
SYSFS_manufacturer="Linux 2.6.2-rc1-p4 uhci_hcd"
SYSFS_product="UHCI Host Controller"
SYSFS_serial="0000:00:1d.0"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0':
BUS="pci"
ID="0000:00:1d.0"
SYSFS_detach_state="0"
SYSFS_vendor="0x8086"
SYSFS_device="0x2482"
SYSFS_subsystem_vendor="0x1014"
SYSFS_subsystem_device="0x0220"
SYSFS_class="0x0c0300"
SYSFS_irq="9"
looking at the device chain at '/sys/devices/pci0000:00':
BUS=""
ID="pci0000:00"
SYSFS_detach_state="0"
greg@kroah.com [Fri, 23 Jan 2004 09:51:06 +0000 (01:51 -0800)]
[PATCH] whitespace cleanups
kay.sievers@vrfy.org [Fri, 23 Jan 2004 08:28:57 +0000 (00:28 -0800)]
[PATCH] spilt udev into pieces
On Thu, Jan 22, 2004 at 01:27:45AM +0100, Kay Sievers wrote:
> On Wed, Jan 21, 2004 at 02:38:25PM +0100, Kay Sievers wrote:
> > On Thu, Jan 15, 2004 at 01:45:10PM -0800, Greg KH wrote:
> > > On Thu, Jan 15, 2004 at 10:36:25PM +0800, Ling, Xiaofeng wrote:
> > > > Hi, Greg
> > > > I wrote a simple implementation for the two pieces
> > > > of send and receive hotplug event,
> > > > use a message queue and a list for the out of order
> > > > hotplug event. It also has a timeout timer of 3 seconds.
> > > > They are now separate program. the file nseq is the test script.
> > > > Could you have a look to see wether it is feasible?
> > > > If so, I'll continue to merge with udev.
> > >
> > > Yes, very nice start. Please continue on.
> > >
> > > One minor comment, please stick with the kernel coding style when you
> > > are writing new code for udev.
> >
> > I took the code from Xiaofeng, cleaned the whitespace, renamed some bits,
> > tweaked the debugging, added the udev exec and created a patch for the current tree.
> >
> > It seems functional now, by simply executing our current udev (dirty hack).
> > It reorders the incoming events and if one is missing it delays the
> > execution of the following ones up to a maximum of 10 seconds.
> >
> > Test script is included, but you can't mix hotplug sequence numbers and
> > test script numbers, it will result in waiting for the missing numbers :)
>
> Hey, nobody want's to play with me?
> So here I'm chatting with myself :)
>
> This is the next version with signal handling for resetting the expected
> signal number. I changed the behaviour of the timeout to skip all
> missing events at once and to proceed with the next event in the queue.
>
> So it's now possible to use the test script at any time, cause it resets
> the daemon, if real hotplug event coming in later all missing nimbers will
> be skipped after a timeout of 10 seconds and the queued events are applied.
Here is the next updated updated version to apply to the lastet udev.
I've added infrastructure for getting the state of the IPC queue in the
sender and set the program to exec by the daemon. Also the magic key id
is replaced by the usual key generation by path/nr.
It looks promising, I use it on my machine and my 4in1 USB-flash-reader
connect/disconnect emits the events "randomly" but udevd is able to
reorder it and calls our normal udev in the right order.
greg@kroah.com [Fri, 23 Jan 2004 08:22:17 +0000 (00:22 -0800)]
[PATCH] remove TODO item about BUS value, as it is now done.
greg@kroah.com [Fri, 23 Jan 2004 08:21:13 +0000 (00:21 -0800)]
[PATCH] add support for figuring out which device on the sysfs "chain" the rule applies to.
This should fix one of the more annoying things to me about udev, and
gets rid of a TODO item.
greg@kroah.com [Fri, 23 Jan 2004 05:04:54 +0000 (21:04 -0800)]
[PATCH] 014_bk mark
greg@kroah.com [Thu, 22 Jan 2004 09:06:18 +0000 (01:06 -0800)]
[PATCH] 014 release
greg@kroah.com [Thu, 22 Jan 2004 08:54:52 +0000 (00:54 -0800)]
[PATCH] misc code cleanups.
christophe.varoqui@free.fr [Thu, 22 Jan 2004 08:16:28 +0000 (00:16 -0800)]
[PATCH] udev-013/extras/multipath update
incremental to 0.0.13,
* update the DM target synthax to the 2.6.0-udm5 style
* update the changelog and the doc to reflect minimal requirements
greg@kroah.com [Tue, 20 Jan 2004 04:41:14 +0000 (20:41 -0800)]
[PATCH] fixup logging.h to handle different logging options properly.
Thanks to Olaf Hering <olh@suse.de> for the error message.
kay.sievers@vrfy.org [Tue, 20 Jan 2004 03:46:26 +0000 (19:46 -0800)]
[PATCH] udev - program to query all device attributes to build a rule
On Sun, Jan 18, 2004 at 07:30:50AM +0100, Kay Sievers wrote:
> Hi,
> here is a small program to query all attributes of a device and
> print these in the udev key format. It may help to get the keys to
> define a rule.
Fixed a typo - the sysfs_device is right now.
USB FLash Reader:
kay@pim:~/src/udev.kay$ extras/udevinfo/udevinfo /sys/block/sda/sda1
device '/sys/block/sda/sda1' has major:minor 8:1
looking at class device '/sys/block/sda/sda1':
SYSFS_dev="8:1"
SYSFS_start="32"
SYSFS_size="160"
SYSFS_stat=" 0 0 0 0"
follow class device's "device" link '/sys/block/sda':
BUS="scsi"
ID="57:0:0:0"
SYSFS_detach_state="0"
SYSFS_type="0"
SYSFS_device_blocked="0"
SYSFS_queue_depth="1"
SYSFS_scsi_level="3"
SYSFS_vendor="SMSC "
SYSFS_model="USB 2 HS-CF"
SYSFS_rev="1.25"
SYSFS_online="1"
kay.sievers@vrfy.org [Tue, 20 Jan 2004 03:44:24 +0000 (19:44 -0800)]
[PATCH] set default owner/group in db - update
I've edited the man page today, so this is alreay included :)
Also a few more trivials:
o added the defaults to udev.conf.in
o removed class_dev from get_default_mode(), to match with Hanna's
o changed size of mode_str to MODE_SIZE
o changed a few char compares from from 0x00 to '\0'
hannal@us.ibm.com [Tue, 20 Jan 2004 03:42:42 +0000 (19:42 -0800)]
[PATCH] set default owner/group in db.
This patch fixes a bug where the udev database stored empty strings
for Owner and Group if they were default. This patch stores the default
value into the database if not set otherwise. See example output:
crw------- 1 root root 4, 65 Jan 16 11:13 ttyS1
P: /class/tty/ttyS1
N: ttyS1
S:
O: root
G: root
This is a bit of a hack. However, until udev supports setting the
o/g values they will be root/root anyway so the database might as
well reflect the truth instead of empty strings.
kay.sievers@vrfy.org [Tue, 20 Jan 2004 03:40:32 +0000 (19:40 -0800)]
[PATCH] udev - reverse user query options
Here we get the ability to query with the name of the node instead of
the device path. It uses a linear search over the whole database.
kay@pim:~/src/udev.kay$ ./udev -q path -n video/webcam0
/class/video4linux/video0
New version, with better function return codes for error handling.
kay.sievers@vrfy.org [Tue, 20 Jan 2004 03:39:28 +0000 (19:39 -0800)]
[PATCH] udev - kill %D from udev-test.pl
Kill the two tests with %D.
patmans@us.ibm.com [Sat, 17 Jan 2004 06:03:50 +0000 (22:03 -0800)]
[PATCH] update udev scsi_id to scsi_id 0.3
hannal@us.ibm.com [Fri, 16 Jan 2004 08:22:56 +0000 (00:22 -0800)]
[PATCH] small cut n paste error fix
greg@kroah.com [Fri, 16 Jan 2004 06:00:58 +0000 (22:00 -0800)]
[PATCH] clean up the logging patch a bit to make the option more like the other options.
Also documented it and added it to the .spec file.
kay.sievers@vrfy.org [Fri, 16 Jan 2004 05:53:20 +0000 (21:53 -0800)]
[PATCH] add udev logging to info log
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
flamingice@sourmilk.net [Fri, 16 Jan 2004 05:49:53 +0000 (21:49 -0800)]
[PATCH] minor patch for devfs rules
I've attached a patch that adds a few rules to udev.rules.devfs, making it
look a little more like devfs on my system. (I have the sysfs patches from
2.6.1-rc1-mm2) I added rules for oss, misc, floppy, and input devices. The
oss rules look like trouble with a wildcard at the end of each name, but I'm
not sure how I can make it any better.
Devfs has a bunch of other devices in the floppy directory for floppies
formatted in unusual ways, but I don't see them in udev. Not that I ever used
them, since they're usually automatically detected.
greg@kroah.com [Fri, 16 Jan 2004 05:42:59 +0000 (21:42 -0800)]
[PATCH] remove the %D modifier as it is not longer needed.
greg@kroah.com [Fri, 16 Jan 2004 05:18:21 +0000 (21:18 -0800)]
[PATCH] remove unneeded keyboard rule.
greg@kroah.com [Thu, 15 Jan 2004 06:55:24 +0000 (22:55 -0800)]
[PATCH] add usb_host and pci_bus to the class blacklist.
ananthmg@rediffmail.com [Thu, 15 Jan 2004 06:21:38 +0000 (22:21 -0800)]
[PATCH] libsysfs update for refresh + namedev.c changes
Please find inlined a patch which contains updates to libsysfs
(pre-release) for refresh and also changes to namedev.c to take
advantage of it.
greg@kroah.com [Thu, 15 Jan 2004 05:38:36 +0000 (21:38 -0800)]
[PATCH] added input device rules to udev.rules and udev.rules.devfs
kay.sievers@vrfy.org [Thu, 15 Jan 2004 02:18:12 +0000 (18:18 -0800)]
[PATCH] udev - mention format string escape char in man page
If we want to pass any '%' down to a program, you need to ecape it by '%%',
otherwise we try to expand it with our own format char list.
greg@kroah.com [Thu, 15 Jan 2004 02:16:32 +0000 (18:16 -0800)]
[PATCH] 013_bk mark
greg@kroah.com [Wed, 14 Jan 2004 06:59:11 +0000 (22:59 -0800)]
[PATCH] v013 release
greg@kroah.com [Wed, 14 Jan 2004 06:55:21 +0000 (22:55 -0800)]
[PATCH] update TODO with some new, small items.
kay.sievers@vrfy.org [Wed, 14 Jan 2004 02:48:33 +0000 (18:48 -0800)]
[PATCH] fix klibc with printf() and gcc
On Mon, Jan 12, 2004 at 05:04:45PM -0800, Greg KH wrote:
> Very nice, applied. But I did have to make one small change to get the
> code to build properly with klibc:
>
> > +static void print_record(char *path, struct udevice *dev)
> > +{
> > + printf("P: %s\n", path);
> > + printf("N: %s\n", dev->name);
> > + printf("S: %s\n", dev->symlink);
> > + printf("O: %s\n", dev->owner);
> > + printf("G: %s\n", dev->group);
> > + printf("\n");
> > +}
>
> Turns out that gcc likes to convert single character printf() calls to
> putchar() which is only defined in klibc as a macro :(
Just for information. This seems to fix the gcc with klibc :)
greg@kroah.com [Wed, 14 Jan 2004 02:47:17 +0000 (18:47 -0800)]
[PATCH] Cset exclude: greg@kroah.com|ChangeSet|
20040113010256|48515
kay.sievers@vrfy.org [Wed, 14 Jan 2004 02:34:38 +0000 (18:34 -0800)]
[PATCH] udev - small script optimization
Optimize the scripts reflecting the now more powerful rule logic,
cause we can combine all known fields now in any order:
The ide-devfs.sh is only executed if the kernel name matches with 'hd*':
BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%1c %2c"
The name_cdrom.pl is only executed for ide and scsi devices, but not for a partition.
It exits with nonzero to skip the rule if the CD is not found:
KERNEL="[hs]d[a-z]", PROGRAM="name_cdrom.pl %M %m", NAME="%1c", SYMLINK="cdrom"
kay.sievers@vrfy.org [Wed, 14 Jan 2004 02:34:33 +0000 (18:34 -0800)]
[PATCH] udev - introduce format escape char
This patch adds a '%' to the format char list, so that a external
program may called with a non expanded '%' like:
PROGRAM="/bin/date +%%s"
Olaf Hering asked for the feature.
A tricky test is also added :)
kay.sievers@vrfy.org [Wed, 14 Jan 2004 02:31:20 +0000 (18:31 -0800)]
[PATCH] udev - more CALLOUT is PROGRAM now
On Tue, Jan 13, 2004 at 02:45:17AM +0100, Kay Sievers wrote:
> replace CALLOUT by PROGRAM and fix old rule format
One is missing.
kay.sievers@vrfy.org [Wed, 14 Jan 2004 02:31:18 +0000 (18:31 -0800)]
[PATCH] udev - CALLOUT is PROGRAM now
replace CALLOUT by PROGRAM and fix old rule format
greg@kroah.com [Tue, 13 Jan 2004 09:49:45 +0000 (01:49 -0800)]
[PATCH] update the README in a few places.
greg@kroah.com [Tue, 13 Jan 2004 09:36:56 +0000 (01:36 -0800)]
[PATCH] fix -d typo in the manpage update
kay.sievers@vrfy.org [Tue, 13 Jan 2004 09:35:55 +0000 (01:35 -0800)]
[PATCH] update documentation for new config file format
Here is the man page update after my udev-weekend :)
greg@kroah.com [Tue, 13 Jan 2004 09:02:56 +0000 (01:02 -0800)]
[PATCH] Fix stupid gcc "optimization" of 1 character printk() calls.... Ick...
kay.sievers@vrfy.org [Tue, 13 Jan 2004 09:01:19 +0000 (01:01 -0800)]
[PATCH] more advanced user query options
Here is the '-h' and a '-d' to dump the whole database:
kay@pim:~/src/udev.kay$ ./udev -d
P: /block/hdb/hdb1
N: hdb1
S:
O:
G:
P: /class/video4linux/video0
N: video/webcam0
S: camera0 kamera0
O: 500
G: 500
P: /block/hdc
N: hdc
S:
O:
G:
kay.sievers@vrfy.org [Tue, 13 Jan 2004 08:51:44 +0000 (00:51 -0800)]
[PATCH] udev - simple debug tweak
change the empty debug string:
Jan 13 00:55:42 pim udev[2849]: namedev_name_device: found matching rule, 'video*' becomes ''
to something useful:
Jan 13 01:00:23 pim udev[3234]: namedev_name_device: found matching rule, 'video*' becomes 'video/webcam%n'
greg@kroah.com [Tue, 13 Jan 2004 07:45:30 +0000 (23:45 -0800)]
[PATCH] oops, forgot to fix up the PROGRAM result from ID to RESULT in the config files.
elkropac@students.zcu.cz [Tue, 13 Jan 2004 07:29:57 +0000 (23:29 -0800)]
[PATCH] fix udev directory for Debian init script
there is also patch on debian init.d file, it uses variable $udev_dir
also when creating and removing symlinks
greg@kroah.com [Tue, 13 Jan 2004 07:22:52 +0000 (23:22 -0800)]
[PATCH] Add alsa device rules and a few other devfs rules.
Thanks to Libor Klepac <elkropac@students.zcu.cz> for the information
greg@kroah.com [Tue, 13 Jan 2004 07:22:13 +0000 (23:22 -0800)]
[PATCH] fix a few stale comments in namedev.c
greg@kroah.com [Tue, 13 Jan 2004 07:13:10 +0000 (23:13 -0800)]
[PATCH] convert the default rules files to the new format.
greg@kroah.com [Tue, 13 Jan 2004 07:09:20 +0000 (23:09 -0800)]
[PATCH] convert the test shell scripts to the config file format.
greg@kroah.com [Tue, 13 Jan 2004 07:09:02 +0000 (23:09 -0800)]
[PATCH] add bus test for usb-serial bus.
greg@kroah.com [Tue, 13 Jan 2004 07:08:43 +0000 (23:08 -0800)]
[PATCH] Add some helpful messages if the user uses the older config file format
Also fail a rule that we can not parse, as we can easily create incorrect rules
if we do not do this.
kay.sievers@vrfy.org [Tue, 13 Jan 2004 05:39:05 +0000 (21:39 -0800)]
[PATCH] udev - drop all methods :)
> Hi,
> as promised yesterday, here is a patch that drops the explicit methods
> given in the udev config and implement only one type of rule.
>
> A rule now consists only of a number of keys to match. All known keys
> are valid in any combination. The former configs should work with a few
> changes:
>
> o the "<METHOD>, " at the beginning of the line should be removed
>
> o the result of the externel program is matched with RESULT= instead if ID=
> the PROGRAM= key is only valid if the program exits with zero
> (just exit with nozero in a script if the rule should not match)
>
> o rules are processed in order they appear in the file, no priority
>
> o if NAME="" is given, udev is instructed to ignore this device,
> no node will be created
>
>
> EXAMPLE:
>
> # combined BUS, SYSFS and KERNEL
> BUS="usb", KERNEL="video*", SYSFS_model="Creative Labs WebCam*", NAME="test/webcam%n"
>
> # exec script only for the first ide drive (hda), all other will be skipped
> BUS="ide", KERNEL="hda*", PROGRAM="/home/kay/src/udev.kay/extras/ide-devfs.sh %k %b %n", RESULT="hd*", NAME="%1c", SYMLINK="%2c %3c"
>
>
> The udev-test.pl and test.block works fine here.
> Please adapt your config and give it a try.
>
Here is a slightly better version of the patch.
After a conversation with Patrick, we are now able to execute the PROGRAM
and also match in all following rules with the RESULT value from this exec.
EXAMPLE:
We have 7 rules with RESULT and 2 with PROGRAM.
Only the 5th rule matches with the callout result from the exec in the 4th rule.
RULES:
PROGRAM="/bin/echo abc", RESULT="no_match", NAME="web-no-2"
KERNEL="video*", RESULT="123", NAME="web-no-3"
KERNEL="video*", RESULT="123", NAME="web-no-4"
PROGRAM="/bin/echo 123", RESULT="no_match", NAME="web-no-5"
KERNEL="video*", RESULT="123", NAME="web-yes"
RESULT:
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check PROGRAM
Jan 11 23:36:52 pim udev[26050]: execute_program: executing '/bin/echo abc'
Jan 11 23:36:52 pim udev[26050]: execute_program: result is 'abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: PROGRAM returned successful
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='no_match', udev->program_result='abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for KERNEL dev->kernel='video*' class_dev->name='video0'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: KERNEL matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='123', udev->program_result='abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for KERNEL dev->kernel='video*' class_dev->name='video0'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: KERNEL matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='123', udev->program_result='abc'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check PROGRAM
Jan 11 23:36:52 pim udev[26050]: execute_program: executing '/bin/echo 123'
Jan 11 23:36:52 pim udev[26050]: execute_program: result is '123'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: PROGRAM returned successful
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='no_match', udev->program_result='123'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT is not matching
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: process rule
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for KERNEL dev->kernel='video*' class_dev->name='video0'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: KERNEL matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: check for RESULT dev->result='123', udev->program_result='123'
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: RESULT matches
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: found matching rule, 'video*' becomes ''
Jan 11 23:36:52 pim udev[26050]: namedev_name_device: name, 'web-yes' is going to have owner='', group='', mode = 0600
kay.sievers@vrfy.org [Tue, 13 Jan 2004 05:18:57 +0000 (21:18 -0800)]
[PATCH] udev - advanced user query options
This patch improves the user options for udev.
It is possible now to query for the name, the symlinks or owner/group.
If asked for the name of the node we are able to prepend the udev_root
with the -r option.
SAMPLE:
kay@pim:~/src/udev.test$ ./udev -V
udev, version 012_bk
kay@pim:~/src/udev.test$ ./udev -h
Usage: [-qrVh]
-q <name> query database for the specified value
-p <path> device path used for query
-r print udev root
-V print udev version
-h print this help text
kay@pim:~/src/udev.test$ ./udev -r
/udev/
kay@pim:~/src/udev.test$ ./udev -q name -p /class/video4linux/video0
video/webcam0
kay@pim:~/src/udev.test$ ./udev -q symlink -p /class/video4linux/video0
camera0 kamera0
kay@pim:~/src/udev.test$ ./udev -q owner -p /class/video4linux/video0
501
kay@pim:~/src/udev.test$ ./udev -r -q name -p /class/video4linux/video0
/udev/video/webcam0
kay.sievers@vrfy.org [Tue, 13 Jan 2004 05:17:22 +0000 (21:17 -0800)]
[PATCH] udev - Makefile error
I get the following error on install:
pim:/home/kay/src/udev.test# make install
sed -e "s:@udevdir@:/udev:" < etc/udev/udev.conf.in > etc/udev/udev.conf
/usr/bin/install -c -d /etc/udev/
/usr/bin/install -c -d /udev
/usr/bin/install -c -d /etc/hotplug.d/default
/usr/bin/install -c -D udev /sbin/udev
/bin/sh: -c: line 2: syntax error: unexpected end of file
make: *** [install] Error 2
eike-hotplug@sf-tec.de [Sat, 10 Jan 2004 09:19:57 +0000 (01:19 -0800)]
[PATCH] LSB init script and other stuff
I had too much time during the holidays, so I played a bit with udev. The
changes are like last time mostly on the init stuff. I'm sending you this as
a great diff which is just for comments.
What it does:
-fix a typo in Makefile
-use only one "grep -v" instead of many
-don't include BK-Files into release (shrinks the stuff to 30%!)
-add a new init script which is LSB compliant
-add some flags to choose which one to use
-use /etc/udev/udev.conf in Redhat init script as the source for the udev
directory. If this is not done then the init script may create a directory
which udev itself isn't using (I changed /udev to /Udev to avoid collisions
with /usr and ran into this)
-first check for sysfs_dir before creating udev_root (maybe someone else has
already fixed this, I saw this discussion on lkml)
greg@kroah.com [Sat, 10 Jan 2004 09:14:34 +0000 (01:14 -0800)]
[PATCH] added dri rule to the default config file.
kay.sievers@vrfy.org [Sat, 10 Jan 2004 09:10:50 +0000 (01:10 -0800)]
[PATCH] udev - make exec_callout() reusable
Here is a patch that switches exec_callout() to be reusable.
I want it to be callable in a different context.
kay.sievers@vrfy.org [Sat, 10 Jan 2004 09:05:38 +0000 (01:05 -0800)]
[PATCH] udev - exec status fix for klibc
Here is a patch to remove the ifdef's and fix klibc instead.
kay.sievers@vrfy.org [Sat, 10 Jan 2004 09:04:13 +0000 (01:04 -0800)]
[PATCH] fix Silly udev script
Hey, this is funny.
I couldn't resist to give it a try and we need a few changes:
- it's %2c otherwise nearly all my CD's are "good", but sure I also have bad ones :)
- remove the node first, cause get_cddb() dies and leaves the old one there
- remove spaces in name, cause this is our separator
/udev/
|-- The_Cure-The_Peel_Sessions
|-- cdrom -> ./The_Cure-The_Peel_Sessions
|-- hda
|-- hda1
|-- hda2
|-- hda4
greg@kroah.com [Sat, 10 Jan 2004 09:02:44 +0000 (01:02 -0800)]
[PATCH] added init.d udev script for debian
Thanks to Mathieu Segaud <matt@minas-morgul.org> for the file.
tiggi@infa.abo.fi [Sat, 10 Jan 2004 08:59:55 +0000 (00:59 -0800)]
[PATCH] udev 012 old gcc fixup
Hello,
without this patch:
wolf@duel:/tmp/ud/udev-012>gcc -v
Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/2.95.3/specs
gcc version 2.95.3
20010315 (release)
cannot compile udev.
greg@kroah.com [Sat, 10 Jan 2004 08:58:35 +0000 (00:58 -0800)]
[PATCH] add a script that tests the IGNORE rule
Can't figure out how to test for "nothing" in the udev-test.pl script framework.
christophe@saout.de [Sat, 10 Jan 2004 08:55:28 +0000 (00:55 -0800)]
[PATCH] add IGNORE rule type
On Wed, Dec 31, 2003 at 11:24:53AM -0800, Greg KH wrote:
> > There should be a possibility to tell udev not to create a device node.
> >
> > device-mapper: Usually set up by libdevmapper (or EVMS tools) which
> > creates the device node on its own under /dev/mapper/<name>.
> >
> > With udev a second device is created named /dev/dm-<minor> which is not
> > really needed.
>
> Good point. Ok, I'll agree with you. Care to make up a patch for this
> kind of feature?
Yes, I can try.
There was no way to tell not to do anything so I created one. Errors
are signalled via negative return values, so I thought that a positive,
non-zero one could mean to ignore the device. I don't like it but
perhaps you have a better solution.
christophe@saout.de [Sat, 10 Jan 2004 08:54:33 +0000 (00:54 -0800)]
[PATCH] small cleanup
This one is nothing important, just add some quotes to be more consistent
with the rest and make sure that the return value is positive (since the
error return values are negative). Hmm?
greg@kroah.com [Tue, 6 Jan 2004 09:11:53 +0000 (01:11 -0800)]
[PATCH] add silly script that names cdrom drives based on the cd in them.
greg@kroah.com [Tue, 6 Jan 2004 09:11:15 +0000 (01:11 -0800)]
[PATCH] add cdrom rule for ide cdrom.
Rule came from Kay
greg@kroah.com [Sun, 4 Jan 2004 16:18:16 +0000 (08:18 -0800)]
[PATCH] replace list_for_each with list_for_each_entry, saving a few lines of code.
greg@kroah.com [Sun, 4 Jan 2004 16:08:26 +0000 (08:08 -0800)]
[PATCH] add a blacklist of class devices we do not want to look at.
Thanks to Kay for the original patch, and the idea.
greg@kroah.com [Sat, 3 Jan 2004 13:37:27 +0000 (05:37 -0800)]
[PATCH] 012_bk change.
greg@kroah.com [Thu, 1 Jan 2004 05:46:59 +0000 (21:46 -0800)]
[PATCH] v012 release
greg@kroah.com [Thu, 1 Jan 2004 05:22:35 +0000 (21:22 -0800)]
[PATCH] minor grammer fixes for the udev_vs_devfs document
Thanks to Seemant Kulleen <seemant@gentoo.org> for pointing them out.
greg@kroah.com [Thu, 1 Jan 2004 04:38:14 +0000 (20:38 -0800)]
[PATCH] move the dbus config file to etc/dbus-1/system.d/
greg@kroah.com [Thu, 1 Jan 2004 04:35:02 +0000 (20:35 -0800)]
[PATCH] move the config files to etc/udev to clean up main directory a bit.
greg@kroah.com [Thu, 1 Jan 2004 04:28:15 +0000 (20:28 -0800)]
[PATCH] add Gentoo versions of the rules and permissions files.
greg@kroah.com [Thu, 1 Jan 2004 03:11:04 +0000 (19:11 -0800)]
[PATCH] if using glibc, link dynamically, as no one like 500Kb udev binaries...
kay.sievers@vrfy.org [Wed, 31 Dec 2003 08:34:51 +0000 (00:34 -0800)]
[PATCH] mention user callable udev + options in man page
As usual, here is the corresponding man page update and
a small text correction.
rml@ximian.com [Wed, 31 Dec 2003 08:34:49 +0000 (00:34 -0800)]
[PATCH] udev spec file update
More udev spec file updates. This one from David Zeuthen.
Attached patch, against udev-011, makes sure we pass USE_DBUS and also
makes sure we install the D-BUS policy file, if the %{dbus} option is
set.
greg@kroah.com [Wed, 31 Dec 2003 08:28:05 +0000 (00:28 -0800)]
[PATCH] minor change to udev_vs_devfs document.
greg@kroah.com [Wed, 31 Dec 2003 08:25:01 +0000 (00:25 -0800)]
[PATCH] added udev vs devfs supid document to the tree.
christophe.varoqui@free.fr [Wed, 31 Dec 2003 06:39:37 +0000 (22:39 -0800)]
[PATCH] extras multipath update
incremental to 0.0.12-1,
* check hotplug event refers to a block device; if not exit early
christophe.varoqui@free.fr [Wed, 31 Dec 2003 06:36:17 +0000 (22:36 -0800)]
[PATCH] extras multipath update
2003-12-29 multipath-012
* refresh doc
* add the uninstall target in Makefile
* /sbin/multipath, not /root/multipath in hotplug agent
kay.sievers@vrfy.org [Wed, 31 Dec 2003 06:31:37 +0000 (22:31 -0800)]
[PATCH] make udev user callable to query the database
Here is a slightly better version that prints the usage if a unknown option is given:
kay@pim:~/src/udev.kay$ ./udev -x
./udev: invalid option -- x
Usage: [-qrVh]
-q arg query database
-r print udev root
-V print udev version
-h print this help text
> Here is a patch that makes it possible to call udev with options on the command line.
> Valid options are for now:
>
> -V for the udev version:
> kay@pim:~/src/udev.kay$ ./udev -V
> udev, version 011_bk
>
> -r for the udev root:
> kay@pim:~/src/udev.kay$ ./udev -r
> /udev/
>
> -q to query the database with the sysfs path for the name of the node:
> kay@pim:~/src/udev.kay$ ./udev -q /class/video4linux/video0
> test/video/webcam0
kay.sievers@vrfy.org [Wed, 31 Dec 2003 06:25:12 +0000 (22:25 -0800)]
[PATCH] depend on all .h files
Let the build depend on all header files.
azarah@nosferatu.za.org [Tue, 30 Dec 2003 09:33:35 +0000 (01:33 -0800)]
[PATCH] make symlink work properly if there is already a file in its place
If a file that is not a symlink (node, socket, fifo, etc) already
exist where udev need to create a symlink, symlink() fails. This
patch basically test for an existing file, and unlink it.
kay.sievers@vrfy.org [Tue, 30 Dec 2003 09:29:25 +0000 (01:29 -0800)]
[PATCH] cleanup namedev_parse debug text
I missed a few spaces with my recent change.
greg@kroah.com [Tue, 30 Dec 2003 09:29:16 +0000 (01:29 -0800)]
[PATCH] move the signal handling registration to after we have initialized enough stuff.
mbuesch@freenet.de [Tue, 30 Dec 2003 09:21:06 +0000 (01:21 -0800)]
[PATCH] introduce signal handler
Here's a patch that adds a signal handler to udev to
clean up the environment (close the sysbus and close
the database) on kill-signals.
azarah@nosferatu.za.org [Tue, 30 Dec 2003 09:18:28 +0000 (01:18 -0800)]
[PATCH] Fix udev gcc-2.95.4 compat
Two liner to get gcc-2.95.4 to compile udev.
kay.sievers@vrfy.org [Tue, 30 Dec 2003 09:08:02 +0000 (01:08 -0800)]
[PATCH] extend exec_program[]
extend exec_program size to 100 chars cause:
PROGRAM="/home/kay/src/udev.kay/extras/ide-devfs.sh %k %b %n"
is too long :)
kay.sievers@vrfy.org [Tue, 30 Dec 2003 09:08:00 +0000 (01:08 -0800)]
[PATCH] ide-devfs.sh update
Attached is a patch for ide-devfs.sh,
The script is merged with the one from Martin Schlemmer, and cleaned up
by him, to create both types of symlinks with one single rule:
CALLOUT, BUS="ide", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", ID="hd*", NAME="%1c", SYMLINK="%2c %3c"
/udev/
|-- cdroms
| `-- cdrom0 -> ../hdc
|-- discs
| |-- disc0
| | |-- disc -> ../../hda
| | |-- part1 -> ../../hda1
| | |-- part2 -> ../../hda2
| | `-- part4 -> ../../hda4
| |-- disc1
| | |-- disc -> ../../hdb
| | `-- part1 -> ../../hdb1
| `-- disc2
| |-- disc -> ../../hde
| `-- part1 -> ../../hde1
|-- hda
|-- hda1
|-- hda2
|-- hda4
|-- hdb
|-- hdb1
|-- hdc
|-- hde
|-- hde1
`-- ide
|-- host0
| |-- bus0
| | |-- target0
| | | `-- lun0
| | | |-- disc -> ../../../../../hda
| | | |-- part1 -> ../../../../../hda1
| | | |-- part2 -> ../../../../../hda2
| | | `-- part4 -> ../../../../../hda4
| | `-- target1
| | `-- lun0
| | |-- disc -> ../../../../../hdb
| | `-- part1 -> ../../../../../hdb1
| `-- bus1
| `-- target0
| `-- lun0
| `-- cd -> ../../../../../hdc
`-- host2
`-- bus0
`-- target0
`-- lun0
|-- disc -> ../../../../../hde
`-- part1 -> ../../../../../hde1
kay.sievers@vrfy.org [Tue, 30 Dec 2003 09:07:59 +0000 (01:07 -0800)]
[PATCH] fix for apply_format()
fix possible NULL pointer in '%c' callout substitution
and cleanup '%D' debug text
kay.sievers@vrfy.org [Tue, 30 Dec 2003 09:07:57 +0000 (01:07 -0800)]
[PATCH] check for empty symlink string
Attached is a patch for udev-add.c to ignore empty symlink string parts.
Issue was brought up by ide-devfs.sh with only one symlink returned, while two are expected.
kay.sievers@vrfy.org [Tue, 30 Dec 2003 09:07:55 +0000 (01:07 -0800)]
[PATCH] 'ide' missing in bus_files[]
my syslog want's to contact you :)
Dec 25 20:37:48 pim udev[2274]: wait_for_device_to_initialize: Did not find bus type 'ide' on list of bus_id_files, contact greg@kroah.com
We need to put 'ide' to the bus_files array,
don't know which file to use...
greg@kroah.com [Tue, 30 Dec 2003 09:02:59 +0000 (01:02 -0800)]
[PATCH] udev.permissions.debian - forgot the dm nodes.
greg@kroah.com [Tue, 30 Dec 2003 09:01:05 +0000 (01:01 -0800)]
[PATCH] update the udev.permissions.debian file with new entries.
Thanks to Mathieu Segaud <matt@minas-morgul.org> for the information
greg@kroah.com [Tue, 30 Dec 2003 08:58:31 +0000 (00:58 -0800)]
[PATCH] added udev.init script for the Linux From Scratch project.
Thanks to Michael Buesch <mbuesch@freenet.de> for providing it.
kay.sievers@vrfy.org [Tue, 30 Dec 2003 08:54:29 +0000 (00:54 -0800)]
[PATCH] small trivial cleanup of latest changes
here is a patch for a typo in the man page, a whitespace cleanup
and a replace for the magic hex ASCII in char operations.
greg@kroah.com [Tue, 30 Dec 2003 08:52:16 +0000 (00:52 -0800)]
[PATCH] 011_bk tag
greg@kroah.com [Thu, 25 Dec 2003 08:38:45 +0000 (00:38 -0800)]
[PATCH] v011 release
greg@kroah.com [Thu, 25 Dec 2003 08:35:09 +0000 (00:35 -0800)]
[PATCH] add documentation about the BUS key being optional for the LABEL rule.