summaryrefslogtreecommitdiff
path: root/namedev.c
AgeCommit message (Collapse)Author
2005-04-26[PATCH] replace weird defines by real codekay.sievers@vrfy.org
2005-04-26[PATCH] allow unlimitied count of symlinkskay.sievers@vrfy.org
2005-04-26[PATCH] trivial clenaup of namedev codekay.sievers@vrfy.org
2005-04-26[PATCH] trivial rename of some variableskay.sievers@vrfy.org
2005-04-26[PATCH] determine device type in udev_init_device()kay.sievers@vrfy.org
2005-04-26[PATCH] move kernel name/number evaluation into udev_init_device()kay.sievers@vrfy.org
2005-04-26[PATCH] detect NAME="" as ignore_device rulekay.sievers@vrfy.org
2005-04-26[PATCH] trivial namedev cleanupkay.sievers@vrfy.org
2005-04-26[PATCH] cleanup db functionskay.sievers@vrfy.org
2005-04-26[PATCH] clean up match_place()kay.sievers@vrfy.org
2005-04-26[PATCH] switch device type to enumkay.sievers@vrfy.org
2005-04-26[PATCH] switch major/minor to dev_tkay.sievers@vrfy.org
2005-04-26[PATCH] introduce OPTIONS=ignore_device, ignore_remove, all_partitions" keykay.sievers@vrfy.org
Here we move all possible options into a own key to make it possible to have options-only rules. The options on the NAME key are removed from the man page and will be removed from a future version of udev. For ignore rules, OPTIONS="ignore" should be used. The rule: SUBSYSTEM="block", SYSFS{removable}="1", OPTIONS="all_partitions" will create all partitions for a block device which is known to have removable media (a check for cdrom drives would be needed too).
2005-04-26[PATCH] namedev: execute PROGRAM only once and not possibly for every ↵kay.sievers@vrfy.org
physical device
2005-04-26[PATCH] namedev: move some matches out of the parent loopkay.sievers@vrfy.org
2005-04-26[PATCH] namedev: if SUBSYSTEM or KERNEL key doesn't match, give up immediatelykay.sievers@vrfy.org
We don't need to look at the parents in the device chain. There will never be another kernel name or subsystem.
2005-04-26[PATCH] add %P modifier to query the node name of the parent devicekay.sievers@vrfy.org
Events for partition devies may want to read the main block device name to compose it's own name or read a disklabel from the main device. SUBSYSTEM="block", KERNEL="*[1-9]", NAME="%P-p%n" will append the partition number to the name of the main block device.
2005-04-26[PATCH] provide temporary device node for callouts to access the devicekay.sievers@vrfy.org
%N will create a temporary node for a callout a be sustituted with the name of the node.
2005-04-26[PATCH] namdev: allow symlink-only rules to specify node permissionsmbuesch@freenet.de
First case without the patch: KERNEL="hd*", GROUP="disk", MODE="0660" KERNEL="hdc", SYMLINK="cdrecorder", MODE="0666" brw-rw---- 1 root disk 22, 0 Feb 5 14:08 /dev/hdc Second case without the patch: KERNEL="hd*", GROUP="disk", MODE="0660" KERNEL="hdc", MODE="0666" brw-rw-rw- 1 root disk 22, 0 Feb 5 14:08 /dev/hdc
2005-04-26[PATCH] correct log statementkay.sievers@vrfy.org
2005-04-26[PATCH] allow permissions only ruleskay.sievers@vrfy.org
On Mon, 2004-12-20 at 15:03 +0100, Marco d'Itri wrote: > +# all block devices > > +SUBSYSTEM="block", NAME="%k", GROUP="disk" > > + > NAME="%k" here and in similar rules does not add any new information, > what about making it optional, like it is for SYMLINK-only rules?
2005-04-26[PATCH] simplify permission applicationkay.sievers@vrfy.org
We have only one source of permissions now, so apply the default permissions at udev init.
2005-04-26[PATCH] complete removal of explicit udev permissions config filekay.sievers@vrfy.org
2005-04-26[PATCH] restore OWNER/GROUP assignment in rule coming from RESULTkay.sievers@vrfy.org
2005-04-26[PATCH] remove unused timestamp fieldkay.sievers@vrfy.org
2005-04-26[PATCH] simplify permission handlingkay.sievers@vrfy.org
Initialize the defaults in udev_config.c instead of namedev.c. Replace macro by expanded code. Switch to mode_t instead of string value. Add and clarify some comments.
2005-04-26[PATCH] remove unused variableskay.sievers@vrfy.org
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-26more fixupsGreg KH
2005-04-26[PATCH] rename udev_lib to udev_utils and dev_d to udev_multiplexkay.sievers@vrfy.org
2005-04-26[PATCH] Allow GROUP to have modifiers in itsschweizer@gmail.com
2005-04-26[PATCH] add NAME{ignore_remove} attributekay.sievers@vrfy.org
Some broken ide drivers are generating high event traffic, with add/remove events. With this attribute, it can be specified, that the node is always available. It may be used in conjunction with the new DRIVER= match to catch specific kernel device drivers.
2005-04-26[PATCH] support DRIVER as a rule keykay.sievers@vrfy.org
Match with a rule against a device with a specific kernel driver.
2005-04-26[PATCH] support SUBSYSTEM as a rule keykay.sievers@vrfy.org
This should make it easier to catch e.g all block or net devices with a single rule.
2005-04-26[PATCH] rename udevdb* to udev_db*kay.sievers@vrfy.org
2005-04-26[PATCH] Make dev.d/ handling a separate processing stagekay.sievers@vrfy.org
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.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] 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] wait() for specific pid to return from fork().kay.sievers@vrfy.org
2005-04-26[PATCH] Apply the default permissions even if we found a entry inkay.sievers@vrfy.org
2005-04-26[PATCH] improve klibc fixup integrationkay.sievers@vrfy.org
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] remove sleeps from udev as it is external nowkay.sievers@vrfy.org
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] Problem parsing %s in udev rulesandrew.patterson@hp.com
> > > > That explains the spaces. What about stuff trailing %s, if %s does not > > > > contain spaces. I.e, in the above example, model is ST336753LC and the > > > > resulting device file is /dev/scsi_disks/some-proceding-stuff- > > > > ST336753LC. > > > > > > I expect the model value has trailing spaces. > > > > > > You may look with: > > > udevinfo -a -p /block/sdX > > > > Yes it does, and it seems for most SCSI devices, vendor and model will > > have trailing spaces. > > It all depends on the vendor and model :) > > > I have included a patch to udev-036 to deal with > > this issue. It trims off trailing whitespace for all sysfs attributes. > > It might be better to trim off leading whitespace as well. > > We already trim it off when matching, but we also allow matching if you > do put the spaces in there. This patch breaks that, right? Correct, I have a new patch that trims after the comparison, so it should work in both cases.
2005-04-26[PATCH] prevent deadlocks on an corrupt udev databasekay.sievers@vrfy.org
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] fix problems with dev.d and udevstartkay.sievers@vrfy.org
Here is the correction for the dev.d/ scripts too. We should pass the right argv[0] here too. A script may depend on the right value, as udev does with udev/udevstart. Here is the old version: [pid 4692] execve("/etc/dev.d/default/log.dev", ["./udev", "block"], [/* 41 vars */]) = 0 this the new one: [pid 9832] execve("/etc/dev.d/default/log.dev", ["/etc/dev.d/default/log.dev", "block"], [/* 41 vars */]) = 0
2005-04-26[PATCH] fix problems using scsi_id with udevstartkay.sievers@vrfy.org
when udevstart was running we didn't set the environment and the subsystem argument for the callouts the dev.d/ scripts. Here is a fix, that sets that with every udevstart iteration, corrects argv[0] to be the basename() only not the whole path and adds a test for invoking callouts without arguments.
2005-04-26[PATCH] PATCH udev close on execharald@redhat.com
selinux wants a clean fd set, so better close all open fds
2005-04-26[PATCH] udev parse bugharald@redhat.com
There is a bug parsing PROGRAMs after apostrophes. Try PROGRAM="/bin/echo 'test test".
2005-04-26[PATCH] fix udevstart badly broken in udev 031kay.sievers@vrfy.org
On Mon, 2004-09-13 at 01:56 +0200, Marco d'Itri wrote: > Starting from udev 031, the %-arguments passed to PROGRAMs are not > correct when the new udevstart code is being used. > > KERNEL="event[0-9]*", NAME="input/%k", PROGRAM="/etc/udev/inputdev.sh %k %n %M %m", RESULT="inputdev", MODE="0664", GROUP="video" > > generates this log (just echo $*): > > event0 0 13 64 > event0 0 13 64 > event0 0 13 64 > > while the correct log (generated using the old shell script instead of > udevstart) would be: > > event0 0 13 64 > event1 1 13 65 > event2 2 13 66 Yes, I can simulate this, please try the attached patch. I expect, that it fixes it, cause we better not mangle the parsed config while matching the rules.
2005-04-26[PATCH] compatibility symlinks for udevdavid@fubar.dk
On Mon, 2004-09-06 at 17:45 +0200, Kay Sievers wrote: > On Mon, 2004-09-06 at 16:46 +0200, David Zeuthen wrote: > > Nice, I like it. It's a easy way to group device nodes of the same type, > but coming from different kernel subsystems. > That's a good way of putting it, yeah. > > Here's a patch against udev-030 that can help create compatibility > > symlinks like /dev/cdrom, /dev/cdrom1 etc. The patch introduces a new > > substitution type %C (for Compatibility) that can be used as follows > > I suggest using %e for enumeration here, cause "compatibility" can > easily be misunderstood. > Good point, I've changed that. > And we need a few lines added to the man page at udev.8.in :) > Done. I've also added an example. Also, Kay pointed out offlist that the rules can be written to not require a shell script; this actually works KERNEL="sr*", NAME="%k", SYMLINK="cdrom%e" KERNEL="scd*", NAME="%k", SYMLINK="cdrom%e" KERNEL="pcd*", NAME="%k", SYMLINK="cdrom%e" KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom", NAME="\%k", SYMLINK="cdrom%e" KERNEL="fd[0-9]", NAME="%k", SYMLINK="floppy%e" KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="floppy", NAME=\"%k", SYMLINK="floppy%e" New patch is attached. David