Commit graph

469 commits

Author SHA1 Message Date
greg@kroah.com ff2c16f0d1 [PATCH] allow dbus code to actually build again. 2005-04-26 21:13:19 -07:00
greg@kroah.com 46a7fa4bdb [PATCH] v015 release 2005-04-26 21:13:19 -07:00
greg@kroah.com 125611d9d4 [PATCH] update klibc to version 0.98 2005-04-26 21:13:19 -07:00
greg@kroah.com 28706bd9a1 [PATCH] clean up udevinfo on 'make clean' 2005-04-26 21:13:19 -07:00
greg@kroah.com 567f6d14e8 [PATCH] add udevinfo man page to spec file. 2005-04-26 21:13:19 -07:00
greg@kroah.com 05c0c9da0b [PATCH] remove command line documentation from udev man page 2005-04-26 21:13:19 -07:00
greg@kroah.com e31474a1e1 [PATCH] create initial version of udevinfo man page. 2005-04-26 21:13:19 -07:00
greg@kroah.com 8fc3418850 [PATCH] added URL to spec file. 2005-04-26 21:13:19 -07:00
greg@kroah.com da1cc7cc5f [PATCH] add udevinfo to udev.spec file. 2005-04-26 21:13:19 -07:00
greg@kroah.com 245f9f52ce [PATCH] add udevinfo to install target of Makefile 2005-04-26 21:13:19 -07:00
greg@kroah.com 8202eb32b9 [PATCH] rip out command line code from udev, now that we have udevinfo. 2005-04-26 21:13:19 -07:00
greg@kroah.com ac4dc87465 [PATCH] udevinfo doesn't need to declare main_envp 2005-04-26 21:13:19 -07:00
greg@kroah.com 274812b502 [PATCH] move get_pair to udev_config.c because udevinfo doesn't need all of namedev.o 2005-04-26 21:13:19 -07:00
greg@kroah.com 1f6d07b9a5 [PATCH] more makefile cleanups 2005-04-26 21:13:19 -07:00
greg@kroah.com 869fc2f1ff [PATCH] move udevinfo into the main build and clean up the main Makefile a bit. 2005-04-26 21:13:18 -07:00
kay.sievers@vrfy.org 87171e46cd [PATCH] udevinfo - now a real program :)
I want to make udevinfo the standard query interface, so all the user
features of the main udev are copied in here. It is now capable to:

  o query the database for a given value
  o dump the whole database
  o extract all possible device attributes for a sysfs_device


In addition to the known options of udev it supports the query for the
mode of the device node, and it includes the mode in the database dump:

  udevinfo -d
  P: /class/video4linux/video0
  N: video/webcam0
  M: 0666
  S: camera0 kamera0
  O: 500
  G: 500


It is also a bit more friendly with the pathnames specified for devices or nodes.
We remove the absolute path or add it if neccessary:

  udevinfo -q mode -n video/webcam0
  udevinfo -q mode -n /udev/video/webcam0
  0666

  udevinfo -q mode -p /sys/class/video4linux/video0
  udevinfo -q mode -p /class/video4linux/video0
  udevinfo -q mode -p class/video4linux/video0
  0666
2005-04-26 21:13:18 -07:00
kay.sievers@vrfy.org a695feaeff [PATCH] udevd - cleanup and better timeout handling
Here is the next revision for udevd:
  o Small cleanups all over the place.
  o Swich to the usual linked list format "list.h".
  o Better timeout handling.
      We store a timestamp in in every queued event, so we don't wait longer
      than the timeout specified, if the hole in the list is not shrinking.
  o ignore udevd target if klibc is used
