Skip to content

flash: support both qcom-ptool script layouts in gen-flash-dirs.sh - #209

Open
Bjordis Collaku (bjordiscollaku) wants to merge 1 commit into
mainfrom
fix/gen-flash-dirs-qcom-ptool-layout
Open

flash: support both qcom-ptool script layouts in gen-flash-dirs.sh#209
Bjordis Collaku (bjordiscollaku) wants to merge 1 commit into
mainfrom
fix/gen-flash-dirs-qcom-ptool-layout

Conversation

@bjordiscollaku

Copy link
Copy Markdown
Contributor

Problem

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. As a result, pinning gen-flash-dirs.sh's --ptool-dir to any commit with shikra-evk support fails with:

python3: can't open file '.../boot_bins/qcom-ptool/gen_partition.py': No such file or directory

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 new ptool.py intra-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-ptool unified CLI entry point (which is the direction upstream has moved, and what their own Makefile now uses), but the pkg-builder container has neither pip nor setuptools installed, so that would add a new dependency to the build environment. The layout-detection approach avoids that entirely and keeps gen-flash-dirs.sh self-contained.

Validation

Ran gen-flash-dirs.sh locally against all four resolute/iot boards (iq-x7181-evk, qcs6490-rb3gen2-vision-kit, iq-9075-evk, iq-8275-evk) with:

  • The previously pinned qcom-ptool commit (old, repo-root layout): completes successfully, no regression.
  • Current qcom-ptool tip (new, 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.py and ptool.py both run successfully and produce partition XML/GPT output for shikra-evk, confirming the exact failure mode reported is resolved.

Files changed

File Change
flash/gen-flash-dirs.sh Detect qcom-ptool script layout (repo root vs qcom_ptool/) and resolve script paths and PYTHONPATH accordingly

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