chiark / gitweb /
[PATCH] update Fedora config files and add some more tests
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Mon, 20 Dec 2004 23:19:34 +0000 (00:19 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:19:09 +0000 (23:19 -0700)
etc/udev/redhat/udev.rules
test/udev-test.pl

index 30d8ba7..9df77b3 100644 (file)
@@ -87,6 +87,9 @@ KERNEL="pcd[0-9]*",   SYMLINK="cdrom%e"
 KERNEL="fd[0-9]*",     SYMLINK="floppy%e"
 KERNEL="nst[0-9]*",    SYMLINK="tape%e"
 
+# default permissions for all block devices
+SUBSYSTEM="block", GROUP="disk", MODE="0640"
+
 KERNEL="hd[a-z]", BUS="ide", SYSFS{removable}="1", PROGRAM="/etc/udev/scripts/ide-media.sh %k", RESULT="floppy", SYMLINK="floppy%e, NAME{ignore_remove, all_partitions}="%k", GROUP="floppy"
 
 KERNEL="hd[a-z]", BUS="ide", SYSFS{removable}="1", RESULT="cdrom", SYMLINK="cdrom%e"
@@ -101,10 +104,7 @@ KERNEL="hd[a-z]", BUS="ide", SYSFS{removable}="1", PROGRAM="/etc/udev/scripts/ch
 KERNEL="sr[0-9]*", BUS="scsi", PROGRAM="/etc/udev/scripts/check-cdrom.sh %k DVD-R", SYMLINK="dvdwriter%e"
 
 # rename sr* to scd*
-KERNEL="sr[0-9]*", BUS="scsi", NAME="scd%n", GROUP="disk", MODE="0640"
-KERNEL="hd[a-z]*", BUS="ide", SYSFS{removable}="1", NAME{ignore_remove}="%k", GROUP="disk", MODE="0640"
-
-# all block devices
-SUBSYSTEM="block",     NAME="%k", GROUP="disk", MODE="0640"
+KERNEL="sr[0-9]*", BUS="scsi", NAME="scd%n"
+KERNEL="hd[a-z]*", BUS="ide", SYSFS{removable}="1", NAME{ignore_remove}="%k"
 
 KERNEL="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c"
index 578adc4..b50554c 100644 (file)
@@ -634,6 +634,34 @@ KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n"
 EOF
        },
        {
+               desc            => "multiple permissions only rule",
+               subsys          => "tty",
+               devpath         => "/class/tty/ttyUSB0",
+               exp_name        => "ttyUSB0",
+               exp_perms       => "3000:4000:0777",
+               conf            => <<EOF
+SUBSYSTEM="tty", OWNER="3000"
+SUBSYSTEM="tty", GROUP="4000"
+SUBSYSTEM="tty", MODE="0777"
+KERNEL="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
+KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n"
+EOF
+       },
+       {
+               desc            => "permissions only rule with override at NAME rule",
+               subsys          => "tty",
+               devpath         => "/class/tty/ttyUSB0",
+               exp_name        => "ttyUSB0",
+               exp_perms       => "3000:8000:0777",
+               conf            => <<EOF
+SUBSYSTEM="tty", OWNER="3000"
+SUBSYSTEM="tty", GROUP="4000"
+SUBSYSTEM="tty", MODE="0777"
+KERNEL="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
+KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n", GROUP="8000"
+EOF
+       },
+       {
                desc            => "major/minor number test",
                subsys          => "block",
                devpath         => "/block/sda",