exp_name => "00:e0:00:fb:04:e1",
rules => <<EOF
KERNEL=="sda", NAME="\$attr{[net/eth0]address}"
+EOF
+ },
+ {
+ desc => "TEST absolute path",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "there",
+ rules => <<EOF
+TEST=="/etc/hosts", NAME="there"
+NAME="notthere"
+EOF
+ },
+ {
+ desc => "TEST subsys/kernel lookup",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "yes",
+ rules => <<EOF
+KERNEL=="sda", TEST=="[net/eth0]", NAME="yes"
+EOF
+ },
+ {
+ desc => "TEST relative path",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "relative",
+ rules => <<EOF
+KERNEL=="sda", TEST=="size", NAME="relative"
EOF
},
);
strlcat(filename, "/", sizeof(filename));
strlcat(filename, attr, sizeof(filename));
}
+ } else if (filename[0] != '/') {
+ char tmp[PATH_SIZE];
+
+ strlcpy(tmp, sysfs_path, sizeof(tmp));
+ strlcat(tmp, udev->dev->devpath, sizeof(tmp));
+ strlcat(tmp, "/", sizeof(tmp));
+ strlcat(tmp, filename, sizeof(tmp));
+ strlcpy(filename, tmp, sizeof(filename));
}
match = (stat(filename, &statbuf) == 0);