2005-04-26 21:13:18 -07:00
greg@kroah.com eea34a0e99 [PATCH] clean up compiler warnings if building using klibc. 2005-04-26 21:13:18 -07:00
mbuesch@freenet.de 25f8a5ad64 [PATCH] LFS init script update 2005-04-26 21:13:18 -07:00
greg@kroah.com 1c5c245e6f [PATCH] make udevd only have one instance running at a time
it used a file lock right now.  need to put that lock in the udev directory,
it's in the current directory, which isn't a good thing...
2005-04-26 21:13:18 -07:00
greg@kroah.com 305dd8b494 [PATCH] new testd.block script for debugging. 2005-04-26 21:13:18 -07:00
greg@kroah.com 71c077fb0a [PATCH] udevsnd : clean up message creation logic a bit. 2005-04-26 21:13:18 -07:00
kay.sievers@vrfy.org 33db4b8da0 [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...
2005-04-26 21:13:18 -07:00
kay.sievers@vrfy.org 90c210eb6b [PATCH] fix udevd exec
Sorry, some code is missing.
Here is a fix to make the exec functional.
2005-04-26 21:13:18 -07:00
kay.sievers@vrfy.org 034f35d7e6 [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"
2005-04-26 21:13:18 -07:00
greg@kroah.com 7b15897b46 [PATCH] whitespace cleanups 2005-04-26 21:13:17 -07:00
kay.sievers@vrfy.org 7fafc03242 [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.
2005-04-26 21:13:17 -07:00
greg@kroah.com 659c37bb4b [PATCH] remove TODO item about BUS value, as it is now done. 2005-04-26 21:13:17 -07:00
greg@kroah.com 724257d97b [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.
2005-04-26 21:13:17 -07:00
greg@kroah.com bb513a064c [PATCH] 014_bk mark 2005-04-26 21:13:17 -07:00
greg@kroah.com f2ec8f1a7f [PATCH] 014 release 2005-04-26 21:13:17 -07:00
greg@kroah.com 267f534d1c [PATCH] misc code cleanups. 2005-04-26 21:13:17 -07:00
christophe.varoqui@free.fr 069bd53012 [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
2005-04-26 21:13:17 -07:00
greg@kroah.com f10fec8197 [PATCH] fixup logging.h to handle different logging options properly.
Thanks to Olaf Hering <olh@suse.de> for the error message.
2005-04-26 21:13:17 -07:00
kay.sievers@vrfy.org be9b51f663 [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"
2005-04-26 21:13:17 -07:00
kay.sievers@vrfy.org 765cbd9759 [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'
2005-04-26 21:13:17 -07:00
hannal@us.ibm.com 74c73ef994 [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.
2005-04-26 21:13:17 -07:00
kay.sievers@vrfy.org b2a21a3547 [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.
2005-04-26 21:13:17 -07:00
kay.sievers@vrfy.org 7780509143 [PATCH] udev - kill %D from udev-test.pl
Kill the two tests with %D.
2005-04-26 21:13:17 -07:00
patmans@us.ibm.com e996d97835 [PATCH] update udev scsi_id to scsi_id 0.3 2005-04-26 21:13:17 -07:00
hannal@us.ibm.com eb7a964a7c [PATCH] small cut n paste error fix 2005-04-26 21:13:17 -07:00
greg@kroah.com 0523018487 [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.
2005-04-26 21:13:17 -07:00
kay.sievers@vrfy.org 54988802b7 [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
2005-04-26 21:13:17 -07:00
flamingice@sourmilk.net 5e4f123888 [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.
2005-04-26 21:13:16 -07:00
greg@kroah.com 18f0045bc8 [PATCH] remove the %D modifier as it is not longer needed. 2005-04-26 21:13:16 -07:00
greg@kroah.com 45d57088f9 [PATCH] remove unneeded keyboard rule. 2005-04-26 21:13:16 -07:00
greg@kroah.com f130b15645 [PATCH] add usb_host and pci_bus to the class blacklist. 2005-04-26 21:13:16 -07:00
ananthmg@rediffmail.com 616a707807 [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.
2005-04-26 21:13:16 -07:00
greg@kroah.com 1782087e4f [PATCH] added input device rules to udev.rules and udev.rules.devfs 2005-04-26 21:13:16 -07:00
kay.sievers@vrfy.org b6864b4bf1 [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.
2005-04-26 21:13:16 -07:00