android-tools-conf-configfs: add SoC serial to USB product string#1792
android-tools-conf-configfs: add SoC serial to USB product string#1792vkraleti wants to merge 1 commit intoqualcomm-linux:masterfrom
Conversation
Axiom requires a stable and unique device identifier that is consistent across EDL, fastboot, and ADB modes. The ADB serial number cannot be used for this purpose, as it is not available in EDL or fastboot modes. However, the SoC serial number is accessible in all boot modes. Including the SoC serial number in the USB gadget product string (strings/0x409/product), allows Axiom to reliably read and use it as a stable identifier for uniquely tracking devices across flashing and debug workflows. Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Test run workflowTest jobs for commit 9cd0ab6
All jobs summary
|
Test Results 64 files + 36 286 suites +258 4h 6m 24s ⏱️ + 2h 57m 36s For more details on these failures, see this check. Results for commit 9cd0ab6. ± Comparison against base commit d7c1ae2. This pull request removes 1 and adds 50 tests. Note that renamed tests count towards both. |
lumag
left a comment
There was a problem hiding this comment.
I'm sorry, I don't understand. The serial number matches between fastboot and the ADB. Do you observe a different behaviour?
With this in place the behaviour starts to depend on qcom_socinfo being probed by the time adbd starts or not (which might make a difference for the root-less builds).
Not to mention that this suddenly exports the serial number of the SoC over the USB, possibly exporting the trackable number to the outside world.
| manufacturer=Qualcomm | ||
| model=`hostname` | ||
| [ -e /sys/devices/soc0/soc_id ] && model="${model}($(< /sys/devices/soc0/soc_id))" | ||
| [ -e /sys/devices/soc0/serial_number ] && model="${model}_SN:$(printf '%x' "$(tr -d ' \n' < /sys/devices/soc0/serial_number)")" |
There was a problem hiding this comment.
S/N is defiintely not a part of the model. Don't hack it.
There was a problem hiding this comment.
'model' is the variable name used for populating adb/strings/0x409/product, which is for capturing product information. Link: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-setup#n33
IMO, SoC Number can be part of product descriptor. If not this, any better variable to capture this info?
In QLI 1.x they are matching as both fastboot_id & adb_id are populated using SoC info. android-gadget-setup.machine But on mainline, they are different. For example on one of the RB4 devices the USB descriptor values are
Agree, if the approach to populate qcom_socinfo via USB descriptors is acceptable, can make adbd systemd service start dependent on infra to be available.
This info is already available at /sys/devices/soc0, isn't acceptable to reflect the same via USB descriptors as well? |
What caused the change? Historically the fastboot has been using exactly the same value, the storage ID, for the serial number. On all the platforms I have been testing (up to and including SM8650) it was the case, unless I'm mistaken.
Yes, please.
You are exporting that information to the outside world. |
In those platfoms, ABL is the one reading the storage ID to populate the serial number. However in KLMT, there is no ABL and fastboot is implemented as a UEFI App. This newer implementation is reading the soc0/serial_number to populate the serial number. |
How can we distinguish between those two cases? I'd rather fix the bootloader app to follow the established practice. |
Yeah, not sure we want this to be the default here. |
|
Axiom needs a fixed, unique ID that’s accessible in all device states. Right now, the SoC serial is the only option that satisfies this. The UEFI fastboot app doesn’t currently expose storage ID, so I’ll check with the UEFI team to see if it is feasible to add this. |
Axiom requires a stable and unique device identifier that is consistent across EDL, fastboot, and ADB modes. The ADB serial number cannot be used for this purpose, as it is not available in EDL or fastboot modes. However, the SoC serial number is accessible in all boot modes.
Including the SoC serial number in the USB gadget product string (strings/0x409/product), allows Axiom to reliably read and use it as a stable identifier for uniquely tracking devices across flashing and debug workflows.