From 1113044be205f9d78642744ffaa01329a77bee79 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 29 Aug 2007 14:04:55 +0200 Subject: add $name substitution --- udev_rules.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'udev_rules.c') diff --git a/udev_rules.c b/udev_rules.c index 35db958c8d..01fb2117b2 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -606,6 +606,7 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize) SUBST_ATTR, SUBST_PARENT, SUBST_TEMP_NODE, + SUBST_NAME, SUBST_ROOT, SUBST_SYS, SUBST_ENV, @@ -627,6 +628,7 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize) { .name = "sysfs", .fmt = 's', .type = SUBST_ATTR }, { .name = "parent", .fmt = 'P', .type = SUBST_PARENT }, { .name = "tempnode", .fmt = 'N', .type = SUBST_TEMP_NODE }, + { .name = "name", .fmt = 'D', .type = SUBST_NAME }, { .name = "root", .fmt = 'r', .type = SUBST_ROOT }, { .name = "sys", .fmt = 'S', .type = SUBST_SYS }, { .name = "env", .fmt = 'E', .type = SUBST_ENV }, @@ -845,6 +847,10 @@ found: strlcat(string, udev->tmp_node, maxsize); dbg("substitute temporary device node name '%s'", udev->tmp_node); break; + case SUBST_NAME: + strlcat(string, udev->name, maxsize); + dbg("substitute udev->name '%s'", udev->name); + break; case SUBST_ROOT: strlcat(string, udev_root, maxsize); dbg("substitute udev_root '%s'", udev_root); -- cgit v1.2.3-54-g00ecf