uvok cheetah, 2024 Add some more useful info to lsusb output. Index: busybox-1.36.1/util-linux/lsusb.c =================================================================== --- busybox-1.36.1.orig/util-linux/lsusb.c +++ busybox-1.36.1/util-linux/lsusb.c @@ -33,6 +33,10 @@ static int FAST_FUNC fileAction(struct r char *busnum = NULL, *devnum = NULL; int product_vid = 0, product_did = 0; char *uevent_filename = concat_path_file(fileName, "/uevent"); + char *manu_filename = concat_path_file(fileName, "/manufacturer"); + char *product_filename = concat_path_file(fileName, "/product"); + char manu_buf[32] = { 0 }; + char product_buf[32] = { 0 }; parser = config_open2(uevent_filename, fopen_for_read); free(uevent_filename); @@ -58,10 +62,34 @@ static int FAST_FUNC fileAction(struct r continue; } } + + { + FILE *manu_file = fopen(manu_filename, "r"); + if (manu_file != NULL) { + // leave one for terminator + size_t read = fread(manu_buf, 1, sizeof(manu_buf) - 1, manu_file); + fclose(manu_file); + // remove newline + read && (manu_buf[read - 1] = '\0'); + manu_buf[sizeof(manu_buf) - 1] = '\0'; + } + } + { + FILE *product_file = fopen(product_filename, "r"); + if (product_file != NULL) { + // leave one for terminator + size_t read = fread(product_buf, 1, sizeof(product_buf) - 1, product_file); + fclose(product_file); + // remove newline + read && (product_buf[read - 1] = '\0'); + product_buf[sizeof(product_buf) - 1] = '\0'; + } + } + config_close(parser); if (busnum) { - printf("Bus %s Device %s: ID %04x:%04x\n", busnum, devnum, product_vid, product_did); + printf("Bus %s Device %s: ID %04x:%04x %s %s\n", busnum, devnum, product_vid, product_did, manu_buf, product_buf); free(busnum); free(devnum); }