aboutsummaryrefslogtreecommitdiffstats
path: root/udev.c
AgeCommit message (Collapse)AuthorFilesLines
2006-08-28update source file headersKay Sievers1-4/+2
2006-08-21cleanup commandline argument handlingKay Sievers1-2/+2
Print and log failure, but don't fail for tools which are usually not used iteractively. Add '--help' to all tools.
2006-08-18selinux: init once in the daemon, not in every event processHarald Hoyer1-0/+2
2006-01-25let "ignore_device" always return the event successfullyKay Sievers1-2/+4
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-25rename apply_format() cause it is public nowKay Sievers1-1/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-24substitute format chars in RUN after rule matchingAndrey Borzenkov1-2/+7
Apply substitutions before running a program, not while the rule is parsed. It allows to use environment variables set during rule processing as command arguments.
2006-01-09replace libsysfsKay Sievers1-16/+37
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-12remove all built-in wait_for_sysfs logicKay Sievers1-1/+0
Most of the issues are fixed with the kernel we depend on, for the remaing ones see the RELEASE-NOTES for a special rule to add. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-07add strerror() to error logsMarco d'Itri1-1/+1
2005-11-05remove precompiled rules optionKay Sievers1-1/+1
It was a workaround for speed up udev "coldplug", where ~800 events happened a second time during bootup. No need for it with the rules aleady parsed in the daemon. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-18bring std(in|out|err) fd's in a sane stateKay Sievers1-0/+16
If the kernel forks us as an usermodhelper, we don't have any of the standard fd's and the first open() will start with fd=0. This is inherited to all forked childs and confuses later forked helpers where we want to read from a pipe connected to the helpers stdout/stderr. # ls -l /proc/$(pidof udevd)/fd total 6 dr-x------ 2 root root 0 2005-08-18 12:44 . dr-xr-xr-x 4 root root 0 2005-08-18 12:44 .. lrwx------ 1 root root 64 2005-08-18 12:44 0 -> /dev/null lrwx------ 1 root root 64 2005-08-18 12:44 1 -> socket:[1274617] lr-x------ 1 root root 64 2005-08-18 12:44 2 -> pipe:[1274618] l-wx------ 1 root root 64 2005-08-18 12:44 3 -> pipe:[1274618] lrwx------ 1 root root 64 2005-08-18 12:44 4 -> socket:[1274619] lrwx------ 1 root root 64 2005-08-18 12:44 5 -> socket:[1274620] Ouch! This will obviously not redirect sterr, it will kill the pipe we established between the parent and the child: devnull = open("/dev/null", O_RDWR); dup2(devnull, STDERR_FILENO); Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-15cleanup some debug output and move to info level + unify select() loopsKay Sievers1-2/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-11move some logging to the info levelKay Sievers1-0/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-11allow logging of all output from executed toolsKay Sievers1-1/+2
If USE_DEBUG=true and udev_log="debug", all output of the forked programs to stdout and stderr is send to syslog. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08add flag for reading of precompiled rulesKay Sievers1-1/+1
Rules can be precompiled and stored on disk for initramfs, to avoid parsing the rules with every event again and again. Also the OWNER and GROUP names are already resolved to numerical values in the compiled rules. This flag is used for the upcoming move of the rules parsing into udevd: If the real root is mounted udevd is started and parses the rules only once. The event processes will inherit the already parsed rules from the daemon, so we want to ignore any precompiled rules and use the real rules files and watch the filesystem for changes to reload the rules automatically. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08switch some strlcpy's to memcpyKay Sievers1-0/+1
strlcpy counts the sourec string lengt and is therefore not suitable to copy a defined length of characters from one string to another. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-01allow RUN to send the environment to a local socketKay Sievers1-2/+6
RUN="socket:<name>" will send the environment in the kernel uevent format to the named destination. Using the socket instead of the program to pass the hotplug events to the HAL daemon, cuts down the running time of udevstart from 0.8 to 0.4 seconds on my box. env -i ACTION=add DEVPATH=/block/hda/hda1 strace -s10000 ./udev block sendto(3, "add@/block/hda/hda1\0 ACTION=add\0DEVPATH=/block/hda/hda1\0UDEV_LOG=3\0 ID_TYPE=disk\0ID_MODEL=HTS726060M9AT00\0ID_SERIAL=MRH401M4G6UM9B\0 ID_REVISION=MH4OA6BA\0ID_BUS=ata\0ID_PATH=pci-0000:00:1f.1-ide-0:0\0 ID_FS_USAGE=other\0ID_FS_TYPE=swap\0ID_FS_VERSION=2\0 ID_FS_UUID=9352cfef-7687-47bc-a2a3-34cf136f72e1\0 ID_FS_LABEL=ThisIsSwap\0ID_FS_LABEL_SAFE=ThisIsSwap\0 DEVNAME=/dev/hda1\0" Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-22move code to its own filesKay Sievers1-98/+4
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-20make SYSFS{} usable for all devicesKay Sievers1-5/+7
Patch from: Hannes Reinecke <hare@suse.de>
2005-07-06rename ALARM_TIMEOUT to UDEV_ALARM_TIMEOUTKay Sievers1-1/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-05pack parsed rules listKay Sievers1-6/+7
This cuts down our 600 rules file to 98 kb instead of 1.9 Mb memory or file-size with precompiled rules. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-25unify execute_command() and execute_program()Kay Sievers1-1/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-22fix the fix and change the file to wait for to the "bus" linkKay Sievers1-21/+19
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-22fix udevstart and let all events trvel trough udevKay Sievers1-7/+7
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-16udevd: control log-priority of the running daemon with udevcontrolKay Sievers1-1/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-14udev: fix netdev RUN handlingHannes Reinecke1-26/+27
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05udev: handle all events - not only class and block devicesKay Sievers1-91/+64
Handle all events with rules. If udev is expected to handle hotplug.d/ the exernal helper must be called. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05volume_id: use udev-provided log-levelKay Sievers1-1/+1
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05udev: move dev.d/ handling to external helperKay Sievers1-4/+0
Modern rules are expected to call notification and postprocessing with the RUN key. For compatibility the current behavior can be emulated with an external helper. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05udevd: listen for netlink eventsKay Sievers1-3/+7
After the first valid netlink-event all event with a serial number received on the udevsend socket will be ignored. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-04-26[PATCH] export DEVNAME to RUN-key executed programskay.sievers@vrfy.org1-5/+6
2005-04-26[PATCH] add RUN key to be able to run rule based notificationkay.sievers@vrfy.org1-3/+16
SUBSYSTEM=="block", RUN="/sbin/program" will execute the program only for block device events. ACTION="remove", SUBSYSTEM=="block", RUN"/sbin/program" will execute the program, if a block device is removed.
2005-04-26[PATCH] move execute_program to utils + add action to init_devicekay.sievers@vrfy.org1-2/+3
2005-04-26[PATCH] support log-priority levels in udev.confkay.sievers@vrfy.org1-11/+13
2005-04-26[PATCH] rename namedev_dev to udev_rulekay.sievers@vrfy.org1-2/+2
2005-04-26[PATCH] correct enum device_typekay.sievers@vrfy.org1-3/+3
2005-04-26[PATCH] replace strncpy()/strncat() by strlcpy()/strlcat()kay.sievers@vrfy.org1-3/+6
2005-04-26[PATCH] split udev and udevstartkay.sievers@vrfy.org1-12/+0
2005-04-26[PATCH] rename LOG to USE_LOG in all placeskay.sievers@vrfy.org1-1/+1
2005-04-26[PATCH] allow unlimitied count of symlinkskay.sievers@vrfy.org1-0/+1
2005-04-26[PATCH] correct udev_init_devicekay.sievers@vrfy.org1-13/+5
2005-04-26[PATCH] determine device type in udev_init_device()kay.sievers@vrfy.org1-5/+4
2005-04-26[PATCH] switch device type to enumkay.sievers@vrfy.org1-1/+1
2005-04-26[PATCH] handle renamed network interfaces properly if we manage hotplug.d/kay.sievers@vrfy.org1-8/+15
If we take over the hotplug call and manage the events we don't need to call the event fake script in dev.d/. Just set all expected values to the new network interface name and call hotplug.d/. This way the device renaming is completely handled inside of udev and userspace can't get confused.
2005-04-26[PATCH] complete removal of explicit udev permissions config filekay.sievers@vrfy.org1-1/+1
2005-04-26[PATCH] klibc supports LOG_PID now, so remove our own implementationkay.sievers@vrfy.org1-1/+0
2005-04-26bleah, more merge fixes...Greg KH1-0/+1
2005-04-26[PATCH] export DEVNAME regardless of the state of udev_dev_dkay.sievers@vrfy.org1-2/+3
2005-04-26[PATCH] check earlier if we should run as udevstartkay.sievers@vrfy.org1-8/+8
2005-04-26[PATCH] remove double initializationkay.sievers@vrfy.org1-4/+4
2005-04-26[PATCH] add -V option to udev to print the version numberkay.sievers@vrfy.org1-1/+7
On Sat, 2004-12-11 at 18:44 +0200, Martin Schlemmer [c] wrote: > > Any suggestions to determining the version of the installed udev? > This is now during startup, to see if we can make use of using > udevsend as hotplug agent. If the system was up, udevinfo could > be used, but that is in /usr/bin that might be on a seperate /usr. > I know we might move udevinfo to /bin, but that might be an issue > for some, and adding a -V switch to /sbin/udev might be a better > choice.
2005-04-26[PATCH] handle /etc/hotplug.d/ only if the event comes from udevdkay.sievers@vrfy.org1-0/+4
2005-04-26[PATCH] trivial cleanups and change some commentskay.sievers@vrfy.org1-3/+8
2005-04-26[PATCH] remove unused variableskay.sievers@vrfy.org1-1/+1
Remove udev.bus, cause it's currently unused and newer kernels will pass it in the hotplug environment as PHYSDEVBUS. Remove udev.action, cause it's unused. Rename udev_set_values() to udev_init_device().
2005-04-26[PATCH] use blacklist on device "remove" and remove dev.d/ call code duplicationkay.sievers@vrfy.org1-14/+13
2005-04-26[PATCH] don't call the hotplug scripts with a test runkay.sievers@vrfy.org1-1/+1
2005-04-26fixups to get back to proper patch orderGreg KH1-5/+0
Damm, it's hard to merge a multi-line tree into one flat line at times...
2005-04-26[PATCH] don't call dev.d/ scripts twice, if directory = subsystemkay.sievers@vrfy.org1-2/+2
The /etc/dev.d/input/input.dev was called twice for /dev/input/mouse. Skip the execution if we get a directory named after the subsystem. Move UDEV_NO_DEVD where it belongs.
2005-04-26[PATCH] rename udev_lib to udev_utils and dev_d to udev_multiplexkay.sievers@vrfy.org1-4/+4
2005-04-26[PATCH] fix spurious valgrind warning in udev.greg@kroah.com1-0/+1
2005-04-26[PATCH] DEVNAME on device removalsjoerd@spring.luon.net1-0/+4
I just noticed that the DEVNAME enviroment variable isn't being set anymore in udev 0.046 on device removal, while it was being set in 0.042. We're using the property tto do umount -l <devices> when a block device is removed. Afaik there is no other way to associate a device with it's DEVNAME on removal ? Also are there cases where doing umount -l on the removed devices is wrong? I guess the device is gone, so there is no sense in keeping it mounted (it's not like the filesystem is gonna come back in a sane state again).. Attached (trivial) patch brings back the DEVNAME variable on device removal.
2005-04-26[PATCH] handle whole hotplug event with udevd/udevkay.sievers@vrfy.org1-8/+36
If /proc/sys/kernel/hotplug points to /sbin/udevsend we handle the whole hotplug event with multiplexing /etc/hotplug.d/.
2005-04-26[PATCH] integrate wait_for_sysfs in udevkay.sievers@vrfy.org1-91/+95
Move the wait_for_sysfs logic into the udev binary. udev is called for every hotplug event. It also waits for /devices events.
2005-04-26[PATCH] export DEVNAME on remove eventkay.sievers@vrfy.org1-2/+5
Fix from Sjoerd Simons <sjoerd@spring.luon.net>, it got lost on the recent reorganization of the udev processing stages.
2005-04-26[PATCH] export udev_log flag to the environmentkay.sievers@vrfy.org1-1/+9
Forked scripts and callouts may want to follow udev's configured behavior and log only if udev is logging itself.
2005-04-26[PATCH] disable logging for udevstartkay.sievers@vrfy.org1-0/+1
The slow logging facilites on some systems are a reason for the reported slowness of udevstart. On one of my boxes udevstart is down from 9 second to 0.3 seconds.
2005-04-26[PATCH] rename udevdb* to udev_db*kay.sievers@vrfy.org1-2/+1
2005-04-26[PATCH] Make dev.d/ handling a separate processing stagekay.sievers@vrfy.org1-3/+6
Move the logic when and how to call the dev.d/ scripts into the main processing path.
2005-04-26[PATCH] make the udev object available to more processing stageskay.sievers@vrfy.org1-9/+0
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] add ACTION to udev object to expose it to the whole processkay.sievers@vrfy.org1-4/+4
2005-04-26[PATCH] let udev act as udevstart if argv[1] == "udevstart"kay.sievers@vrfy.org1-1/+1
"udev udevstart" will run udev as udevstart. This makes it easier to run a test in the source tree without the need to create a symlink.
2005-04-26[PATCH] replace tdb database by simple lockless file databasekay.sievers@vrfy.org1-10/+1
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] Don't use any syslog() in signal handler, cause it may deadlock.kay.sievers@vrfy.org1-4/+1
2005-04-26[PATCH] Remove the last klibc specific line from the main udev codekay.sievers@vrfy.org1-1/+0
2005-04-26[PATCH] expose sysfs functions for sharing itkay.sievers@vrfy.org1-35/+8
This patch exposes the wait_for_sysfs functions to all possible users, so we need to maintain only one list of exceptions. The last list is hereby removed from udev.c.
2005-04-26[PATCH] sparse cleanups on the treegreg@kroah.com1-0/+1
2005-04-26[PATCH] cleanup netif handling and netif-dev.d/ eventskay.sievers@vrfy.org1-0/+10
Here we supress the dev.d/ execution if we didn't change a network interface's name with a rule. This should solve the issue of two running dhclients for the same interface, cause the /etc/dev.d/net/hotplug.dev script that fakes the hotplug event runs with every udevstart for every interface and fakes a second identical hotplug event on bootup. With this patch netif interfaces are no longer stored in the udevdb. It is not needed, cause we don't have permissions or symlinks :) and all information is available in sysfs. This patch also moves the dev_d execution calls out of the udev_add/udev_remove. As with the former api-cleanup-patch we have all processed data in one udev struct and can place the execution calls where needed.
2005-04-26[PATCH] big cleanup of internal udev apikay.sievers@vrfy.org1-12/+28
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.org1-1/+2
Seems that we never closed the opened syslog. Here is a patch to do this in all our binaries.
2005-04-26[PATCH] move assignments past local variablespatmans@us.ibm.com1-2/+3
I'm using an older C compiler, and it doesn't like assignments mixed with declarations, but this is also a style cleanup.
2005-04-26[PATCH] remove sleeps from udev as it is external nowkay.sievers@vrfy.org1-19/+33
Here we remove all the sysfs sleep loops from udev as wait_for_sysfs will do this for us and any other hotplug user. We still keep a small blacklist of subsystems we don't care about but any missing entry here will no longer lead to a spinning udev waiting for files.
2005-04-26[PATCH] Fix build error with klibc due to recent changes.greg@kroah.com1-0/+1
2005-04-26[PATCH] mergegreg@kroah.com1-1/+0
2005-04-26[PATCH] fix asmlinkagembuesch@freenet.de1-1/+1
This patch fixes the reintroduced bug with the sig_handler(), if we link against a -mregparm=3 compiled klibc on i386. It also fixes some compiler warnings about redefined asmlinkage on some systems. Also some (broken?) compilers on distros throw out warnings if asmlinkage is before "static void". This fixes it, too.
2005-04-26[PATCH] fix incompatible pointer type warningmbuesch@freenet.de1-1/+1
This patch fixes two warning: assignment from incompatible pointer type asmlinkage is the reason for the warning. We can simply cast to avoid it. It also fixes this warning: warning: implicit declaration of function `umask'
2005-04-26[PATCH] prevent deadlocks on an corrupt udev databasekay.sievers@vrfy.org1-6/+17
Here is the patch, that should prevent all of the known deadlocks with corrupt tdb databases we discovered. Thanks to Frank Steiner <fsteiner-mail@bio.ifi.lmu.de>, who tested all this endlessly with a NFS mounted /dev. The conclusion is, that udev will not work on filesystems without proper record locking, but we should prevent the endless loops anyway. This patch implements: o recovery from a corrupted udev database. udev will continue without database support now, instead of doing nothing. So the node should be generated in any case, remove will obviously not work for custom names. o added iteration limits to the tdb-code at the places we discovered endless loops. In the case tdb tries to find more than 100.000 entries with the same hash, we better give up :) o prevent a {all_partitions} loop caused by corrupt db data o log all tdb errors to syslog o switch sleep() to usleep() cause we want to use alarm()
2005-04-26[PATCH] handle only block and class deviceskay.sievers@vrfy.org1-1/+1
Fix a stupid logic bug, I introduced with the udev.c simplification. We want to look at class and block devices only.
2005-04-26[PATCH] Fix naming ethernet devices in udevstartkay.sievers@vrfy.org1-88/+76
On Tue, Sep 07, 2004 at 12:46:43PM +0200, Kay Sievers wrote: > On Mon, 2004-09-06 at 20:18 -0700, Tom Rini wrote: > > I noticed somewhat recently that my enet devices weren't being renamed > > on boot anymore. I don't quite know when this got broken (or rather, if > > it was supposed to be working. I swear it worked for me once..), but > > the following seems to do it. > > I think it never worked in the udevstart case. It worked only with the > hotplug-event-udev, I expect. > > > In udev_scan_class(), look for not just > > %s/%s/dev (which everything with a dev node has), but %s/%s/dev* (both > > of my enet devices, sis900 & 3c59x only have device) and if that > > exists, pass this along to udev. > > Yeah, network devices don't have a devnode and therefore no "dev", but > they are all in /sys/class/net/. We may just test if we are there > instead of the "device" match. How about something like this. It adds all the net devices without looking at the attributes and keeps the remaining logic like it is. It also removes certain levels of indirection and much simplifies the udevstart process. We surely don't need to open and close the udevdb for every node while iterating over the list. (We are about 5% faster on my box) It's not well tested, so it would be nice if someone can have a look at it, before a broken udevstart renders any system unbootable.
2005-04-26[PATCH] fix UDEV_NO_SLEEPtrini@kernel.crashing.org1-1/+4
Move setting UDEV_NO_SLEEP into main(). I thought about moving udev_init_config() around, but it still must be invoked in both udev and udevstart cases, and before udev_hotplug() is called. An alternative would be to have main() do: if (is_udevstart) { ... current ... } else { udev_init_config(); return udev_hotplug(); } And move setting UDEV_NO_SLEEP into udev_start(). I can redo it that way, if you prefer. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2005-04-26[PATCH] Make udev/udevstart be one binarytrini@kernel.crashing.org1-24/+42
Hi, The following patch makes udev/udevstart be a common binary. First, doing this grows udev by a total of 1.8kB (ppc32, stripped) whereas udevstart by itself is 6.4kB. I know you mentioned being able to replace udevstart with a script, but at 1.8kB I don't think it'll be easy to beat this with size there. Next, the following are by-eye timings of before, after, and with devfs on a slow, but still usable embedded platform (config stripped down to more-or-less bare for ramdisk): -- Embedded Planet RPX LITE, 64Mhz MPC 823e -- devfs : 15.333s, 15.253s, 14.988s (15.191s avg) udev-pristine : 18.675s, 18.079s, 18.418s (18.390s avg) udev-multi : 14.587s, 14.747s, 14.868s (14.734s avg) The patch ends up being rather large to add this, as in doing so I ended up making all refs (that I hit..) to devpath/subsystem be marked as 'const'. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2005-04-26[PATCH] Add 'asmlinkage' to udev-030trini@kernel.crashing.org1-1/+1
The following patch adds 'asmlinkage' defines to udev, to kill off 2 warnings on !i386. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2005-04-26[PATCH] fix udevd zombieskay.sievers@vrfy.org1-3/+3
The recent version of klibc switched to -mregparm=3. This broke the signal handlers parameter, cause it is called directly from the kernel with the parameter on the stack not in a register.
2005-04-26[PATCH] hmm, handle net devices with udev?kay.sievers@vrfy.org1-13/+13
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 :)
2005-04-26[PATCH] remove dbus code from core udev code as it's no longer needed to be ↵greg@kroah.com1-10/+1
there.
2005-04-26[PATCH] don't init namedev on removekay.sievers@vrfy.org1-11/+10
Is there any reason to parse the rules for a remove event? Without it, our test script needs only 2.1 seconds instead of 2.5, so we have 19 percent more time for testing now :)
2005-04-26[PATCH] replace fgets() with mmap() and introduce udev_lib.[hc]kay.sievers@vrfy.org1-2/+4
Here we replace the various fgets() with a mmap() call for the config file reading, due to the reported performance problems with klibc. Thanks to Patrick's testing, it makes a very small, close to nothing speed gain for libc users, but a 6 times speed increase for klibc users with a 1000 line config file. I've created a udev_lib.[hc] for this and also moved all the generic stuff from udev.h in there and uninlined the functions.
2005-04-26[PATCH] overall trivial trivial cleanupkay.sievers@vrfy.org1-3/+3
Here I try to make the style a bit more consistant in the different files, so that new patches just copy the 'right' one :) Some "magic" numbers are replaced and udevtest.c is catched up with udev.
2005-04-26[PATCH] blacklist pcmcia_socketkay.sievers@vrfy.org1-0/+1
Is this something for the blacklist? /sys/class/pcmcia_socket/ |-- pcmcia_socket0 | |-- device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:02:00.0 | `-- driver -> ../../../bus/pci/drivers/yenta_cardbus `-- pcmcia_socket1 |-- device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:02:00.1 `-- driver -> ../../../bus/pci/drivers/yenta_cardbus
2005-04-26[PATCH] udev - safer string handling - part fourkay.sievers@vrfy.org1-7/+8
Mainly a cleanup of the earlier patches with a few missing pieces and some cosmetical changes. I've moved the udev_init_config() to very early init, otherwise we don't get any logging for the processing of the input. What would I do without gdb :) Greg, it's the 7th patch in your box to apply. I will stop now and wait for you :)
2005-04-26[PATCH] udev - safer string handling - part threekay.sievers@vrfy.org1-28/+2
Here we truncate our input strings from the environment to our defined limit. It's a bit theroretical but better check for it. It cleans up some magic length definitions and removes the code duplication in udev, udevtest and udevsend. udevd needs to be killed after installation, cause the message size is changed with this patch. Should we do this with the 'make install', like we do with the '.udevdb'?
2005-04-26[PATCH] udev - allow all files in a directory as the configkay.sievers@vrfy.org1-2/+6
I was on the train for 5 hours today and the TODO is almost empty :) So, at least four people wanted this feature, then here is a actual working patch. We may specify now in udev.conf: udev_rules="/etc/udev/" and udev will scan the whole directory for files ending with *.rules, sort it in lexical order and create our rule list from all of the files. A plain given file will still work and the same applies to the *.permissions. I sort the files in our usual linked list, cause klibc has no scandir().
2005-04-26[PATCH] force udev to include the internal version of libsysfs and never the ↵greg@kroah.com1-1/+1
external one. Should fix some more build bugs...
2005-04-26[PATCH] udev use new libsysfs header file locationpatmans@us.ibm.com1-1/+1
Use the new location of libsysfs header files.
2005-04-26[PATCH] add udevtest program to buildgreg@kroah.com1-1/+1
Also fix up some other dependancy issues in the Makefile. Thanks to Olaf Hering <olh@suse.de> for pointing them out.
2005-04-26[PATCH] more logging.h cleanups to be a bit more flexible.greg@kroah.com1-3/+12
2005-04-26[PATCH] compile udevd with klibckay.sievers@vrfy.org1-4/+6
On Mon, Feb 09, 2004 at 05:41:15AM +0100, Kay Sievers wrote: > It seems that today was just another udev-sunday for me :) > > Here is a working patch to compile udevd with klibc. > > It's sweet the static binary takes 6 kbytes and it runs > with only 80 kbytes virtual memory. > > I changed a few peaces and added a siginterrupt.c file to klibc. > We may check with hpa to get the changes upstream? So here is the next try :) hpa, for good reason, didn't like my changes to klibc. He will dump signal() completely from klibc instead, so here we switch to sigaction() and keep udevd working with klibc.
2005-04-26[PATCH] fix log option code so that it actually works for all udev programs.greg@kroah.com1-0/+5
Also introduce boolean type for config file to use.
2005-04-26[PATCH] rework the logging code so that each program logs with the proper ↵greg@kroah.com1-0/+2
name in the syslog.
2005-04-26[PATCH] udevd - next round of fixeskay.sievers@vrfy.org1-2/+0
Here is the next round. We have three queues now. All incoming messages are queued in msg_list and if nothing is missing we move it to the running_list and exec in the background. If the exec comes back, it removes the message from the running_list and frees the message. Before we exec, we check the running_list if there is a udev running on the same device path. If yes, we move the message to the delay_list. If the former exec comes back, we move the message to the running_list and exec it. The very first event is delayed now to catch possible earlier sequences, every following event is executed without delay if no sequence is missing. The daemon doesn't exit by itself any longer, cause we don't want to delay every first exec. I've put a $(PWD) for now in the Makefile for testing this beast. Only the local binaries are executed, not the /sbin/udev. We can change it if we are ready for real testing. And SIGKILL can't be cought, so I removed it from the handler :) 06:58:36 sig_handler: caught signal 15 06:58:36 main: using ipc queue 0x2d548 06:58:37 message is still in the ipc queue, starting daemon... 06:58:37 work: received sequence 3, expected sequence 0 06:58:37 msg_dump_queue: sequence 3 in queue 06:58:37 set_timeout: set timeout in 1 seconds 06:58:37 main: using ipc queue 0x2d548 06:58:37 main: using ipc queue 0x2d548 06:58:37 work: received sequence 1, expected sequence 1 06:58:37 msg_dump_queue: sequence 1 in queue 06:58:37 msg_dump_queue: sequence 3 in queue 06:58:37 msg_dump: sequence 1, 'add', '/block/sda', 'block' 06:58:37 msg_exec: child [8038] created 06:58:37 running_moveto_queue: move sequence 1 [8038] to running queue '/block/sda' 06:58:37 set_timeout: set timeout in 5 seconds 06:58:37 work: received sequence 2, expected sequence 2 06:58:37 msg_dump_queue: sequence 2 in queue 06:58:37 msg_dump_queue: sequence 3 in queue 06:58:37 msg_dump: sequence 2, 'add', '/block/sdb', 'block' 06:58:37 msg_exec: child [8039] created 06:58:37 running_moveto_queue: move sequence 2 [8039] to running queue '/block/sdb' 06:58:37 msg_dump: sequence 3, 'add', '/block/sdc', 'block' 06:58:37 msg_exec: child [8040] created 06:58:37 running_moveto_queue: move sequence 3 [8040] to running queue '/block/sdc' 06:58:37 main: using ipc queue 0x2d548 06:58:37 main: using ipc queue 0x2d548 06:58:37 work: received sequence 4, expected sequence 4 06:58:37 msg_dump_queue: sequence 4 in queue 06:58:37 msg_dump: sequence 4, 'remove', '/block/sdc', 'block' 06:58:37 msg_exec: delay exec of sequence 4, [8040] already working on '/block/sdc' 06:58:37 delayed_moveto_queue: move event to delayed queue '/block/sdc' 06:58:37 msg_exec: child [8043] created 06:58:37 running_moveto_queue: move sequence 4 [8043] to running queue '/block/sdc' 06:58:37 work: received sequence 5, expected sequence 5 06:58:37 msg_dump_queue: sequence 5 in queue 06:58:37 msg_dump: sequence 5, 'remove', '/block/sdb', 'block' 06:58:37 msg_exec: delay exec of sequence 5, [8039] already working on '/block/sdb' 06:58:37 delayed_moveto_queue: move event to delayed queue '/block/sdb' 06:58:37 msg_exec: child [8044] created 06:58:37 running_moveto_queue: move sequence 5 [8044] to running queue '/block/sdb' 06:58:37 main: using ipc queue 0x2d548 06:58:37 main: using ipc queue 0x2d548 06:58:37 work: received sequence 8, expected sequence 6 06:58:37 msg_dump_queue: sequence 8 in queue 06:58:37 set_timeout: set timeout in 5 seconds 06:58:37 work: received sequence 6, expected sequence 6 06:58:37 msg_dump_queue: sequence 6 in queue 06:58:37 msg_dump_queue: sequence 8 in queue 06:58:37 msg_dump: sequence 6, 'remove', '/block/sda', 'block' 06:58:37 msg_exec: delay exec of sequence 6, [8038] already working on '/block/sda' 06:58:37 delayed_moveto_queue: move event to delayed queue '/block/sda' 06:58:37 msg_exec: child [8047] created 06:58:37 running_moveto_queue: move sequence 6 [8047] to running queue '/block/sda' 06:58:37 set_timeout: set timeout in 5 seconds 06:58:38 sig_handler: caught signal 17 06:58:38 sig_handler: exec finished, pid 8038 06:58:38 set_timeout: set timeout in 4 seconds 06:58:38 msg_dump_queue: sequence 8 in queue 06:58:38 sig_handler: caught signal 17 06:58:38 sig_handler: exec finished, pid 8039 06:58:38 set_timeout: set timeout in 4 seconds 06:58:38 msg_dump_queue: sequence 8 in queue 06:58:38 sig_handler: caught signal 17 06:58:38 sig_handler: exec finished, pid 8040 06:58:38 set_timeout: set timeout in 4 seconds 06:58:38 msg_dump_queue: sequence 8 in queue 06:58:38 sig_handler: caught signal 17 06:58:38 sig_handler: exec finished, pid 8043 06:58:38 set_timeout: set timeout in 4 seconds 06:58:38 msg_dump_queue: sequence 8 in queue 06:58:38 sig_handler: caught signal 17 06:58:38 sig_handler: exec finished, pid 8044 06:58:38 set_timeout: set timeout in 4 seconds 06:58:38 msg_dump_queue: sequence 8 in queue 06:58:38 sig_handler: caught signal 17 06:58:38 sig_handler: exec finished, pid 8047 06:58:38 set_timeout: set timeout in 4 seconds 06:58:38 msg_dump_queue: sequence 8 in queue 06:58:39 main: using ipc queue 0x2d548 06:58:39 main: using ipc queue 0x2d548 06:58:39 work: received sequence 9, expected sequence 7 06:58:39 msg_dump_queue: sequence 8 in queue 06:58:39 msg_dump_queue: sequence 9 in queue 06:58:39 set_timeout: set timeout in 3 seconds 06:58:39 work: received sequence 11, expected sequence 7 06:58:39 msg_dump_queue: sequence 8 in queue 06:58:39 msg_dump_queue: sequence 9 in queue 06:58:39 msg_dump_queue: sequence 11 in queue 06:58:39 set_timeout: set timeout in 3 seconds 06:58:39 main: using ipc queue 0x2d548 06:58:39 work: received sequence 10, expected sequence 7 06:58:39 msg_dump_queue: sequence 8 in queue 06:58:39 msg_dump_queue: sequence 9 in queue 06:58:39 msg_dump_queue: sequence 10 in queue 06:58:39 msg_dump_queue: sequence 11 in queue 06:58:39 set_timeout: set timeout in 3 seconds 06:58:39 main: using ipc queue 0x2d548 06:58:39 work: received sequence 13, expected sequence 7 06:58:39 msg_dump_queue: sequence 8 in queue 06:58:39 msg_dump_queue: sequence 9 in queue 06:58:39 msg_dump_queue: sequence 10 in queue 06:58:39 msg_dump_queue: sequence 11 in queue 06:58:39 msg_dump_queue: sequence 13 in queue 06:58:39 set_timeout: set timeout in 3 seconds 06:58:39 main: using ipc queue 0x2d548 06:58:39 work: received sequence 14, expected sequence 7 06:58:39 msg_dump_queue: sequence 8 in queue 06:58:39 msg_dump_queue: sequence 9 in queue 06:58:39 msg_dump_queue: sequence 10 in queue 06:58:39 msg_dump_queue: sequence 11 in queue 06:58:39 msg_dump_queue: sequence 13 in queue 06:58:39 msg_dump_queue: sequence 14 in queue 06:58:39 set_timeout: set timeout in 3 seconds 06:58:39 main: using ipc queue 0x2d548 06:58:39 work: received sequence 15, expected sequence 7 06:58:39 msg_dump_queue: sequence 8 in queue 06:58:39 msg_dump_queue: sequence 9 in queue 06:58:39 msg_dump_queue: sequence 10 in queue 06:58:39 msg_dump_queue: sequence 11 in queue 06:58:39 msg_dump_queue: sequence 13 in queue 06:58:39 msg_dump_queue: sequence 14 in queue 06:58:39 msg_dump_queue: sequence 15 in queue 06:58:39 set_timeout: set timeout in 3 seconds 06:58:41 main: using ipc queue 0x2d548 06:58:41 work: received sequence 12, expected sequence 7 06:58:41 msg_dump_queue: sequence 8 in queue 06:58:41 msg_dump_queue: sequence 9 in queue 06:58:41 msg_dump_queue: sequence 10 in queue 06:58:41 msg_dump_queue: sequence 11 in queue 06:58:41 msg_dump_queue: sequence 12 in queue 06:58:41 msg_dump_queue: sequence 13 in queue 06:58:41 msg_dump_queue: sequence 14 in queue 06:58:41 msg_dump_queue: sequence 15 in queue 06:58:41 set_timeout: set timeout in 1 seconds 06:58:42 sig_handler: caught signal 14 06:58:42 sig_handler: event timeout reached 06:58:42 event 8, age 5 seconds, skip event 7-7 06:58:42 msg_dump: sequence 8, 'add', '/block/sdb', 'block' 06:58:42 msg_exec: child [8057] created 06:58:42 running_moveto_queue: move sequence 8 [8057] to running queue '/block/sdb' 06:58:42 msg_dump: sequence 9, 'add', '/block/sdc', 'block' 06:58:42 msg_exec: child [8058] created 06:58:42 running_moveto_queue: move sequence 9 [8058] to running queue '/block/sdc' 06:58:42 msg_dump: sequence 10, 'remove', '/block/sdc', 'block' 06:58:42 msg_exec: delay exec of sequence 10, [8058] already working on '/block/sdc' 06:58:42 delayed_moveto_queue: move event to delayed queue '/block/sdc' 06:58:42 msg_exec: child [8059] created 06:58:42 running_moveto_queue: move sequence 10 [8059] to running queue '/block/sdc' 06:58:42 msg_dump: sequence 11, 'remove', '/block/sdb', 'block' 06:58:42 msg_exec: delay exec of sequence 11, [8057] already working on '/block/sdb' 06:58:42 delayed_moveto_queue: move event to delayed queue '/block/sdb' 06:58:42 msg_exec: child [8060] created 06:58:42 running_moveto_queue: move sequence 11 [8060] to running queue '/block/sdb' 06:58:42 msg_dump: sequence 12, 'remove', '/block/sda', 'block' 06:58:42 msg_exec: child [8061] created 06:58:42 running_moveto_queue: move sequence 12 [8061] to running queue '/block/sda' 06:58:42 msg_dump: sequence 13, 'add', '/block/sda', 'block' 06:58:42 msg_exec: delay exec of sequence 13, [8061] already working on '/block/sda' 06:58:42 delayed_moveto_queue: move event to delayed queue '/block/sda' 06:58:42 msg_exec: child [8062] created 06:58:42 running_moveto_queue: move sequence 13 [8062] to running queue '/block/sda' 06:58:42 msg_dump: sequence 14, 'add', '/block/sdb', 'block' 06:58:42 msg_exec: delay exec of sequence 14, [8057] already working on '/block/sdb' 06:58:42 delayed_moveto_queue: move event to delayed queue '/block/sdb' 06:58:42 msg_exec: child [8063] created 06:58:42 running_moveto_queue: move sequence 14 [8063] to running queue '/block/sdb' 06:58:42 msg_dump: sequence 15, 'add', '/block/sdc', 'block' 06:58:42 msg_exec: delay exec of sequence 15, [8058] already working on '/block/sdc' 06:58:42 delayed_moveto_queue: move event to delayed queue '/block/sdc' 06:58:42 msg_exec: child [8064] created 06:58:42 running_moveto_queue: move sequence 15 [8064] to running queue '/block/sdc' 06:58:43 sig_handler: caught signal 17 06:58:43 sig_handler: exec finished, pid 8057 06:58:43 sig_handler: exec finished, pid 8058 06:58:43 sig_handler: caught signal 17 06:58:43 sig_handler: exec finished, pid 8059 06:58:43 sig_handler: caught signal 17 06:58:43 sig_handler: exec finished, pid 8060 06:58:43 sig_handler: exec finished, pid 8061 06:58:43 sig_handler: caught signal 17 06:58:43 sig_handler: exec finished, pid 8062 06:58:43 sig_handler: caught signal 17 06:58:43 sig_handler: exec finished, pid 8063 06:58:43 sig_handler: caught signal 17 06:58:43 sig_handler: exec finished, pid 8064
2005-04-26[PATCH] rip out command line code from udev, now that we have udevinfo.greg@kroah.com1-221/+12
2005-04-26[PATCH] udev - reverse user query optionskay.sievers@vrfy.org1-31/+67
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[PATCH] add udev logging to info logkay.sievers@vrfy.org1-0/+1
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[PATCH] add usb_host and pci_bus to the class blacklist.greg@kroah.com1-0/+2
2005-04-26[PATCH] Cset exclude: greg@kroah.com|ChangeSet|20040113010256|48515greg@kroah.com1-1/+2
2005-04-26[PATCH] Fix stupid gcc "optimization" of 1 character printk() calls.... Ick...greg@kroah.com1-2/+1
2005-04-26[PATCH] more advanced user query optionskay.sievers@vrfy.org1-7/+32
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:
2005-04-26[PATCH] udev - advanced user query optionskay.sievers@vrfy.org1-16/+93
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
2005-04-26[PATCH] udev 012 old gcc fixuptiggi@infa.abo.fi1-1/+1
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.
2005-04-26[PATCH] add IGNORE rule typechristophe@saout.de1-0/+3
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.
2005-04-26[PATCH] small cleanupchristophe@saout.de1-1/+1
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?
2005-04-26[PATCH] add a blacklist of class devices we do not want to look at.greg@kroah.com1-4/+16
Thanks to Kay for the original patch, and the idea.
2005-04-26[PATCH] mention user callable udev + options in man pagekay.sievers@vrfy.org1-1/+1
As usual, here is the corresponding man page update and a small text correction.
2005-04-26[PATCH] make udev user callable to query the databasekay.sievers@vrfy.org1-13/+82
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
2005-04-26[PATCH] move the signal handling registration to after we have initialized ↵greg@kroah.com1-4/+5
enough stuff.
2005-04-26[PATCH] introduce signal handlermbuesch@freenet.de1-1/+22
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.
2005-04-26[PATCH] proper cleanup on udevdb_init() failurembuesch@freenet.de1-1/+2
Seems like we need the following patch to do proper sysbus cleanup, if udevdb_init() fails.
2005-04-26[PATCH] move all of the DBUS logic into one file and remove all of the ↵greg@kroah.com1-63/+6
#ifdef crud from the main code.
2005-04-26[PATCH] D-BUS patch for udev-008david@fubar.dk1-0/+64
Attached is a patch against udev-008 to send out a D-BUS message when a device node is added or removed. Using D-BUS lingo, udev acquires the org.kernel.udev service and sends out a NodeCreated or NodeDeleted signal on the org.kernel.udev.NodeMonitor interface. Each signal carries two parameters: the node in question and the corresponding sysfs path. [Note: the D-BUS concepts of service, interface, object can be a bit confusing at first glance] An example program listening for these messages looks like this #!/usr/bin/python import dbus import gtk def udev_signal_received(dbus_iface, member, service, object_path, message): [filename, sysfs_path] = message.get_args_list() if member=='NodeCreated': print 'Node %s created for %s'%(filename, sysfs_path) elif member=='NodeDeleted': print 'Node %s deleted for %s'%(filename, sysfs_path) def main(): bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM) bus.add_signal_receiver(udev_signal_received, 'org.kernel.udev.NodeMonitor', # interface 'org.kernel.udev', # service '/org/kernel/udev/NodeMonitor') # object gtk.mainloop() if __name__ == '__main__': main() and this is the output when hot-plugging some usb-storage. [david@laptop udev-008]$ ~/node_monitor.py Node /udev/sda created for /block/sda Node /udev/sda1 created for /block/sda/sda1 Node /udev/sda1 deleted for /block/sda/sda1 Node /udev/sda deleted for /block/sda The patch requires D-BUS 0.20 or later while the python example program requires D-BUS from CVS as I only recently applied a patch against the python bindings.
2005-04-26[PATCH] get rid of the majority of the debug environment variables.greg@kroah.com1-10/+0
Now there are only 3 valid environment test variables. The rest can be specified with the config file.
2005-04-26[PATCH] add support for a main udev config file, udev.conf.greg@kroah.com1-51/+9
the older udev.config file is now called udev.rules. This allows us to better control configuration values, and move away from the environment variables.
2005-04-26[PATCH] changed the default location of the database to /udev/.udev.tdb to ↵greg@kroah.com1-1/+1
be LSB compliant Finally the Debian people can get off my back...
2005-04-26[PATCH] overall whitespace + debug text conditioningkay.sievers@vrfy.org1-6/+5
01-overall-whitespace+debug-text-conditioning.diff o cleanup whitespace o clarify a few comments o enclose all printed debug string values in ''
2005-04-26[PATCH] change UDEV_SYSFS_PATH environment variable due to libsysfs change.greg@kroah.com1-1/+1
2005-04-26[PATCH] rename namedev.permissions and namedev.config to udev.permissions ↵greg@kroah.com1-2/+2
and udev.config the namedev name didn't really make much sense anymore...
2005-04-26[PATCH] more overrides of config info with env variables if in test mode.greg@kroah.com1-21/+34
2005-04-26[PATCH] make config files, sysfs root, and udev root configurable from ↵greg@kroah.com1-16/+66
config variables This will make running tests a lot simpler.
2005-04-26[PATCH] add version to debug log on startup.greg@kroah.com1-0/+2
2005-04-26[PATCH] add callout config type to udevpatmans@us.ibm.com1-1/+7
This patch adds a callout config type to udev, so external programs can be called to get serial numbers or id's that are not available as a sysfs attribute.
2005-04-26[PATCH] udevdb patchdsteklof@us.ibm.com1-5/+16
This patch: 1) removes the three database files for just one udevdb.tdb file. 2) adds udevdb_init() and udevdb_exit() functions 3) initializes database now in main() in udev.c. Please look it over.
2005-04-26[PATCH] split udev main logic into udev-add and udev-remove.greg@kroah.com1-220/+14
2005-04-26[PATCH] Clean up the namedev interface a bit, making the code smaller...greg@kroah.com1-83/+86
2005-04-26[PATCH] add initial libsysfs support...greg@kroah.com1-6/+12
needs lots more cleanup, but is much nicer than doing this by hand...
2005-04-26[PATCH] Initial namedev parsing of config filesgreg@kroah.com1-0/+3
.permission parsing works, .config needs more work.
2005-04-26[PATCH] sleep for 2 seconds to give the kernel a chance to actually create ↵greg@kroah.com1-0/+5
the files we need.
2005-04-26[PATCH] remove now works!greg@kroah.com1-5/+32
2005-04-26[PATCH] restructure code to be able to actually get remove_node() to work.greg@kroah.com1-38/+39
2005-04-26[PATCH] Creating nodes actually works.greg@kroah.com1-10/+197
2005-04-26added initial files.Greg KH1-0/+83