summaryrefslogtreecommitdiff
path: root/udev_rules.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-06-02 22:06:01 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-06-02 22:06:01 +0200
commit5e9eb88f2f6d99eaee16aeeb76ac08a1bf98a668 (patch)
treedb00f07e7371538ff674fc626aba706058de8c8a /udev_rules.c
parent03178b0ccec2d4eed7e57563f17fc60adc0a4446 (diff)
add $sys substitution
Diffstat (limited to 'udev_rules.c')
-rw-r--r--udev_rules.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/udev_rules.c b/udev_rules.c
index 1139c99a7d..e61c9a69b0 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -292,6 +292,7 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
SUBST_PARENT,
SUBST_TEMP_NODE,
SUBST_ROOT,
+ SUBST_SYS,
SUBST_ENV,
};
static const struct subst_map {
@@ -311,6 +312,7 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
{ .name = "parent", .fmt = 'P', .type = SUBST_PARENT },
{ .name = "tempnode", .fmt = 'N', .type = SUBST_TEMP_NODE },
{ .name = "root", .fmt = 'r', .type = SUBST_ROOT },
+ { .name = "sys", .fmt = 'S', .type = SUBST_SYS },
{ .name = "env", .fmt = 'E', .type = SUBST_ENV },
{ NULL, '\0', 0 }
};
@@ -516,6 +518,10 @@ found:
strlcat(string, udev_root, maxsize);
dbg("substitute udev_root '%s'", udev_root);
break;
+ case SUBST_SYS:
+ strlcat(string, sysfs_path, maxsize);
+ dbg("substitute sysfs_path '%s'", sysfs_path);
+ break;
case SUBST_ENV:
if (attr == NULL) {
dbg("missing attribute");