Skip to content

Conversation

@munawar-shakil
Copy link

It is possible that the usb_loc is dynamic and changes each time the machine boot. As a result, there is no way to understand which physical usb device is related to which usb_loc. Hence introducing usb_path glob pattern such that user can always query the correct device and run necessary sub command despite the dynamic behavior.

This change introduces a new command-line option --usb_path to htool, allowing users to select a specific USB device by providing a glob pattern that matches its real sysfs path. A new function, libhoth_get_usb_sys_path, is added to libhoth_usb to retrieve the canonical sysfs path for a given libusb_device. The device selection logic in htool_usb.c is updated to use this new path-based filtering.

Also the change introduces new column in htool usb list showing the real path.

It is possible that the usb_loc is dynamic and changes each time the
machine boot. As a result, there is no way to understand which physical
usb device is related to which usb_loc. Hence introducing usb_path glob
pattern such that user can always query the correct device and run
necessary sub command despite the dynamic behavior.

This change introduces a new command-line option `--usb_path` to htool,
allowing users to select a specific USB device by providing a glob
pattern that matches its real sysfs path. A new function,
libhoth_get_usb_sys_path, is added to libhoth_usb to retrieve the
canonical sysfs path for a given libusb_device. The device selection
logic in htool_usb.c is updated to use this new path-based filtering.

Also the change introduces new column in `htool usb list` showing the
real path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant