Skip to content

android-tools-conf-configfs: add SoC serial to USB product string#1792

Open
vkraleti wants to merge 1 commit intoqualcomm-linux:masterfrom
vkraleti:usb-productid
Open

android-tools-conf-configfs: add SoC serial to USB product string#1792
vkraleti wants to merge 1 commit intoqualcomm-linux:masterfrom
vkraleti:usb-productid

Conversation

@vkraleti
Copy link
Copy Markdown
Contributor

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.

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>
@github-actions
Copy link
Copy Markdown

Test run workflow

Test jobs for commit 9cd0ab6

Test dragonboard-820c qcs615-adp-air qcs6490 qcs8300 qcs9100 qcs9100-rb8 qrb2210-rb1
AudioRecord 🚫 pass pass pass pass 🚫 pass
BT_FW_KMD_Service 🚫 🚫 pass pass pass pass pass
BT_ON_OFF 🚫 ⚠️ skip pass pass pass ⚠️ skip pass
BT_SCAN 🚫 🚫 pass pass pass pass pass
CPUFreq_Validation 🚫 pass pass pass pass pass pass
DSP_AudioPD 🚫 pass pass pass pass pass pass
Ethernet 🚫 pass 🚫 pass ⚠️ skip ⚠️ skip ⚠️ skip
Interrupts 🚫 pass pass pass pass pass pass
KMSCube 🚫 ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip
OpenCV 🚫 pass pass pass pass pass pass
WiFi_Firmware_Driver 🚫 pass pass pass pass pass pass
WiFi_OnOff 🚫 ⚠️ skip pass pass pass ⚠️ skip pass
adsp_remoteproc 🚫 pass pass pass pass pass pass
boot pass pass pass pass pass pass pass
cdsp_remoteproc 🚫 pass pass pass pass pass ⚠️ skip
core_auth 🚫 pass pass pass pass pass pass
fastrpc_test 🚫 fail pass pass pass pass 🚫
hotplug 🚫 pass pass pass pass pass pass
irq 🚫 pass pass pass pass pass pass
weston-simple-egl 🚫 ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip

All jobs summary

Job ID Device State Health
163442 qrb2210-rb1 Finished Complete
163466 qrb2210-rb1 Finished Complete
163460 qcs9100 Finished Complete
163465 qrb2210-rb1 Finished Complete
163456 qcs9100 Finished Complete
163434 qcs6490 Finished Complete
163439 qcs9100-rb8 Finished Complete
163433 qcs615-adp-air Finished Complete
163435 qcs8300 Finished Complete
163475 qcs6490 Finished Complete
163437 dragonboard-820c Finished Complete
163461 qcs615-adp-air Finished Complete
163431 qcs6490 Finished Complete
163449 qcs615-adp-air Finished Incomplete
163451 qcs6490 Finished Complete
163415 qcs615-adp-air Finished Complete
163468 qrb2210-rb1 Finished Complete
163480 qcs9100-rb8 Finished Complete
163418 qcs8300 Finished Complete
163422 qrb2210-rb1 Finished Complete
163421 dragonboard-820c Finished Complete
163448 qrb2210-rb1 Finished Complete
163476 qcs8300 Finished Complete
163462 qcs615-adp-air Finished Complete
163464 qcs9100-rb8 Finished Complete
163454 qcs8300 Finished Complete
163450 qcs9100 Finished Complete
163416 qcs9100 Finished Complete
163477 qcs9100-rb8 Finished Complete
163419 qcs6490 Finished Complete
163457 qcs6490 Finished Complete
163482 qrb2210-rb1 Finished Complete
163420 qcs9100 Finished Complete
163441 qcs6490 Finished Complete
163472 qcs615-adp-air Finished Complete
163474 qcs9100-rb8 Finished Complete
163469 qcs8300 Finished Complete
163452 qcs9100-rb8 Finished Complete
163432 dragonboard-820c Finished Complete
163471 qcs8300 Finished Complete
163428 qcs9100-rb8 Finished Complete
163470 qcs9100 Finished Complete
163455 qcs6490 Finished Complete
163423 qcs615-adp-air Finished Complete
163481 qcs6490 Finished Complete
163438 qcs8300 Finished Complete
163478 qcs9100 Finished Complete
163440 qrb2210-rb1 Finished Complete
163426 qrb2210-rb1 Finished Complete
163425 dragonboard-820c Finished Complete
163447 qcs615-adp-air Finished Incomplete
163427 qcs9100 Finished Complete
163430 qcs9100 Finished Complete
163463 qcs615-adp-air Finished Incomplete
163436 qcs8300 Finished Complete
163424 qcs9100-rb8 Finished Complete
163429 qcs615-adp-air Finished Complete
163473 qcs8300 Finished Complete
163467 qcs9100-rb8 Finished Complete
163453 qcs8300 Finished Complete
163459 qcs6490 Finished Complete
163417 qcs9100-rb8 Finished Complete
163479 qrb2210-rb1 Finished Complete
163458 qcs9100 Finished Complete

@test-reporting-app
Copy link
Copy Markdown

Test Results

   64 files  +   36    286 suites  +258   4h 6m 24s ⏱️ + 2h 57m 36s
   63 tests +   49     50 ✅ +   41   0 💤 ± 0  13 ❌ + 8 
2 694 runs  +2 471  2 638 ✅ +2 423  35 💤 +35  21 ❌ +13 

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.
lava ‑ fastboot-boot
0_BT_FW_KMD_Service ‑ BT_FW_KMD_Service
0_core_auth ‑ core_auth
0_hotplug ‑ hotplug
10_AudioRecord ‑ AudioRecord
10_Ethernet ‑ Ethernet
11_DSP_AudioPD ‑ DSP_AudioPD
11_Ethernet ‑ Ethernet
12_DSP_AudioPD ‑ DSP_AudioPD
12_fastrpc_test ‑ fastrpc_test
13_fastrpc_test ‑ fastrpc_test
…

Copy link
Copy Markdown
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)")"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S/N is defiintely not a part of the model. Don't hack it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'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?

@vkraleti
Copy link
Copy Markdown
Contributor Author

I'm sorry, I don't understand. The serial number matches between fastboot and the ADB. Do you observe a different behaviour?

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

Fastboot mode HLOS Mode (ADB)
iManufacturer: 0x01
English (United States) "Qualcomm"
iManufacturer: 0x01
English (United States) "Qualcomm"
iProduct: 0x02
English (United States) "MSMPHONE"
iProduct: 0x02
English (United States) "iq-8275-evk"
iSerialNumber: 0x03
English (United States) "3343a0c1"
iSerialNumber: 0x03
English (United States) "6535dd6a"

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

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.

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.

This info is already available at /sys/devices/soc0, isn't acceptable to reflect the same via USB descriptors as well?

@lumag
Copy link
Copy Markdown
Contributor

lumag commented Mar 23, 2026

I'm sorry, I don't understand. The serial number matches between fastboot and the ADB. Do you observe a different behaviour?

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

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.

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

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.

Yes, please.

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.

This info is already available at /sys/devices/soc0, isn't acceptable to reflect the same via USB descriptors as well?

You are exporting that information to the outside world.

@vkraleti
Copy link
Copy Markdown
Contributor Author

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.

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.

@lumag
Copy link
Copy Markdown
Contributor

lumag commented Mar 23, 2026

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.

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.

@ricardosalveti
Copy link
Copy Markdown
Contributor

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.

Yeah, not sure we want this to be the default here.

@vkraleti
Copy link
Copy Markdown
Contributor Author

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.

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.

3 participants