Commit Graph

261 Commits

Author SHA1 Message Date
Kay Sievers 3cf1a8e36e libudev: device - use DEVMODE from kernel as the default mode 2011-05-16 22:04:02 +02:00
Kay Sievers 4ec9c3e797 use /run/udev/ if possible and fall back to /dev/.udev/ 2011-03-23 02:31:09 +01:00
Kay Sievers 14996e80d4 udevd: write full database file for (unsupported) renamed device nodes 2010-12-14 02:30:36 +01:00
Martin Pitt b2ad12eb02 Add automatic rules syntax check
Add test/rule-syntax-check.py, a script for checking the syntax of all udev
rules files passed as command line arguments.

Add a wrapper test/rules-test.sh which calls rule-syntax-check.py on all udev
rules that we ship, but does nothing if Python is not available. Integrate this
into make check/distcheck.
2010-09-21 12:45:52 +02:00
Kay Sievers f2291cd07f fix tests and allow MODE=000 2010-05-20 14:51:18 +02:00
Kay Sievers 75cb1ac51e warn when renaming kernel-provided nodes instead of adding symlinks 2010-05-05 11:39:25 +02:00
Kay Sievers a89d342dfb remove "ignore_remove" option 2010-04-13 12:45:38 +02:00
Kay Sievers 1f084fe581 remove "all_partitions" option
We can not predict the major/minor of non-existing devices:
  $ grep . /sys/class/block/sd*/dev
  /sys/class/block/sda1/dev:259:524288
  /sys/class/block/sda2/dev:259:262144
  /sys/class/block/sda3/dev:259:786432
  /sys/class/block/sda4/dev:259:131072
  /sys/class/block/sda/dev:259:0
  /sys/class/block/sdb/dev:259:655360
  /sys/class/block/sdc/dev:259:393216

If this functionality is still needed for some broken hardware, it needs to be
solved with a tool not part of the udev package. Because such option is unreliable
and unsafe to use.
2010-04-13 08:52:48 +02:00
Kay Sievers 5754e74c08 update tests 2010-01-27 09:30:48 +01:00
Kay Sievers f49a6b223e udev-test.pl: catch-up with recent changes 2009-11-16 23:48:58 +01:00
Kay Sievers 9dae0e89b9 test: catch possible bug in GOTO resolving 2009-09-07 12:13:49 +02:00
Kay Sievers 2ffc9cc191 change database file names
With very deeply nested devices, We can not use a single file
name to carry an entire DEVPATH. Use <subsystem>:<sysname> as
the database filename, which should also simplify the handling
of devices moving around, as these values will not change but
still be unique.

For the name stack we use the <maj>:<min> now as the filename.

> On Tue, Aug 18, 2009 at 09:59:56AM -0400, Ric Wheeler wrote:
> The first is that udev grumbles during boot about "file name too long"
> like the following:
>
> Aug 17 06:49:58 megadeth udevd-event[20447]: unable to create db file
> '/dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2f0000:17:00.0\x2f0000:18:0a.0\x2f0000:1f:00.0\x2fhost11\x2fport-11:0\x2fexpander-11:0\x2fport-11:0:0\x2fexpander-11:1\x2fport-11:1:0\x2fexpander-11:2\x2fport-11:2:17\x2fexpander-11:3\x2fport-11:3:1\x2fend_device-11:3:1\x2fbsg\x2fend_device-11:3:1':
> File name too long
2009-08-19 20:49:49 +02:00
Diego Elio 'Flameeyes' Pettenò 102831867c Fix another relative path for the new working directory. 2009-08-07 19:15:31 +02:00
Diego Elio 'Flameeyes' Pettenò 405e606f86 Replace the custom test-run target with the standard make check.
A little fix is needed for the udev-test.pl script (to be called with the
proper path), but this allows for the test binaries to be only built when
running the tests themselves.
2009-08-07 19:15:28 +02:00
Benjamin Gilbert bec7e07acc test: check string substitutions in OWNER and GROUP
String substitutions in OWNER and GROUP keys were broken in udev 137-142.
Explicitly test for this, since such breakage will not manifest in typical
rulesets.
2009-05-22 20:54:46 +02:00
Kay Sievers 065db05221 use more efficient string copying 2009-05-20 17:57:52 +02:00
Kay Sievers a0ee5a05bb remove format char string truncation syntax 2009-05-19 12:56:17 +02:00
Kay Sievers 0c37798916 fix possible endless loop for GOTO to non-existent LABEL
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526365
2009-05-13 18:01:32 +02:00
Kay Sievers a402404fb2 test: add test for empty and non-existent ATTR 2009-02-05 12:40:15 +01:00
Kay Sievers 647f7c49e8 fix NAME="" logic
Reported-By: Soh Kam Yung <sohkamyung@gmail.com>
2009-01-30 03:53:09 +01:00
Kay Sievers bcf44d5576 string index - split nodes and childs to allow and unlimited number of childs 2008-11-12 05:50:05 +01:00
Kay Sievers 427e20b261 libudev: device - allocate envp array only once 2008-10-26 14:31:46 +01:00
Kay Sievers c6243a414e test: add RUN+="socket: ..." to a test to run monitor code 2008-10-26 04:35:32 +01:00
Kay Sievers dc4c7e463d fix $attr{[<subsystem>/<sysname>]<attribute>} substitution 2008-10-26 02:48:14 +01:00
Kay Sievers 91a75e4ad4 match KEY="A|B" without temporary string copy 2008-10-25 03:00:03 +02:00
Kay Sievers 6880b25d40 replace in-memory rules array with match/action token list
The in-memory rule array of a common desktop distro install took:
  1151088 bytes
