summaryrefslogtreecommitdiff
path: root/udevinfo.c
AgeCommit message (Collapse)Author
2006-01-09replace libsysfsKay Sievers
We never used any of the libsysfs convenience features. Here we replace it completely with 300 lines of code, which are much simpler and a bit faster cause udev(d) does not open any syfs file for a simple event which does not need any parent device information. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-16remove "udev_db" option from config fileKay Sievers
All udev state is kept in /$udev_root/.udev/ now. No option to configure that anymore, it will always be there. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-31udevinfo: restore -d optionKay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-30udevinfo: rename dump() to export()Kay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-29udevinfo: add database exportKay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27don't store devpath in udevdb, we don't need itKay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27add and use name_list_cleanup() for cleaning up the string listsKay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27change parameter order of udev_db_search_name()Kay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27print persistent data with "udevinfo -q all"Kay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27prepare for new HAL udevdb dumpKay Sievers
HAL soon wants to read the whole content of the udevdatabase while starting up. This makes the whole udev structure available to the udevinfo "dump". Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-10fix udevinfo outputThierry Vignaud
2005-07-22move code to its own filesKay Sievers
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-26store the imported device information in the udevdbKay Sievers
Any program can query with udevinfo for persistent device attributes evaluated on device discovery now. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-06Fix udevinfo for empty sysfs directoriesGreg KH
udevinfo would die if it ran into a sysfs directory with no attributes. This is valid for a lot of scsi devices, so now we just continue on up the chain. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-04-26[PATCH] move execute_program to utils + add action to init_devicekay.sievers@vrfy.org
2005-04-26[PATCH] udevinfo: print SYSFS attribute the same way we match itkay.sievers@vrfy.org
2005-04-26[PATCH] udevinfo: print errors to stderr instead of stdoutkay.sievers@vrfy.org
On Wed, 2005-03-23 at 13:55 +0100, Dieter Stueken <stueken@conterra.de> wrote: > I noticed a few funny synlinks within /dev: > lrwxrwxrwx 1 root root 4 2005-03-21 15:33:54.196950896 +0100 device2 -> hda2 > lrwxrwxrwx 1 root root 4 2005-03-21 15:33:54.196950896 +0100 not2 -> hda2 > lrwxrwxrwx 1 root root 4 2005-03-21 15:33:54.196950896 +0100 found2 -> hda2 > lrwxrwxrwx 1 root root 4 2005-03-21 15:33:54.196950896 +0100 in2 -> hda2 > lrwxrwxrwx 1 root root 4 2005-03-21 15:33:54.196950896 +0100 database2 -> hda2 > I don't know exactly, what caused this in depth. But I found udevinfo > prints all error messages to stdout instead of using stderr.
2005-04-26[PATCH] support log-priority levels in udev.confkay.sievers@vrfy.org
2005-04-26[PATCH] remove unneeded includekay.sievers@vrfy.org
2005-04-26[PATCH] udevinfo -d: use '=' as separator, cause ':' may be a part of the ↵kay.sievers@vrfy.org
devpath
2005-04-26[PATCH] replace strncpy()/strncat() by strlcpy()/strlcat()kay.sievers@vrfy.org
2005-04-26[PATCH] rename LOG to USE_LOG in all placeskay.sievers@vrfy.org
2005-04-26[PATCH] udevinfo -d: speed-up device dumpkay.sievers@vrfy.org
2005-04-26[PATCH] allow unlimitied count of symlinkskay.sievers@vrfy.org
2005-04-26[PATCH] udevinfo: print devpath -> node relationship for all deviceskay.sievers@vrfy.org
2005-04-26[PATCH] trivial rename of some variableskay.sievers@vrfy.org
2005-04-26[PATCH] big libsysfs diet (pre 2.0 version)kay.sievers@vrfy.org
2005-04-26[PATCH] cleanup db functionskay.sievers@vrfy.org
2005-04-26[PATCH] udevinfo: print SUBSYSTEM and DRIVERkay.sievers@vrfy.org
2005-04-26[PATCH] This fixes a silly mistake in how udevinfo prints the major and minorroland@digitalvampire.org
2005-04-26[PATCH] klibc supports LOG_PID now, so remove our own implementationkay.sievers@vrfy.org
2005-04-26bleah, more merge fixes...Greg KH
2005-04-26[PATCH] remove leftover from udevinfo's -d optionazarah@nosferatu.za.org
2005-04-26[PATCH] update the man pages and correct Usage: hintskay.sievers@vrfy.org
Add UDEV_LOG to the man udev man page. Remove mention of specific variables from the udevd/udevsend man page as we changed to pass the whole environment. Correct printed Usage: of udevtest and udevinfo. Init the config in udevtest earlier to accept input with and without the sysfs mount point.
2005-04-26fixups to get back to proper patch orderGreg KH
Damm, it's hard to merge a multi-line tree into one flat line at times...
2005-04-26[PATCH] rename udev_lib to udev_utils and dev_d to udev_multiplexkay.sievers@vrfy.org
2005-04-26[PATCH] fix udevinfo '-q path' option as it was not workinggreg@kroah.com
2005-04-26[PATCH] Don't try to print major/minor for devices without a dev file.kay.sievers@vrfy.org
2005-04-26[PATCH] remove get_device_type and merge that into udev_set_values()kay.sievers@vrfy.org
2005-04-26[PATCH] change key names in udevinfo sysfs walk to match the kernelkay.sievers@vrfy.org
2005-04-26[PATCH] rename udevdb* to udev_db*kay.sievers@vrfy.org
2005-04-26[PATCH] make the udev object available to more processing stageskay.sievers@vrfy.org
Remove the overwriting of main_argv[] hack and use the values from the udev object. Pass the udev object to call_foreach_file(). In the udevstart case, export SUBSYSTEM and UDEVSTART to the environment.
2005-04-26[PATCH] make udevinfo's -r option also workimg for symlink querieskay.sievers@vrfy.org
[kay@pim udev.kay]$ ./udevinfo -r -q symlink -p /class/video4linux/video0 /dev/camera0 /dev/kamera0 /dev/videocam0 /dev/webcam0 [kay@pim udev.kay]$ ./udevinfo -q symlink -p /class/video4linux/video0 camera0 kamera0 videocam0 webcam0
2005-04-26[PATCH] improve udevinfo sysfs info walkkay.sievers@vrfy.org
2005-04-26[PATCH] add sysfs info walk to udevinfokay.sievers@vrfy.org
The option "-s" will get information about the major/minor, the physical device, the bus value and the driver from sysfs for all class and block devices: kay@pim udev.kay]$ ./udevinfo -s DEVPATH '/sys/block/sda' SUBSYSTEM 'block' NAME 'sda' MAJORMINOR '8:0' PHYSDEVPATH '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host2/target2:0:0/2:0:0:0' PHYSDEVPATHBUS 'scsi' DRIVER 'sd' DEVPATH '/sys/class/input/mice' SUBSYSTEM 'input' NAME 'mice' MAJORMINOR '13:63' DEVPATH '/sys/class/input/mouse0' SUBSYSTEM 'input' NAME 'mouse0' MAJORMINOR '13:32' ...
2005-04-26[PATCH] replace tdb database by simple lockless file databasekay.sievers@vrfy.org
This makes the udev operation completely lockless by storing a file for every node in /dev/.udevdb/* This solved the problem with deadlocking concurrent udev processes waiting for each other to release the file lock under heavy load.
2005-04-26[PATCH] big cleanup of internal udev apikay.sievers@vrfy.org
Here is the first patch to cleanup the internal processing of the various stages of an udev event. It should not change any behavior, but if your system depends on udev, please always test it before reboot :) We pass only one generic structure around between add, remove, namedev, db and dev_d handling and make all relevant data available to all internal stages. All udev structures are renamed to "udev". We replace the fake parameter by a flag in the udev structure. We open the class device in the main binaries and not in udev_add, to make it possible to use libsysfs for udevstart directory crawling. The last sleep parameters are removed.
2005-04-26[PATCH] close the syslogkay.sievers@vrfy.org
Seems that we never closed the opened syslog. Here is a patch to do this in all our binaries.
2005-04-26[PATCH] netdev - udevdb+dev.d changeskay.sievers@vrfy.org
Here is a patch to change the netdev handling in the database and for the dev.d/ calls. I applies on top of the udevd.patch, cause klibc has no sysinfo(). o netdev's are also put into our database now. I want this for the udevruler gui to get a list of all handled devices. All devices in the db are stamped with the system uptime value at the creation time. 'udevinfo -d' prints it. o the DEVPATH value is the key for udevdb, but if we rename a netdev, the name is replaced in the kernel, so we add the changed name to the db to match with the remove event. NOTE: The dev.d/ scripts still get the original name from the hotplug call. Should we replace DEVPATH with the new name too? o We now only add a device to the db, if we have successfully created the main node or successfully renamed a netdev. This is the main part of the patch, cause I needed to clean the retval passing trough all the functions used for node creation. o DEVNODE sounds a bit ugly for netdev's so I exported DEVNAME too. Can we change the name? o I've added a UDEV_NO_DEVD to possibly skip the script execution and used it in udev-test.pl. udevstart is the same horror now, if you have scripts with logging statements in dev.d/ it takes minutes to finish, can we skip the scripts here too? o The get_device_type() function is changed to be more strict, cause 'udevinfo -a -p /block/' gets a class device for it and tries to print the major/minor values. o bugfix, the RESULT value has now a working newline removal and a test for this case.
2005-04-26[PATCH] hmm, handle net devices with udev?kay.sievers@vrfy.org
Hmm, Arndt Bergmann sent a patch like this one a few weeks ago and I want to bring the question back, if we want to handle net device naming with udev. With this patch it is actually possible to specify something like this in udev.rules: KERNEL="dummy*", SYSFS{address}="00:00:00:00:00:00", SYSFS{features}="0x0", NAME="blind%n" KERNEL="eth*", SYSFS{address}="00:0d:60:77:30:91", NAME="private" and you will get: [root@pim udev.kay]# cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo: 1500 30 0 0 0 0 0 0 1500 30 0 0 0 0 0 0 private: 278393 1114 0 0 0 0 0 0 153204 1468 0 0 0 0 0 0 sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 blind0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 The udevinfo program is also working: [root@pim udev.kay]# ./udevinfo -a -p /sys/class/net/private looking at class device '/sys/class/net/private': SYSFS{addr_len}="6" SYSFS{address}="00:0d:60:77:30:91" SYSFS{broadcast}="ff:ff:ff:ff:ff:ff" SYSFS{features}="0x3a9" SYSFS{flags}="0x1003" SYSFS{ifindex}="2" SYSFS{iflink}="2" SYSFS{mtu}="1500" SYSFS{tx_queue_len}="1000" SYSFS{type}="1" follow the class device's "device" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:01.0': BUS="pci" ID="0000:02:01.0" SYSFS{class}="0x020000" SYSFS{detach_state}="0" SYSFS{device}="0x101e" SYSFS{irq}="11" SYSFS{subsystem_device}="0x0549" SYSFS{subsystem_vendor}="0x1014" SYSFS{vendor}="0x8086" The matching device will be renamed to the given name. The device name will not be put into the udev database, cause the kernel renames the device and the sysfs name disappears. I like it, cause it plugs in nicely. We have all the naming features and sysfs queries and walks inside of udev. The sysfs timing races are already solved and the management tools are working for net devices too. nameif can only match the MAC address now. udev can match any sysfs value of the device tree the net device is connected to. But right, net devices do not have device nodes :)