1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-11-01 09:21:11 +03:00
Commit Graph

137 Commits

Author SHA1 Message Date
Kay Sievers
254d6d3ca2 handle dynamic rules created in /dev/.udev/rules.d/ 2007-07-15 19:10:06 +02:00
Kay Sievers
e2ecb34ffd move udev_utils_run.c into udev_rules.c 2007-07-14 20:59:03 +02:00
Kay Sievers
fb819f5554 use global udev_log variable instead of parameter in run_program 2007-07-14 20:43:43 +02:00
Kay Sievers
4110664d4f add option to RUN key to ignore the return value of the program 2007-07-14 20:43:01 +02:00
Kay Sievers
953249a3a0 add TEST=="<file>" key 2007-06-03 00:01:46 +02:00
Kay Sievers
c19870519d replace_chars: replace % character 2007-05-21 07:59:40 +02:00
Kay Sievers
2f2c4fa442 replace_chars: replace spaces in node name 2007-05-17 20:01:54 +02:00
Kay Sievers
05610c088e udev_db: escape path names with \x00 instead of %00 2007-05-16 19:51:13 +02:00
Kay Sievers
db6e59df56 unset variable with ENV{VAR}="" 2007-04-25 01:52:00 +02:00
Kay Sievers
24f0605c1f priority based symlink handling
Symlinks can have priorities now, the priority is assigned to the device
and specified with OPTIONS="link_priority=100". Devices with higher
priorities overwrite the symlinks of devices with lower priorities.
If the device, that currently owns the link goes away, the symlink
will be removed, and recreated, pointing to the next device with the
highest actual priority.

This should solve the issue, that inserting an USB-stick may overwrite the
/dev/disk/by-id/-link of another disk, and removes the entire link after the
USB-stick is disconnected. If no priorities are specified, the new link will
overwrite the current one, and if the device goes away, it will restore
the old link. It should be possible to assign lower priorities to removable
devices, if needed.

In multipath setups, we see several devices, which all connect to the same
volume, and therefore all try to create the same metadata-links. The
different path-devices are combined into one device-mapper device, which also
contains the same metadata. It should be possible, to assign multipath-table
device-mapper devices a higher priority, so path-devices that appear and
disappear, will not overwrite or delete the device-mapper device links.
2007-03-18 12:51:57 +01:00
Kay Sievers
31de3a2ba1 read list of devices from index, make index private to database 2007-03-17 10:08:25 +01:00
Kay Sievers
2dbb47f860 add link_priority to rule options, and store it in database 2007-03-16 15:16:08 +01:00
Kay Sievers
fbda4babec maintain index over device-names to devpath relation 2007-03-15 02:09:39 +01:00
Kay Sievers
9c6ad9fbba encode db-file names, instead of just replacing '/' 2007-03-14 21:41:33 +01:00
Kay Sievers
9dd0c2573b rename config "filename" to "dir" 2006-12-08 09:48:53 +01:00
Kay Sievers
82c60ce572 udev_sysfs: unify symlink resolving 2006-09-19 17:46:04 +02:00
Kay Sievers
27b77df44d update source file headers 2006-08-28 00:29:11 +02:00
Kay Sievers
cea61f5c03 use fnmatch() instead of our own pattern match code 2006-08-24 09:03:15 +02:00
Kay Sievers
3a020a85da remove built-in /etc/passwd /etc/group parser 2006-08-20 18:25:57 +02:00
Kay Sievers
95776dc6ec consistent key naming to match only the event device or include all parent devices
This scheme is more consistent and makes it obvious if a match happens
against the event device only, or the full chain of parent devices.

The old key names are now:
  BUS -> SUBSYSTEMS
  ID -> KERNELS
  SYSFS -> ATTRS
  DRIVER -> DRIVERS

Match keys for the event device:
  KERNEL
  SUBSYSTEM
  ATTR
  DRIVER (in a future release, for now the same as DRIVERS)

Match keys for all devices along the parent device chain:
  KERNELS
  SUBSYSTEMS
  ATTRS
  DRIVERS

ID, BUS, SYSFS are no longer mentioned in the man page but still work.
DRIVER must be converted to DRIVERS to match the new scheme. For now,
an error is logged, if DRIVER is used. In a future release, the DRIVER
key behaviour will change.
2006-08-19 16:06:25 +02:00
Kay Sievers
dbd16d2684 rename udev_libc_wrapper -> udev_sysdeps 2006-08-16 02:04:04 +02:00
Kay Sievers
254efc14a4 udevd: read DRIVER from the environment 2006-08-13 05:32:09 +02:00
Kay Sievers
989e081131 allow longer devpath values 2006-07-06 13:49:43 +02:00
Kay Sievers
7ba2d2e6ae apply format char to variables exported by ENV 2006-04-15 19:32:05 +02:00
Kay Sievers
ff9a488d8c remove old symlinks before creating current ones
This will prevent incorrect symlinks when a filesystem
label is changed and the event is triggered again from
sysfs.
2006-04-12 22:08:05 +02:00
Kay Sievers
a4d5ca644e merge device event handling and make database content available on "remove" 2006-04-05 22:29:33 +02:00
Kay Sievers
34f55103c5 optimize sysfs device and attribute cache
Add negative cache for attributes and look for device in cache before doing
any sysfs access. (Three times speed up for a stupid 1000 rules SYSFS file).

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-29 02:09:35 +01:00
Kay Sievers
6ecd4d1e36 scsi_id, usb_id: request device parent by subsystem
Request specific parents identified by subsystem and don't rely on
a predefined sequence.
Also let the devpath be longer than 72 chars, tsss ...

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-18 04:24:48 +01:00
Kay Sievers
03b24b71e0 fix BUS, ID, $id usage
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-16 06:12:49 +01:00
Kay Sievers
d548032795 better log test and comments
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-13 13:17:10 +01:00
Kay Sievers
1aa1e24848 replace libsysfs
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>
2006-01-09 21:18:00 +01:00
Kay Sievers
fb6e4c2824 add DEVLINKS to the event environment
Multiple symlinks are separated by a space character.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-12-17 16:20:51 +01:00
Kay Sievers
632b682b2a remove unused variables
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-12-16 21:00:14 +01:00
Kay Sievers
fc55cf68ca remove "udev_db" option from config file
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-11-16 04:14:15 +01:00
Kay Sievers
c86be870ce remove all built-in wait_for_sysfs logic
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-12 04:17:48 +01:00
Kay Sievers
0b3dfb3d72 udevd: depend on netlink and remove all sequence reorder logic
Netlink will never get out-of-order and we just depend on it from
now on. Udevsend messages will have no effect if they contain a
sequence number (SEQNUM).

Thanks to Bastian Blank <waldi@debian.org>, for the debugging session
which identified a bug where the timeouts are not working if
inotify was not available. All the timeout handling is removed
now and this issue should be solved.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-07 02:22:44 +01:00
Kay Sievers
e8d569b414 move code to its own files
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-22 12:35:58 -04:00
Kay Sievers
613ffbeb15 fix default-name handling and NAME="" rules
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-07 22:32:48 +02:00
Kay Sievers
8815afa1df rename ALARM_TIMEOUT to UDEV_ALARM_TIMEOUT
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-06 14:42:26 +02:00
Kay Sievers
b8476286d6 store the imported device information in the udevdb
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-26 18:55:24 +02:00
Kay Sievers
c07669bd66 udev: handle all events - not only class and block devices
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-05 15:55:29 +02:00
Kay Sievers
6a522681e1 udev: move dev.d/ handling to external helper
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-05 05:11:29 +02:00
Kay Sievers
c974742bf4 udev: allow final assignments :=
The use of KEY:=<value> will make the key unchangeable by later rules.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05 04:57:03 +02:00
kay.sievers@vrfy.org
821d0ec803 [PATCH] add RUN key to be able to run rule based notification
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 23:55:00 -07:00
kay.sievers@vrfy.org
6b493a20e1 [PATCH] support log-priority levels in udev.conf 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
e6764498e7 [PATCH] correct enum device_type 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
63f61c5cf6 [PATCH] replace strncpy()/strncat() by strlcpy()/strlcat() 2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
e48fc108d9 [PATCH] allow unlimitied count of symlinks 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
f0308095c7 [PATCH] remove typedef for call_foreach_file() handler function 2005-04-26 23:39:48 -07:00
kay.sievers@vrfy.org
03cfa1394f [PATCH] correct udev_init_device 2005-04-26 23:39:48 -07:00