with the token list:
  109232 bytes tokens (6827 * 16 bytes), 71302 bytes buffer
2008-10-23 00:13:59 +02:00
Kay Sievers d960ad1546 test: fix a few unintentially wrongly written rules which cause parse errors 2008-10-17 13:54:50 +02:00
Kay Sievers a1af6b0401 test: move global ENV{ENV_KEY_TEST}="test" to local rule 2008-10-14 19:55:57 +02:00
Kay Sievers fb780a48e6 delete simple-build-check.sh 2008-10-14 19:55:22 +02:00
Kay Sievers 5c0f595d91 test: replace last reference of "/class/*" devpath 2008-09-29 05:18:23 +02:00
Kay Sievers f2041f0116 test: add missing pci directory because of .gitignore *.7 2008-09-29 05:01:12 +02:00
Kay Sievers c7fcba1bf4 test: replace ancient sysfs tree with recent one 2008-09-29 04:12:44 +02:00
Kay Sievers 438d4c3cd4 libudev: enumerate - split new() and scan() 2008-09-29 02:00:17 +02:00
Alan Jenkins 034b37c83f udev-test.pl: set non-zero exitcode if tests fail 2008-09-16 10:03:42 -07:00
Kay Sievers 37a123a9bc udev-test.pl: set udev_log="err" 2008-09-08 21:50:17 +02:00
Kay Sievers e149748850 udev-test.pl: remove left-over comment from --valgrind option 2008-09-03 22:00:55 +02:00
Kay Sievers e08109cbc8 udev-test.pl: add --valgrind option 2008-09-01 16:20:06 +02:00
Kay Sievers 01618658fd use autotools 2008-07-30 01:45:23 +02:00
Kay Sievers 282988c4f8 move default rules from /etc/udev/rules.d/ to /lib/udev/rules.d/
None of these rules is supposed to be changed by users, so move
them out of /etc. Custom rules, and automatically generated rules
stay in /etc. All rules are still processed in lexical order,
regardless which directory they live in.
2008-07-18 15:56:03 +02:00
Erik van Konijnenburg ff94cec3d7 add substitution in MODE= field
Do substitition processing in MODE field, similar to substitution in
OWNER, GROUP etc fields.  Add test case for normal and overflow behaviour.
Document in manpage.
2008-05-19 09:05:20 +02:00
Kay Sievers 6b795c99e0 fstab_import: add program to IMPORT matching fstab entry
DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
  SUBSYSTEM=block
  ...
  ID_FS_USAGE=filesystem
  ID_FS_TYPE=ext3
  ID_FS_VERSION=1.0
  ...
  FSTAB_NAME=/dev/disk/by-id/scsi-SATA_ST910021AS_3MH0Y3KF-part6
  FSTAB_DIR=/home/kay/work
  FSTAB_TYPE=ext3
  FSTAB_OPTS=defaults
  FSTAB_FREQ=1
  FSTAB_PASSNO=1
2008-04-21 18:07:05 +02:00
Kay Sievers cf100ca71b allow setting of MODE="0000" 2008-04-18 21:07:29 +02:00
Kay Sievers 15015a5c9c test: remove duplicated EXTRA entry 2008-03-21 04:03:24 +01:00
Kay Sievers 0ea5e96edb extend hack to allow TEST=="*/start" 2008-03-14 23:40:06 +01:00
Kay Sievers caea9fcf56 test: add "subsystem" links to all devices 2008-03-14 23:19:12 +01:00
Kay Sievers c645b98b7e remove udevstart 2007-11-13 23:44:12 +01:00
Kay Sievers 03f65fe6a9 accept relative path for TEST 2007-08-16 12:45:31 +02:00
Kay Sievers 19096c087f restore behavior of NAME== 2007-07-25 15:29:14 +02:00
Hannes Reinecke c7ae0d343b collect: extra to synchronize actions across events 2007-07-24 13:28:18 +02:00
Kay Sievers 1ff1aa424b allow SYMLINK== match 2007-07-16 13:29:28 +02:00