Repository navigation
system/fastboot: publish the serial number - #4299
Open
JianyuWang0623 wants to merge 1 commit into
Open
JianyuWang0623 wants to merge 1 commit into
JianyuWang0623 wants to merge 1 commit into
Conversation
fastboot getvar serialno returns nothing while the host side expects a device serial. Publish the board usbdev serial string as serialno when the board provides one, matching the USB descriptor serial. Boards without the hook keep the empty response. Co-authored-by: multica-agent <github@multica.ai> Assisted-by: OpenCode:mimo-v2.6-pro Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
JianyuWang0623
marked this pull request as ready for review
December 6, 2026 09:18
xiaoxiang781216
approved these changes
Dec 6, 2026
Contributor
Author
|
The failing jobs are unrelated to this patch: the flash overflows are on configs that don't enable SYSTEM_FASTBOOTD, and arm-other is an NTFC test timeout; other open PRs fail the same jobs. |
Contributor
fixed by apache/nuttx#22951 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Publish the board usbdev serial string (
board_usbdev_serialstr()) as theserialnofastboot variable so thatgetvar serialnoreports the sameserial as the USB descriptor iSerialNumber on boards that provide one.
Boards without
CONFIG_BOARD_USBDEV_SERIALSTRkeep the empty response.Impact
On boards that enable
CONFIG_BOARD_USBDEV_SERIALSTRand implementboard_usbdev_serialstr()(the hookdrivers/usbdev/composite.calreadyuses for the USB descriptor serial),
fastboot getvar serialnonowreturns that string instead of nothing, and
fastboot devicesandgetvar serialnoreport the same serial. Without the config the newcode is compiled out and the behavior is unchanged.
Testing
Build Host: Ubuntu 22.04.5 LTS x86_64, QEMU emulator 6.2.0, Arm GNU
Toolchain 13.3 (aarch64-none-elf-gcc 13.3.1), host fastboot 28.0.2
Target: qemu-armv8a:fastboot (CONFIG_SYSTEM_FASTBOOTD, TCP transport)
Launch:
Start
fastbootd &at the nsh prompt, then run the host commands over theTCP transport. Both builds enable
CONFIG_BOARD_USBDEV_SERIALSTRwith atest-only board implementation of
board_usbdev_serialstr()returningQEMUTESTSERIAL01so the new code path is linked and exercised.master:
patched:
On two hardware targets running fastbootd in the early boot stage (one
armv7-a, one armv8-a) the same change was checked against the other
serial sources on the device (USB serial, OS property, boot cmdline,
TEE serial record); all sources match byte-for-byte per
device (device serial numbers masked below), and the two devices
carry different serials.
target 1 (armv8-a):
target 2 (armv7-a, no OS-side property available):