summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-11-24 23:45:38 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:04 -0700
commit36043f8418c8a0e8decb090c1ea22092fe9c976a (patch)
treef17cd4f01783e088462b0b721922228a38e03744
parent5c6f0f141d43703fe84b8c0ddcebf9b79001daf9 (diff)
[PATCH] add test and documentation for new %D devfs format modifier
-rw-r--r--test/udev-test.pl22
-rw-r--r--udev.85
-rw-r--r--udev.config3
3 files changed, 28 insertions, 2 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 2835489238..ee2f4e691e 100644
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -25,7 +25,7 @@ my $PWD = $ENV{PWD};
my $sysfs = "sys/";
my $udev_bin = "../udev";
my $udev_root = "udev-root/"; # !!! directory will be removed !!!
-my $udev_db = "udev.tdb";
+my $udev_db = ".udev.tdb";
my $perm = "udev.permissions";
my $conf_tmp = "udev-test.config";
@@ -108,6 +108,24 @@ EOF
CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n test-%b", ID="test-*", NAME="%c"
EOF
},
+ {
+ desc => "devfs disk naming substitution",
+ subsys => "block",
+ devpath => "block/sda",
+ expected => "lun0/disk" ,
+ conf => <<EOF
+LABEL, BUS="scsi", vendor="IBM-ESXS", NAME="lun0/%D"
+EOF
+ },
+ {
+ desc => "devfs disk naming substitution",
+ subsys => "block",
+ devpath => "block/sda/sda2",
+ expected => "lun0/part2" ,
+ conf => <<EOF
+LABEL, BUS="scsi", vendor="IBM-ESXS", NAME="lun0/%D"
+EOF
+ },
);
# set env
@@ -173,7 +191,7 @@ foreach my $config (@tests) {
print "$error errors occured\n\n";
# cleanup
+unlink($udev_db);
system("rm -rf $udev_root");
unlink($conf_tmp);
-unlink($udev_db);
diff --git a/udev.8 b/udev.8
index 1500b3b424..22c4586daa 100644
--- a/udev.8
+++ b/udev.8
@@ -106,6 +106,11 @@ the bus id for the device
.B %c
the CALLOUT program returned string
(this does not work within the PROGRAM field for the obvious reason.)
+.TP
+.B %D
+Use the devfs style disk name for this device.
+For partitions, this will result in 'part%n'
+If this is not a partition, it will result in 'disk'
.RE
.P
A sample \fIudev.conf\fP might look like this:
diff --git a/udev.config b/udev.config
index 3eb688a3a0..7e67d3a3b4 100644
--- a/udev.config
+++ b/udev.config
@@ -7,6 +7,9 @@
# %b - the bus id for the device
# %c - the return value for the CALLOUT program (note, this doesn't work within
# the PROGRAM field for the obvious reason.)
+# %D - use the devfs style disk name for this device.
+# For partitions, this will result in 'part%n'
+# If this is not a partition, it will result in 'disk'
#
# Looking for scsi bus id 42:0:0:1