flash: support both qcom-ptool script layouts in gen-flash-dirs.sh - #209
Open
Bjordis Collaku (bjordiscollaku) wants to merge 1 commit into
Open
flash: support both qcom-ptool script layouts in gen-flash-dirs.sh#209Bjordis Collaku (bjordiscollaku) wants to merge 1 commit into
Bjordis Collaku (bjordiscollaku) wants to merge 1 commit into
Conversation
qcom-ptool moved gen_partition.py, ptool.py, and gen_contents.py from the
repo root into a qcom_ptool/ package directory (upstream commit f0f1259),
and ptool.py now imports its sibling utils module as qcom_ptool.utils.
Every qcom-ptool commit that adds shikra-evk support lands after this
restructure, so pinning to any commit with shikra-evk support broke
gen-flash-dirs.sh with:
python3: can't open file '.../boot_bins/qcom-ptool/gen_partition.py':
No such file or directory
Detect which layout the pinned qcom-ptool checkout uses and resolve the
scripts directory (and PYTHONPATH, needed by the new ptool.py import)
accordingly. platforms/ stays at the repo root in both layouts, so no
other path resolution changes are needed.
Validated locally against both the previously pinned commit (old layout)
and current qcom-ptool tip (new layout, includes shikra-evk): both produce
equivalent flash directories for all four resolute/iot boards, and
gen_partition.py/ptool.py run successfully against shikra-evk's partition
config.
Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
Keerthi Gowda (keerthi-go)
approved these changes
Jul 29, 2026
Simon Beaudoin (simonbeaudoin0935)
approved these changes
Jul 29, 2026
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.
Problem
qcom-ptool moved
gen_partition.py,ptool.py, andgen_contents.pyfrom the repo root into aqcom_ptool/package directory (upstream commit f0f1259), andptool.pynow imports its sibling utils module asqcom_ptool.utils.Every qcom-ptool commit that adds
shikra-evksupport lands after this restructure. As a result, pinninggen-flash-dirs.sh's--ptool-dirto any commit with shikra-evk support fails with:This was reported against
qcom-distro-images' local developer build guide, which pins an older qcom-ptool commit specifically to avoid this breakage, at the cost of missing shikra-evk support.Fix
Detect which layout the pinned qcom-ptool checkout uses and resolve the scripts directory (and
PYTHONPATH, needed by the newptool.pyintra-package import) accordingly.platforms/stays at the repo root in both layouts, so no other path resolution changes are needed.I considered switching to the new
pip install .+qcom-ptoolunified CLI entry point (which is the direction upstream has moved, and what their own Makefile now uses), but thepkg-buildercontainer has neitherpipnorsetuptoolsinstalled, so that would add a new dependency to the build environment. The layout-detection approach avoids that entirely and keepsgen-flash-dirs.shself-contained.Validation
Ran
gen-flash-dirs.shlocally against all fourresolute/iotboards (iq-x7181-evk,qcs6490-rb3gen2-vision-kit,iq-9075-evk,iq-8275-evk) with:qcom_ptool/layout, includes shikra-evk): completes successfully. Directory structure matches the old-layout run exactly (only additional GPT backup files present, from unrelated upstream ptool changes, not from this fix).shikra-evk's own partition config directly:gen_partition.pyandptool.pyboth run successfully and produce partition XML/GPT output for shikra-evk, confirming the exact failure mode reported is resolved.Files changed
flash/gen-flash-dirs.shqcom_ptool/) and resolve script paths andPYTHONPATHaccordingly