diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-06-26 18:55:24 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-06-26 18:55:24 +0200 |
commit | b8476286d62c82a1a0bd8de318aa3f7d835222a0 (patch) | |
tree | 37d3071c2767f819440083e34c5e68efde584b60 /udev_db.c | |
parent | 208f6aba21199ff4f93002eeb948d564f76843e6 (diff) |
store the imported device information in the udevdb
Any program can query with udevinfo for persistent device
attributes evaluated on device discovery now.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_db.c')
-rw-r--r-- | udev_db.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -86,7 +86,8 @@ int udev_db_add_device(struct udevice *udev) fprintf(f, "M:%u:%u\n", major(udev->devt), minor(udev->devt)); fprintf(f, "A:%u\n", udev->partitions); fprintf(f, "R:%u\n", udev->ignore_remove); - + list_for_each_entry(name_loop, &udev->env_list, node) + fprintf(f, "E:%s\n", name_loop->name); fclose(f); return 0; @@ -149,6 +150,12 @@ static int parse_db_file(struct udevice *udev, const char *filename) strlcpy(line, &bufline[2], count-1); udev->ignore_remove = atoi(line); break; + case 'E': + if (count > sizeof(line)) + count = sizeof(line); + strlcpy(line, &bufline[2], count-1); + name_list_add(&udev->env_list, line, 0); + break; } } file_unmap(buf, bufsize); |