Skip to content

flash: support optional boot_bin_immutable_url in targets.json - #232

Merged
Bjordis Collaku (bjordiscollaku) merged 4 commits into
qualcomm-linux:mainfrom
phanendra-qc:dev/bootbins-immutable-split
Sep 23, 2026
Merged

Bjordis Collaku (bjordiscollaku) merged 4 commits into
qualcomm-linux:mainfrom
phanendra-qc:dev/bootbins-immutable-split

Conversation

@phanendra-qc

Copy link
Copy Markdown
Contributor

Summary

PR qualcomm-linux/meta-qcom#3069 splits the boot binaries archive into a main zip and a companion immutable zip. The Yocto recipe deploys both into the same DEPLOYDIR; this PR mirrors that behaviour in the Ubuntu build pipeline.

Changes

flash/parse-boards-config.py

  • Add boot_bin_immutable_url as an optional field (defaults to "") in the schema doc comment and the setdefault normalization block.

flash/download-boot-bins.sh

  • Extract the download+extract logic into a reusable download_and_extract() helper (URL deduplication cache preserved).
  • After the main archive is placed in bins_<board>/, if boot_bin_immutable_url is set the immutable archive is downloaded (also deduplicated) and its contents are merged into the same bins_<board>/ directory via cp -a — exactly mirroring what the Yocto recipe does.
  • Targets without boot_bin_immutable_url are fully backward-compatible.

Dependency

Companion PR in qcom-distro-images: #138 — adds boot_bin_immutable_url and bumps versions in config/resolute/iot/targets.json.

@bjordiscollaku

Copy link
Copy Markdown
Contributor

Reviewed the parser and download changes, and tested the flow locally with the real main and immutable archives for all four targets. The contents are merged correctly, shared URLs are downloaded only once, and targets without boot_bin_immutable_url continue to work as before. The implementation looks good to me. Please fix the DCO sign-off before merging.

@phanendra-qc

Copy link
Copy Markdown
Contributor Author

Reviewed the parser and download changes, and tested the flow locally with the real main and immutable archives for all four targets. The contents are merged correctly, shared URLs are downloaded only once, and targets without boot_bin_immutable_url continue to work as before. The implementation looks good to me. Please fix the DCO sign-off before merging.

Thanks for review, addressed DCO & also added cleanup of extact* folder post bin_ created

@shoudil

Shoudi Li (shoudil) commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

@shoudil

Shoudi Li (shoudil) commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Looks the programmer tools not present under nvme/ufs folder now https://qli-prod-artifacts.qualcomm.com/qli-prd-lecore-gh-artifacts/qualcomm-linux/qcom-distro-images/35578953740-1/

qcom-ubuntu-iot-resolute-server-canonical.images/iq-x7181-evk$ find . -name xbl_s_dev*
./spinor/xbl_s_devprg_ns.melf

@phanendra-qc

Copy link
Copy Markdown
Contributor Author

With segregation bootbinaries , target team confirmed that not maintaining prog file per storage , this has to be added support newly to copy same deb prog across all storages

@phanendra-qc

Copy link
Copy Markdown
Contributor Author

Vivek Magre (@vmagre) FYI of consumption of latest bootbinaries on hold due to H/P needs sereate handling.

Comment thread flash/gen-flash-dirs.sh
Comment thread flash/gen-flash-dirs.sh
@shoudil

Copy link
Copy Markdown
Contributor

Could you rebase on main branch to remove this commit c7a872c ?

PR qualcomm-linux/meta-qcom#3069 splits the boot binaries archive into
a main zip and a companion immutable zip. The Yocto recipe deploys both
into the same DEPLOYDIR; mirror that behaviour here.

Changes:
- parse-boards-config.py: add boot_bin_immutable_url as an optional
  field (defaults to "") in the schema doc and setdefault block
- download-boot-bins.sh: extract the download+extract logic into a
  reusable download_and_extract() helper (URL deduplication cache
  preserved). After the main archive is placed in bins_<board>/, if
  boot_bin_immutable_url is set the immutable archive is downloaded
  (also deduplicated) and its contents are merged into the same
  bins_<board>/ directory via cp -a.

Targets without boot_bin_immutable_url are fully backward-compatible.

Companion change: qualcomm-linux/qcom-distro-images dev/bootbins-immutable-split

Signed-off-by: Phanendra yarra <pyarra@qti.qualcomm.com>
The _extract_* and *_flat scratch directories used during archive
extraction were cached in URL_TO_EXTRACTED_DIR for deduplication but
never removed. Add a cleanup loop after all boards are processed to
rm -rf every cached temp dir, keeping the output directory tidy.

Signed-off-by: Phanendra yarra <pyarra@qti.qualcomm.com>
…targets

For targets like iq-x7181-evk that have spinor storage, the flat boot
bins archive contains spinor-only firmware. The previous fallback logic
copied the entire flat archive root into every storage dir (nvme, ufs,
spinor), polluting nvme/ufs flash dirs with spinor-specific binaries.

Fix: when no storage-specific subdir exists in the archive and the
target has spinor, skip the flat-root fallback for non-spinor storage
types. nvme/ufs dirs now receive only ptool-generated partition files
and OS images (efi.bin, rootfs.img) as intended.

Targets without spinor (iq-8275-evk, iq-9075-evk, qcs6490-rb3gen2)
are unaffected — their HAS_SPINOR=false path still falls back to the
flat archive root.

Signed-off-by: Phanendra yarra <pyarra@qti.qualcomm.com>
when STORAGE_SPINOR True
Update gen-flash-dirs.sh to copy programmer file to other storages

Signed-off-by: Phanendra Yarra <pyarra@qti.qualcomm.com>
@phanendra-qc

Copy link
Copy Markdown
Contributor Author

Could you rebase on main branch to remove this commit c7a872c ?

rebased

@bjordiscollaku
Bjordis Collaku (bjordiscollaku) merged commit 08747f3 into qualcomm-linux:main Sep 23, 2026
11 checks passed
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.

4 participants