Commit 72954a7
extension: fix binman pkg_resources removal in setuptools >= 82
setuptools 82.0.0 removed the deprecated pkg_resources module.
U-Boot's binman (tools/binman/control.py) uses `import pkg_resources`
for reading package resources in versions prior to v2025.10.
Add extension that patches binman at build time via pre_config_uboot_target
hook, migrating from pkg_resources to importlib.resources:
- Old U-Boot (<=v2023.x): adds try/except importlib_resources import block
- Intermediate U-Boot (v2024.01+): aliases existing importlib.resources import
- New U-Boot (>=v2025.10): no-op (pkg_resources already removed upstream)
Replaces:
- pkg_resources.resource_string() -> importlib_resources.files().joinpath().read_bytes()
- pkg_resources.resource_listdir() -> [r.name for r in ...files().joinpath().iterdir()]
Using an extension rather than patch files because BOOTPATCHDIR varies
across ~15 families, and control.py differs between U-Boot versions.
A single idempotent extension covers all versions.
Can be removed once all BOOTBRANCH versions in Armbian are >= v2025.10.
Tested:
- tritium-h5 (sunxi, U-Boot v2024.01): patch applied, build OK
- odroidc4 (meson-sm1, U-Boot v2022.07): patch applied, build OK
- odroidm2 (rk3588, U-Boot v2025.10): no-op as expected, build OK
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 85af201 commit 72954a7
1 file changed
+88
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments