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

128 Commits

Author SHA1 Message Date
Kay Sievers
c4edd0adb5 use new key names in test programs 2006-08-20 19:11:32 +02:00
Kay Sievers
38895e573c skip rule, if too may keys of the same type are used 2006-08-20 18:15:29 +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
d4ae9925ee don't report an error on overlong comment lines 2006-08-13 04:23:16 +02:00
Kay Sievers
c8ff4b3db4 remove broken %e enumeration 2006-07-04 12:27:00 +02:00
Kay Sievers
fa33d857e2 don't remove symlinks if they are already there
Consecutive "add" events will not remove and recreate the same symlinks
anymore. No longer valid links, like after changing a filesystem label,
will still be removed.
2006-06-14 16:32:52 +02:00
Kay Sievers
d59c84effd allow NAME=="value" to check for already assigned value 2006-04-24 19:25:55 +02:00
Kay Sievers
36af2ddcb9 don't add $SUBSYSTEM automatically as $1 to programs
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-26 04:38:33 +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
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
53899a171e fix tests and remove no longer useful stuff
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-10 01:50:06 +01:00
Kay Sievers
a8586078fc udev_test.pl: we replace untrusted chars with '_'
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-29 02:19:36 +02:00
Kay Sievers
764ce7f2ab start to enforce plain ascii or valid utf8
No device node or symlink can have other characters as plain
readable ascii or valid utf8. The /dev/disk/by-label/* symlinks
can no longer contain weird stuff read from untrusted sources.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-28 15:55:58 +02:00
Kay Sievers
5618b5611b ENV{TEST}=="1" compares and ENV{TEST}="1" sets the environment
This can be uses to export stuff to the event environment or
to carry a state from one rule to another, like enabling/disabling
later rules conditionally.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-16 04:25:20 +02:00
Kay Sievers
594dd61025 allow rules to have labels and skip to next label
This will allow us to have whole blocks of rules to skip
conditionally. The following section creates the node "yes":
  GOTO="TEST"
  NAME="no"
  NAME="no2", LABEL="NO"
  NAME="yes", LABEL="TEST"
  NAME="no3"
2005-07-16 07:46:31 +02:00
Kay Sievers
0bfb84e1ed IMPORT: add {parent} to import the persistent data of the parent device
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-12 14:46:36 +02:00
Kay Sievers
0cd4ac473a allow multiple values to be matched with KEY=="value1|value2"
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-12 12:52:56 +02:00
Kay Sievers
7b2bdb4b1b fix symlink values separated by multiple spaces
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-07 23:43:13 +02:00
Kay Sievers
a72e3f666b fix typo in group assignment
Thanks to: Georgi Georgiev
2005-07-07 22:40:09 +02:00
Kay Sievers
be0856c841 prepare RELEASE-NOTES
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-30 21:50:22 +02:00
Kay Sievers
319c670016 IMPORT allow to import program returned keys into the env
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-25 18:58:49 +02:00
Kay Sievers
bd0ed2ffbe IMPORT=<file> allow to import a shell-var style config-file
This allows to source-in a file into the udev environment to have
the defined keys available for later processing by udev itself or
the forked helper programs.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-25 13:10:16 +02:00
Kay Sievers
bf5d296473 prepare for module loading rules and add MODALIAS key
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-20 00:29:38 +02:00
Kay Sievers
995aec8759 udev: clear lists if a new value is assigned
Former values are cleared if SYMLINK=<value> is used. To add a value
SYMLINK+=<value> is now needed.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05 05:13:33 +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
Greg KH
1e50c2dee7 Update permissions on test scripts so they will run properly now.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-05-10 10:22:56 -07:00
tklauser@access.unizh.ch
15139b8a62 [PATCH] fix stupid all_partitions bug
> On Mon, 2005-04-11 at 14:55 +0200, Norbert Preining wrote:
> > On Mon, 11 Apr 2005, Kay Sievers wrote:
> > > > brw-rw----  1 root root 8, 0 2005-04-10 14:58 /dev/sdcard
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard1
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard2
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard3
> > > 
> > > This looks broken.
> > 
> > Good to hear.

Yeah, I guess it's broken. In create_node() in udev_add.c there is
always added 1 to the minor number, thus the error. The attached patch
should fix this.
2005-04-26 23:55:01 -07:00
kay.sievers@vrfy.org
f040a4a271 [PATCH] udev-test.pl: add test for DEVNAME export to RUN environment 2005-04-26 23:55:00 -07: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
db949b0248 [PATCH] allow to match against empty key values 2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
98bbc835f5 [PATCH] read %s{}-sysfs values at any device in the chain 2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
18614ab25d [PATCH] remove untrusted chars read from sysfs-values or returned by PROGRAM
Better remove characters that are useless in a device node name.
It may be a security risk to pass any character read from e.g. a
sysfs attribute to a shell script we execute later.
  
Prevent the modification of the libsysfs attribute value
cache.

Clear PROGRAM result if the execution encountered an error.
2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
65005a7f81 [PATCH] test-suite: remove UDEV_TEST, it's not needed anymore 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
0bb4387707 [PATCH] udev-test.pl: use more common user/group names 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
c827876312 [PATCH] udev-test.pl: add a test where the group cannot be found in /etc/passwd 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
9b434de102 [PATCH] udev-test.pl: add check for textual uid/gid 2005-04-26 23:53:54 -07:00
kay.sievers@vrfy.org
3e5958dee5 [PATCH] add ENV{} key to match agains environment variables 2005-04-26 23:53:18 -07:00
kay.sievers@vrfy.org
38285d23d7 [PATCH] add a test and simplify debug statement 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
28ce66de17 [PATCH] support =, ==, !=, += for the key match and assignment 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
3b6ed8bb06 [PATCH] add OPTION="last_rule" to skip any later rule 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
882af735ec [PATCH] remove PLACE key match
ID should do the same, cause we walk up the chain of devices on the
physical device and can match for the name of every device there with
the ID key.
2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
51015808da [PATCH] udev-test.pl: remove useless tests 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
77313cd0d1 [PATCH] namedev: skip backslashes only if followed by newline
Fix from: Hannes Reinecke <hare@suse.de>
namedev_parse is a bit overzealous when in comes to handling backspaces;
it always eats up backspaces regardless of anything beyond that. This
means it is impossible to enter '\t' in a rule. Quite a bit of fun when
you're trying to write regexps.
2005-04-26 23:39:48 -07:00
kay.sievers@vrfy.org
1cec1c2416 [PATCH] remove the device node only if the major/minor number matches 2005-04-26 23:36:13 -07:00
kay.sievers@vrfy.org
fd9efc00a2 [PATCH] introduce OPTIONS=ignore_device, ignore_remove, all_partitions" key
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 23:36:12 -07:00
patmans@us.ibm.com
fd42f6a170 [PATCH] fix test for temporary nodes 2005-04-26 23:34:01 -07:00
kay.sievers@vrfy.org
6a24dc7477 [PATCH] fix special file mode mask for temporary device node 2005-04-26 23:33:50 -07:00
kay.sievers@vrfy.org
f22e9686fd [PATCH] udevstart: simplify "dev" file searching
Just stat() the "dev" file in the device directory instead of
opening the directory and iterating over all entries.

Make udevstart work with the settings in with udev.conf so we can
run a test program.

Add a test for udevstart.

Remove changelog stuff from code. We should never start with this
silly thing.
2005-04-26 23:31:07 -07:00
kay.sievers@vrfy.org
69aa6dfb70 [PATCH] add %P modifier to query the node name of the parent device
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 23:31:03 -07:00