summaryrefslogtreecommitdiff
path: root/udevinfo.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-02-25 07:40:14 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:39:48 -0700
commit9fe1a96d88b304af5f3315197800f6b3d16675e1 (patch)
tree75c7549c463a73342938035599686fb5d2d320b9 /udevinfo.c
parentf8a178a35b8dee2ee46a3de298345aa4faa8f41e (diff)
[PATCH] udevinfo: print devpath -> node relationship for all devices
Diffstat (limited to 'udevinfo.c')
-rw-r--r--udevinfo.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/udevinfo.c b/udevinfo.c
index e7417697c..045395256 100644
--- a/udevinfo.c
+++ b/udevinfo.c
@@ -178,9 +178,14 @@ exit:
return retval;
}
+static int print_dump(struct udevice *udev) {
+ printf("%s:%s/%s\n", udev->devpath, udev_root, udev->name);
+ return 0;
+}
+
static int process_options(int argc, char *argv[])
{
- static const char short_options[] = "an:p:q:rVh";
+ static const char short_options[] = "adn:p:q:rVh";
int option;
int retval = 1;
struct udevice udev;
@@ -245,6 +250,10 @@ static int process_options(int argc, char *argv[])
attributes = 1;
break;
+ case 'd':
+ udev_db_call_foreach(print_dump);
+ exit(0);
+
case 'V':
printf("udevinfo, version %s\n", UDEV_VERSION);
exit(0);
@@ -384,7 +393,8 @@ help:
"\n"
" -r print udev root\n"
" -a print all SYSFS_attributes along the device chain\n"
- " -s print all sysfs devices with major/minor, physical device and bus\n"
+ " -d print the relationship of devpath and the node name for all\n"
+ " devices available in the database\n"
" -V print udev version\n"
" -h print this help text\n"
"\n");