Skip to content

fix: rename imx8m bare hook so binman pkg_resources patch can run#9752

Merged
igorpecovnik merged 1 commit intomainfrom
fix-imx8m-uboot-binman-hook-conflict
May 3, 2026
Merged

fix: rename imx8m bare hook so binman pkg_resources patch can run#9752
igorpecovnik merged 1 commit intomainfrom
fix-imx8m-uboot-binman-hook-conflict

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented May 3, 2026

Symptom

uboot-mba8mpxl-ras314-current nightly fails at BINMAN flash.bin with ModuleNotFoundError: No module named 'pkg_resources'. Run 25262303737.

Cause

config/sources/families/imx8m.conf:32 defines pre_config_uboot_target() (bare). The framework treats a bare hook as the full implementation and silently drops any <hook>__<purpose> companions:

WARNING: Extension conflict [ function pre_config_uboot_target already defined!
                              ignoring functions:
                              pre_config_uboot_target__fix_binman_pkg_resources ]

So #9407's binman-fix extension never patches tools/binman/control.py on i.MX 8M boards. Combined with setuptools >= 82 dropping pkg_resources, the u-boot v2024.04 binman blows up the moment make flash.bin runs.

Fix

Rename to pre_config_uboot_target__imx8m_firmware(). Body unchanged — same NXP firmware fetch + per-board copy. Both hooks now coexist and run; order doesn't matter (firmware blob copy vs. Python source rewrite are independent).

Test plan

  • Re-run the failing nightly — Patching binman info line should appear and make flash.bin complete.
  • Spot-check one other i.MX 8M board (mba8mpxl, imx8mp-tqma8mpql-mba8mpxl) builds clean.

Summary by CodeRabbit

  • Refactor

    • Standardized bootloader hook naming to improve configuration clarity and maintainability.
    • Improved firmware handling during bootloader setup so required HDMI/DP and DDR artifacts are fetched and applied automatically.
  • Documentation

    • Added comments explaining hook naming conventions and parallel-hook behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

📝 Walkthrough

Walkthrough

The i.MX8M bootloader hook in config/sources/families/imx8m.conf was renamed from pre_config_uboot_target() to pre_config_uboot_target__imx8m_firmware() and annotated with comments describing the <hook>__<purpose> convention; the hook body (firmware download, execution, and artifact copying) is unchanged.

Changes

Hook Naming Convention Update

Layer / File(s) Summary
Documentation & Convention
config/sources/families/imx8m.conf
Add comments documenting the <hook>__<purpose> naming pattern and noting that a non-namespaced pre_config_uboot_target() would suppress other registrations.
Function Rename / Implementation
config/sources/families/imx8m.conf
Rename pre_config_uboot_target()pre_config_uboot_target__imx8m_firmware(); keep existing logic that downloads/runs firmware and copies HDMI/DP and DDR artifacts.
Tests / Manifest
(none)
No test or manifest changes in this diff.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble names in quiet code,
A gentle hop, a tidy mode.
Hooks now wear their purpose clear,
Firmware finds its path sincere.
A tiny change, well placed and bright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: renaming a hook function to resolve a build conflict. It accurately reflects the core fix and explains the purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-imx8m-uboot-binman-hook-conflict

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added 05 Milestone: Second quarter release size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels May 3, 2026
@igorpecovnik igorpecovnik force-pushed the fix-imx8m-uboot-binman-hook-conflict branch from bae3951 to cdaa28c Compare May 3, 2026 07:12
`imx8m.conf` defined a bare `pre_config_uboot_target()`. The framework
treats a bare hook as the full implementation and drops any
`pre_config_uboot_target__<purpose>` companions, so #9407's
auto-enabled `uboot-binman-fix-pkg-resources` extension was never
firing on i.MX 8M boards — `tools/binman/control.py`'s
`import pkg_resources` stayed unpatched, and `make flash.bin` died
with `ModuleNotFoundError` on Python 3.12 / setuptools >= 82.

Rename to `pre_config_uboot_target__imx8m_firmware()`. Body unchanged.
Both hooks now register and run; order between them doesn't matter
(NXP firmware fetch vs. Python source rewrite are independent).

Repro: armbian/os run 25262303737, job uboot-mba8mpxl-ras314-current.
@igorpecovnik igorpecovnik force-pushed the fix-imx8m-uboot-binman-hook-conflict branch from cdaa28c to 96ab5bf Compare May 3, 2026 07:14
@igorpecovnik igorpecovnik requested a review from schmiedelm May 3, 2026 07:14
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels May 3, 2026
@github-actions github-actions Bot added Needs review Seeking for review and removed Ready to merge Reviewed, tested and ready for merge labels May 3, 2026
@igorpecovnik igorpecovnik merged commit cd55d66 into main May 3, 2026
12 checks passed
@igorpecovnik igorpecovnik deleted the fix-imx8m-uboot-binman-hook-conflict branch May 3, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant