On Tue, 25 Oct 2022 at 10:30, 'Patrick Georgi' via fwupd
<
fw...@googlegroups.com> wrote:
> I have a bunch of identical-looking devices (Genesys hubs) on USB that I want to make unique by writing their own serial numbers into their firmware. I have most of the process nailed, using `fwupdtool install-blob`.
Excellent, I'm glad it's working.
> The remaining issue is finding the right device-id to pass to fwupdtool. I have the USB bus-id, path and device number (all the stuff that is visible from lsusb), how can I figure out the unique device id in the format fwupd wants?
If you look at the --verbose log from either fwupd or fwupd you can
see how fwupd is hashing the info into a SHA1 identifier:
FuDevice using 23cf6368c14a875f74c38a5a423518f38d8abbbc
for usb:01:00:06
so that's it's the USB ID just hashed into SHA1 directly.
Does that help? I assume you're trying to target the right device when
there are multiple hubs installed with the same VID PID -- but if the
VID PID is different you can use the GUID instead of the device ID.
It also worries me slightly; is there anything we should be including
in the GUID that allows us to tell the identical-looking devices
apart? e.g. is there some kind of "model ID" or "firmware variant" we
can retrieve from the firmware and add to the instance IDs? We already
add a few extra ones for Genesys, from the README:
-----------------
These devices use the standard USB DeviceInstanceId values for the USB Hub, e.g.
* GenesysLogic USB2.0 Hub: `USB\VID_05E3&PID_0610`
* HP USB-C Controller: `USB\VID_03F0&PID_0610`
Additionally, some customized instance IDs are added. e.g.
* GenesysLogic USB2.0 Hub: `USB\VID_03F0&PID_0610&IC_352330&BONDING_0F`
* GenesysLogic USB2.0 Hub:
`USB\VID_03F0&PID_0610&VENDOR_GENESYSLOGIC&IC_352330&BONDING_0F&PORTNUM_23&VENDORSUP_C09B5DD3-1A23-51D2-995A-F7366AAB3CA4`
* HP M24fd USB-C Hub:
`USB\VID_03F0&PID_0610&PUBKEY_AB859399-95B8-5817-B521-9AD8CC7F5BD6`
* HP M27fd USB-C Hub:
`USB\VID_03F0&PID_0610&PUBKEY_6BE97D77-C2BA-5AA2-B7DF-B9B318BEC2B5`
These devices also use custom GUID values for the Scaler, e.g.
* HP M24fd USB-C Monitor:
`GENESYS_SCALER\MSTAR_TSUM_G&PUBKEY_B335BDCE-7073-5D0E-9BD3-9B69C1A6899F&PANELREV_RIM101`
* HP M27fd USB-C Monitor:
`GENESYS_SCALER\MSTAR_TSUM_G&PUBKEY_847A3650-8648-586B-83C8-8B53714F37E3&PANELREV_RIM101`
The Public Key is product-specific and is required to identify the product.
-----------------
Or are the identical-looking devices actually the exact same device
with the same pubkey and firmware expectation?
Richard.