1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-29 21:55:36 +03:00
Commit Graph

107 Commits

Author SHA1 Message Date
Kay Sievers
e2ecb34ffd move udev_utils_run.c into udev_rules.c 2007-07-14 20:59:03 +02:00
Kay Sievers
274da2b23d add udev_rules_run() to handle RUN list 2007-07-14 20:44:19 +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
3df3c93e25 allow to disable the replacement of unusual characters 2007-06-22 01:27:02 +02:00
Kay Sievers
956cf79390 make ATTR{[$SUBSYSTEM/$KERNEL]<attr>}="<value>" working 2007-06-10 23:53:40 +02:00
Kay Sievers
4ad47b2de6 add "[$SUBSYSTEM/$KERNEL]<attribute>" lookup 2007-06-03 12:29:46 +02:00
Kay Sievers
953249a3a0 add TEST=="<file>" key 2007-06-03 00:01:46 +02:00
Kay Sievers
5e9eb88f2f add $sys substitution 2007-06-02 22:06:01 +02:00
Kay Sievers
90a1e83a3b IMPORT: do not mangle whitespace 2007-05-21 08:00:09 +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
68ab3e137b don't create $tempnode for devices without major 2007-04-30 21:48:30 +02:00
Kay Sievers
db6e59df56 unset variable with ENV{VAR}="" 2007-04-25 01:52:00 +02:00
Kay Sievers
019d666907 udevinfo: export all information stored in database 2007-04-06 19:50:19 +02:00
Kay Sievers
81313e1b48 make ACTION!="add|change" working
Thanks to Scott for the suggestion.
2007-03-31 02:46:32 +02:00
Kay Sievers
d2c9a56e0e don't write to sysfs files during test run 2007-03-23 17:18:03 +01:00
Kay Sievers
eb5b86405b update %n on netif name change 2007-03-19 09:56:53 +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
4a7e6bcef0 update internal variables if we see $DEVPATH during IMPORT 2007-03-15 00:10:22 +01:00
Kay Sievers
6e82f66ea2 apply format chars to ATTR before writing to sysfs 2007-02-16 13:20:34 +01:00
Sergey Vlasov
c0c865d466 fix %c $string substitution
Fix udev_rules_apply_format() to give error messages for unknown
format elements and pass such elements to the output string
unmodified.

When truncating the substitution string to the length specified in the
format string, head[len] = '\0' could write outside the buffer if that
length was too large.
2007-02-01 20:18:52 +01:00
Kay Sievers
eef5447934 let $attr{symlink} return the last element of the path
Example for /block/sda:
  SUBSYSTEMS="scsi", ENV{COMMENT}="$attr{driver}"
sets COMMENT=sd
  SUBSYSTEMS="pci", ENV{COMMENT}="$attr{driver}"
sets COMMENT=ata_piix
2006-09-05 02:18:06 +02:00
Kay Sievers
ac528431dd fix ENV{TEST}="Test: $env{TEST}" 2006-09-05 00:50:25 +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
d0c8cb7d9c introduce ATTR{file}="value" to set sysfs attributes 2006-08-20 18:16:27 +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
c8ff4b3db4 remove broken %e enumeration 2006-07-04 12:27:00 +02:00
Kay Sievers
8912051213 remove MODALIAS key and substitution 2006-06-07 16:00:34 +02:00
Kay Sievers
3d6d12c6b1 vol_id: fix logging from libvolume_id's log function 2006-04-28 17:52:09 +02:00
Kay Sievers
d59c84effd allow NAME=="value" to check for already assigned value 2006-04-24 19:25:55 +02:00
Kay Sievers
7ba2d2e6ae apply format char to variables exported by ENV 2006-04-15 19:32:05 +02:00
Matt Kraai
00a074480e fix typo in error message 2006-04-11 19:35:52 +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
7910248926 warn about %e, MODALIAS, $modalias 2006-03-07 23:20:10 +01:00
Kay Sievers
656ba91ee1 exit WAIT_FOR_SYSFS if the whole device goes away
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-02-15 20:43:28 +01:00
Kay Sievers
f8db897faa make WAIT_FOR_SYSFS usable in non "wait-only" rules
Thanks to Andrey Borzenkov <arvidjaar@mail.ru> for noticing this
and the initial patch to fix it.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-31 16:24:22 +01:00
Kay Sievers
9538b16d8b let SYSFS{} look at the device, not only the parent device
The stricter parent logic broke: BUS=="ide", SYSFS{removable}=="1", ...
cause removable is on the block device, which isn't a ide device.
Just look for matching attributes at the device and the selected parent
device at the same time now.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-29 17:08:44 +01:00
Kay Sievers
2c02716281 remove redundant substitution of RUN key
Thanks to Andrey Borzenkov <arvidjaar@mail.ru> for the initial patch.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-27 01:40:26 +01:00
Kay Sievers
a9bd2ed84a rename apply_format() cause it is public now
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-25 01:28:31 +01:00
Andrey Borzenkov
f5f0c34f6d substitute format chars in RUN after rule matching
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-24 20:10: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
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
Marco d'Itri
ff3e4bed21 add strerror() to error logs 2005-11-07 18:44:18 +01:00
Olivier Blin
129979643f fix a debug text typo in udev_rules.c 2005-09-14 14:28:59 +02:00