hisilicon-opensdk: restrict fpv variant to IMX307 + IMX335 sensors#2132
Merged
Conversation
PR #2054 (2026-05-08, "build 30 sensor drivers from source") moved hi3516ev200 and gk7205v200 sensor .so files from pre-built vendor blobs to source-built. The source-built versions are ~+160 KB compressed in the squashfs vs the vendor's stripped pre-built ones, which pushed every _fpv variant past the 5120 KB NOR rootfs cap: hi3516ev200_fpv : 5196 KB / 5120 KB (76 KB over) hi3516ev300_fpv : 5196 KB / 5120 KB (76 KB over) Bisect via OpenIPC/builder#94's firmware_ref input (build at parent of #2054, 4d88e9d) confirmed: with the same builder.sh, same hisilicon-opensdk VERSION, same majestic, ONLY the absence of #2054 makes the rootfs fit (5028 KB, 92 KB headroom). See kaeru 'hi3516ev200-ev300-fpv-rootfs-size-overflow-2026-05-24' for the full investigation including the false-start on majestic (variant conflation; widgetii/majestic#88 caught the methodology error). Per-binary section anatomy explains why compile-flag tweaks (-ffunction-sections + --gc-sections, -flto, -fvisibility=hidden) have limited leverage here: a sensor .so is dominated by .data (calibration + register tables), 3:1 over .text. Dropping unreachable sections only helps the small .text fraction. Net realistic saving from flag tweaks alone: ~30 KB compressed — clears the current overflow but leaves no headroom for the next majestic / kernel module nudge. Per-variant sensor pruning has dramatically higher leverage: an fpv camera is permanently paired with one sensor model, so the other 26 HISILICON_OPENSDK_SENSORS_$(family) entries are dead weight. Restricting to the four high-fps-validated Sony entries (IMX307 + IMX307_2L + IMX335 + IMX335_2L) saves ~26 × ~40 KB = ~1 MB uncompressed → ~300-400 KB compressed in squashfs. Comfortably under the cap with room for future drift. IMX307 and IMX335 are the only sensors with fpv-validated high-fps presets so far (PRs #2090, #2091, #2093, #2094). Others can be re-enabled per user request once their high-fps modes are checked and the rootfs partition has room. Follows the existing HISILICON_OPENSDK_TRIM_SP2308 pattern in this file (hi3518ev300_lite restriction added by an earlier majestic bump). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
VerificationBuilt Identical to the 2026-05-08 pre-#2054 baseline, full 104 KB headroom restored.
-188 KB compressed savings from dropping 26 unused sensors. Ready to merge. |
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.
Summary
Restricts
HISILICON_OPENSDK_SENSORSto the four high-fps-validated Sony entries (IMX307 + IMX307_2L + IMX335 + IMX335_2L) whenOPENIPC_VARIANT=fpvANDOPENIPC_SOC_FAMILY ∈ {hi3516ev200, gk7205v200}. Restoreshi3516ev200_fpv/hi3516ev300_fpv(and any future device-specific*_fpv_*matrix entry under these families) to a buildable state.Why
PR #2054 (2026-05-08, "build 30 sensor drivers from source") moved hi3516ev200 + gk7205v200 sensor
.sofiles from pre-built vendor blobs to source-built. The source builds are ~+160 KB compressed in the squashfs vs the vendor's stripped pre-built ones, pushing every_fpvvariant past the 5120 KB NOR rootfs cap:Bisect proof
Using OpenIPC/builder#94's
firmware_refinput onbuild-one.yml:4d88e9d1be1b6c97fc6cda4Same builder.sh, same
hisilicon-opensdkSHA, same majestic — only #2054's source-built switch differs. (Earlier attribution to majestic growth was a methodology error caught by widgetii/majestic#88 — variant-conflation in the comparison. See kaeruhi3516ev200-ev300-fpv-rootfs-size-overflow-2026-05-24for the full trace.)Why pruning, not compile-flag tweaks
Per-binary section anatomy explains it:
Sensor
.sofiles are data-dominated 3:1 over text.-ffunction-sections + -Wl,--gc-sectionsand-fltomostly help.text— limited leverage when the.datais what bloats and is reachable through the exported dlopen API. Realistic flag-tweak saving: ~30 KB compressed across all sensors. Clears the current 76 KB overflow with zero margin for next drift.Per-variant sensor pruning has dramatically higher leverage:
That's 4x the overflow, leaving comfortable headroom for normal package growth.
Why IMX307 + IMX335 specifically
These two sensors have fpv-validated high-fps presets shipped by recent PRs:
The 2-lane variants (
_2L) are included because some board layouts use 2-lane MIPI wiring rather than 4-lane. Other sensors can be re-enabled per user request once their fpv high-fps modes are characterized.Precedent in this file
Same shape as the existing
HISILICON_OPENSDK_TRIM_SP2308finalize hook forhi3518ev300/lite(added when a previous majestic bump exceeded that variant's cap). This is the cleaner version — restricts at install enumeration rather than removing after install.Test plan
hi3516ev200_fpvagainst master HEAD produces rootfs.squashfs ≪ 5120 KB.hi3516ev300_fpv,gk7205v200_fpv, and the device-specific*_fpv_*matrix entries under these families./usr/lib/sensors/on a flashed fpv camera contains onlylibsns_imx307{,_2l}.so+libsns_imx335{,_2l}.so.🤖 Generated with Claude Code