summaryrefslogtreecommitdiff
path: root/udev_rules.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-03-15 00:10:22 +0100
committerKay Sievers <kay.sievers@vrfy.org>2007-03-15 00:10:22 +0100
commit4a7e6bcef059af60baab92a3c0fbe01ed44465d5 (patch)
tree9245275f39f80331909d5ae8e0173453f5e2f03d /udev_rules.c
parent9c6ad9fbbac82e517f5e748ddbe166f96f120afe (diff)
update internal variables if we see $DEVPATH during IMPORT
Diffstat (limited to 'udev_rules.c')
-rw-r--r--udev_rules.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/udev_rules.c b/udev_rules.c
index 200b4e7024..7ab3bba71c 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -186,7 +186,13 @@ static int import_keys_into_env(struct udevice *udev, const char *buf, size_t bu
linepos = line;
if (get_key(&linepos, &variable, &value) == 0) {
dbg("import '%s=%s'", variable, value);
- name_list_key_add(&udev->env_list, variable, value);
+
+ /* handle device, renamed by external tool, returning new path */
+ if (strcmp(variable, "DEVPATH") == 0) {
+ info("updating devpath from '%s' to '%s'", udev->dev->devpath, value);
+ sysfs_device_set_values(udev->dev, value, NULL, NULL);
+ } else
+ name_list_key_add(&udev->env_list, variable, value);
setenv(variable, value, 1);
}
}