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";
expected => "test-0:0:0:0" ,
conf => <<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
},
);
print "$error errors occured\n\n";
# cleanup
+unlink($udev_db);
system("rm -rf $udev_root");
unlink($conf_tmp);
-unlink($udev_db);
.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:
# %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