Getting fwupd device-id for USB bus + device number

139 views
Skip to first unread message

Patrick Georgi

unread,
Oct 25, 2022, 5:30:55 AM10/25/22
to fwupd
Hi everybody,

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`.

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?


Thanks,
Patrick

Richard Hughes

unread,
Oct 25, 2022, 6:51:16 AM10/25/22
to Patrick Georgi, fwupd
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.

Patrick Georgi

unread,
Oct 25, 2022, 10:11:11 AM10/25/22
to Richard Hughes, fwupd
Am Di., 25. Okt. 2022 um 12:51 Uhr schrieb Richard Hughes <hugh...@gmail.com>:
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.
Thanks for the pointer, I'll check that out.

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:
The GL3590 hubs themselves can't be told apart intrinsically: I figure them out by looking at a device attached to that hub that carries a known-unique USB serial number, and then walk the USB hierarchy, but that's probably a bit too specialized for fwupd.

Or are the identical-looking devices actually the exact same device
with the same pubkey and firmware expectation?
It's the "Servo dock", GL3590. I'm looking at having a large number of these on any given host system (in my testing it's only two of them, 8 is more normal in larger deployments and there are ideas to crank that up to several dozens on a single host using multiple USB controllers)


Thanks,
Patrick
--
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Liana Sebastian 
Reply all
Reply to author
Forward
0 new messages