Skip to content

hi3516cv200, gk7205v200, gk7605v100: back under the squashfs cap - #2442

Merged
openipc-ai merged 1 commit into
masterfrom
size-cap-cv200-goke
Sep 19, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
size-cap-cv200-goke

Conversation

@openipc-ai

@openipc-ai openipc-ai commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Problem

Three boards produce no image on master. The 2026-09-18 matrix
(run 35375141337,
at 49908b5) failed on hi3516cv200_lite, gk7205v200_lite and
gk7605v100_lite — each at 5124KB against the 5120KB squashfs cap, over by
exactly 4KB, so repack fails and the board ships nothing.

All three reproduce from a clean worktree at that commit with no changes, so
this is not a side effect of anything in flight. It is the same fleet-wide
drift in the unpinned majestic / majestic-webui refs that #2404, #2410,
#2421, #2433, #2437 and #2440 each answered on other boards. #2437 merged
yesterday, left the two Goke boards 8KB of headroom, and said in as many
words that the drift would take them again. It did, in one day.

What this changes

hi3516cv200 ships two Realtek drivers that wait on firmware the image does
not carry:

driver asks request_firmware() for on the image?
rtl8192cu (rtlwifi) rtlwifi/rtl8192cufw*.bin no
rtl8xxxu (RTL8XXXU_UNTESTED off ⇒ RTL8723AU only) rtlwifi/rtl8723aufw*.bin no
r8188eu (staging) rtlwifi/rtl8188eufw.bin yes
mt7601u mediatek/mt7601u.bin yes

The two with no firmware could never finish probing, and nothing loads them
either — /etc/wireless/usb, dispatched by S40network off the wlandev
U-Boot variable, is the single entry point and names mt7601u and 8188eu,
never rtl8192cu, rtlwifi or rtl8xxxu. mdev.conf has no module-autoload
rule. That is 350KB of .ko on a rootfs 4KB over its cap:

104440  rtl8xxxu.ko
 90296  rtl8192cu.ko
 85404  rtlwifi.ko          <- RTLWIFI_DEBUG=y is why this one is so large
 54348  rtl8192c-common.ko
 15340  rtl_usb.ko

Same argument #2404 made for hi3519v101.

R8188EU stays, and the line is drawn where the firmware is:
rtlwifi/rtl8188eufw.bin is what drivers/staging/rtl8188eu/hal/fw.c requests
by name, and R8188EU is the only symbol on this board selecting
WIRELESS_EXT and WEXT_PRIV, which out-of-tree drivers a camera may add still
need. This is #2410 in reverse — there the same driver went, because that board
had no wext consumer left.

gk7205v200 and gk7605v100 are out of free levers: #2376 took their SCSI
stack, #2421 stripped the modules they cannot load, #2437 built their crypto
helpers in, and every module left is named by a script or dependency-loaded by
one that is. So they take the cheaper half of the one lever #2420 found
remaining — the same half #2440 gave gk7205v300. Only cfg80211 moves;
mac80211 and mt7601u stay modules, because moving those as well would trade
"one commit from red on rootfs" for the same on uImage (1821 + 198 = 2019 of
2048KB). The cost is worth stating: cfg80211 is now permanently resident, so
every camera pays for the wireless core whether a dongle is ever plugged in or
not.

The load path survives being built in — modules.builtin now lists
kernel/net/wireless/cfg80211.ko, which busybox modprobe consults, and
mac80211.ko's modules.dep line no longer names it.

Hardware tested on

Not run on a camera, and no output from one is offered below.

The lab has no hi3516cv200 and no gk7605v100. It does have the
gk7205v200 board this PR's Goke half targets, and it is the one board there
with bootlimit/altbootcmd, serial and remote power recovery — but it is
down: neither address it has answered to (gk7205v200-imx307 ->
10.216.128.49, openipc-gk7205v200 -> 10.216.128.63) replies to ping, a sweep
of the subnet finds no third address for it, no serial adapter is attached to
this workstation, and the PoE switch credentials needed to power-cycle it are
not available in this session. A gk7205v300 board is up, but this PR does not
touch its config, and flashing a board with no recovery path to produce
evidence for a size-only change is exactly what the wiki's flashing page warns
against.

So what follows is what can be verified without a camera, stated as that: the
boards build again, by how much, and that the image contents match the
intent — the two firmware-less drivers gone, WIRELESS_EXT/WEXT_PRIV alive,
cfg80211 moved into modules.builtin with mac80211.ko's modules.dep line
no longer naming it.

No hi3516cv200 camera — the lab has none. The hi3518ev200 board is the
same SoC family but builds from hi3518ev200.generic.config, which this PR
does not touch, so it would not be exercising the change and its output is not
offered as if it were. What is verified for that board is the part CI can
verify: it builds again, the two drivers are gone from the image, and
WIRELESS_EXT/WEXT_PRIV survive in the resolved .config.

Evidence

Both numbers from clean builds (make clean first) at 49908b5 — an
incremental rebuild keeps the old .ko in target/ and reports a nonsensical
saving, the trap #2437 documented.

Before:

hi3516cv200_lite
- uImage: [1656KB/2048KB]
- rootfs.squashfs: [5124KB/5120KB]
-- size exceeded by: 4KB

gk7205v200_lite
- uImage: [1821KB/2048KB]
- rootfs.squashfs: [5124KB/5120KB]
-- size exceeded by: 4KB

gk7605v100_lite
- uImage: [1799KB/2048KB]
- rootfs.squashfs: [5124KB/5120KB]
-- size exceeded by: 4KB

After:

hi3516cv200_lite
- uImage: [1657KB/2048KB]
- rootfs.squashfs: [5012KB/5120KB]     108KB free

gk7205v200_lite
- uImage: [1876KB/2048KB]
- rootfs.squashfs: [5044KB/5120KB]      76KB free

gk7605v100_lite
- uImage: [1855KB/2048KB]
- rootfs.squashfs: [5044KB/5120KB]      76KB free

None of the three prints a headroom warning any more.

CI reproduces those numbers to the KB — from this PR's own matrix
(run 35388844897),
all 11 selected boards green:

hi3516cv200_lite       uImage [1657KB/2048KB]   rootfs.squashfs [5012KB/5120KB]
gk7205v200_lite        uImage [1876KB/2048KB]   rootfs.squashfs [5044KB/5120KB]
gk7605v100_lite        uImage [1855KB/2048KB]   rootfs.squashfs [5044KB/5120KB]
gk7205v200_ultimate    uImage [1876KB/2048KB]   rootfs.squashfs [6612KB/8192KB]

gk7205v200_ultimate is there because it shares gk7205v200.generic.config
and so pays the same 55KB of uImage; it has 172KB of kernel headroom left.

What is left on the built images, rather than what the config says:

$ find output-cv200size/target/lib/modules -name '*.ko' | grep -iE 'rtl|8188'
.../kernel/drivers/staging/rtl8188eu/r8188eu.ko

$ grep -E '^CONFIG_(WIRELESS_EXT|WEXT_PRIV|R8188EU|RTL_CARDS|RTL8XXXU)=' \
      output-cv200size/build/linux-custom/.config
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_PRIV=y
CONFIG_R8188EU=m

$ grep cfg80211 output-gk7205v200_litesize/target/lib/modules/4.9.37/modules.builtin
kernel/net/wireless/cfg80211.ko
$ find output-gk7205v200_litesize/target/lib/modules -name 'cfg80211.ko'
$ grep cfg80211 output-gk7205v200_litesize/target/lib/modules/4.9.37/modules.dep

CI selector, for the reviewer:

$ git diff --name-only origin/master | python3 .github/scripts/ci-matrix.py --stdin
ci-matrix: 11/99 boards (needs_build=True) --- narrowed to the affected boards
  gk7202v300_lite       gk7202v300_ultimate   gk7205v200_lite
  gk7205v200_ultimate   gk7205v300_lite       gk7205v300_ultimate
  gk7605v100_lite       hi3516cv200_lite      hi3516cv200_neo
  hi3518ev200_lite      hi3518ev200_ultimate

What this does not do

It buys 76–108KB, not a fix for the cause. The unpinned majestic refs took six
boards over cap in #2421, three in #2433, two in #2437 and two in #2440, and
they will take more. hi3516cv200 has one large lever left after this
(r8188eu, 435KB of .ko), and the Goke pair has only the expensive half of
the wireless build-in, which their uImage headroom cannot pay for today.

Scope

  • No kernel patches under general/package/all-patches/linux/ — these are board kernel configs, which CLAUDE.md places in this repository
  • No files specific to a single retail camera model
  • No probing or bring-up tooling
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board — no file outside br-ext-chip-*/board/ is touched
  • Package sources come from an OpenIPC repository — no *_SITE or *_VERSION is touched
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it — all three boards are in ALL_BOARDS

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Restore image headroom and retry failed sensor detection

🐞 Bug fix ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Restore squashfs headroom by rebalancing or removing unused wireless drivers.
• Prevent failed sensor probes from permanently persisting sensor=unknown.
• Clear legacy unknown sensor state so upgraded cameras retry detection.
Diagram

graph TD
  A["Board configs"] --> B["Kernel build"] --> C["Firmware image"] --> E["Camera boot"] --> F{"Sensor state?"}
  D["Load scripts"] --> C
  F -->|Valid| G["Sensor startup"]
  F -->|"Missing or unknown"| H["ipcinfo probe"]
  H -->|Detected| G
  H -->|"Miss: leave unset"| E
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin drifting application references
  • ➕ Addresses the fleet-wide source of repeated squashfs overflows
  • ➕ Makes image sizes and builds more reproducible
  • ➕ Reduces recurring board-specific kernel compromises
  • ➖ Requires an update and release policy for Majestic components
  • ➖ Does not recover already-latched sensor environments
  • ➖ May defer desired upstream application changes
2. Centralize sensor persistence logic
  • ➕ Avoids duplicating the same recovery guard across thirteen scripts
  • ➕ Makes future sensor-state fixes consistent across chipset families
  • ➕ Creates one location for regression testing
  • ➖ Requires shared runtime packaging across otherwise isolated platform packages
  • ➖ Introduces broader architectural risk than the small shell guards
  • ➖ Could complicate platform-specific startup behavior
3. Split sizing and sensor fixes
  • ➕ Keeps unrelated kernel and boot-flow risks independently reviewable
  • ➕ Allows targeted rollback and clearer release notes
  • ➕ Aligns the PR title and validation scope with each change
  • ➖ Requires separate CI cycles and coordination
  • ➖ Delays one of the fixes if reviews proceed sequentially

Recommendation: Split the cross-platform sensor recovery into its own PR, then retain the current board-specific kernel changes as the immediate image-cap fix. Follow with pinned or otherwise reproducible Majestic references, because moving cfg80211 into the kernel and removing unusable drivers buys headroom but does not address recurring fleet-wide size drift; the duplicated sensor guards are appropriate for a low-risk repair until a shared helper can be introduced safely.

Files changed (16) +264 / -23

Bug fix (13) +234 / -13
load_gokeRetry failed Goke sensor detection +18/-1

Retry failed Goke sensor detection

• Clears legacy 'sensor=unknown' U-Boot state before selection and persists only successful detections. Failed probes therefore remain retryable on later boots.

general/package/goke-osdrv-gk7205v200/files/script/load_goke

load_gokeRetry failed GK7205V500 sensor detection +18/-1

Retry failed GK7205V500 sensor detection

• Removes stale 'sensor=unknown' state and prevents new detection failures from being written to U-Boot. This avoids permanently bypassing sensor probing after a transient failure.

general/package/goke-osdrv-gk7205v500/files/script/load_goke

load_grainmediaRetry failed GrainMedia sensor detection +18/-1

Retry failed GrainMedia sensor detection

• Clears persisted unknown sensor values before reading the U-Boot environment and stores only valid probe results. Cameras can retry detection after transient hardware or driver problems are corrected.

general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia

load_hisiliconRetry failed HI3516AV100 sensor detection +18/-1

Retry failed HI3516AV100 sensor detection

• Repairs legacy 'sensor=unknown' state and guards U-Boot writes against failed sensor probes. Subsequent boots can run detection again instead of remaining latched off.

general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon

load_hisiliconRetry failed HI3516CV100 sensor detection +18/-1

Retry failed HI3516CV100 sensor detection

• Clears stale unknown sensor state and persists a sensor only when detection succeeds. Failed probes remain unset for another attempt on the next boot.

general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon

load_hisiliconRetry failed HI3516CV200 sensor detection +18/-1

Retry failed HI3516CV200 sensor detection

• Removes legacy 'sensor=unknown' values and prevents failed detections from being persisted. This restores automatic recovery when the original probe failure is later resolved.

general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon

load_hisiliconRetry failed HI3516CV300 sensor detection +18/-1

Retry failed HI3516CV300 sensor detection

• Treats persisted unknown sensor state as stale and writes only successful sensor detections. The camera can probe again after transient startup failures.

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon

load_hisiliconRetry failed HI3516CV500 sensor detection +18/-1

Retry failed HI3516CV500 sensor detection

• Clears existing unknown sensor state before environment lookup and skips persistence when probing fails. This prevents a single failure from disabling all future detection.

general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon

load_hisiliconRetry failed HI3516CV6xx sensor detection +18/-1

Retry failed HI3516CV6xx sensor detection

• Repairs stale unknown U-Boot state and records only detected sensors. An unsuccessful probe remains retryable on subsequent boots.

general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon

load_hisiliconRetry failed HI3516EV200 sensor detection +18/-1

Retry failed HI3516EV200 sensor detection

• Deletes legacy 'sensor=unknown' state and avoids storing new unknown results. Sensor probing therefore resumes after recoverable hardware or software failures.

general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon

load_hisiliconRetry failed HI3519DV500 sensor detection +18/-1

Retry failed HI3519DV500 sensor detection

• Clears persisted unknown sensor values and guards environment writes so only successful detections are cached. Failed detection is retried on later boots.

general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon

load_hisiliconRetry failed HI3519V101 sensor detection +18/-1

Retry failed HI3519V101 sensor detection

• Treats 'sensor=unknown' as stale state and prevents failed probes from recreating it. This removes the permanent camera-off latch caused by an initial detection miss.

general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon

load_novatekRetry failed Novatek sensor detection +18/-1

Retry failed Novatek sensor detection

• Clears legacy unknown sensor state and persists only valid ipcinfo results. Novatek cameras can retry probing after the cause of an earlier failure is fixed.

general/package/novatek-osdrv-nt9856x/files/script/load_novatek

Other (3) +30 / -10
gk7205v200.generic.configBuild cfg80211 into the gk7205v200 kernel +9/-1

Build cfg80211 into the gk7205v200 kernel

• Changes cfg80211 from a module to built-in, moving wireless-core bytes out of the capped squashfs while leaving mac80211 and mt7601u modular. Comments document the rootfs, uImage, and permanent-RAM tradeoffs.

br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config

gk7605v100.generic.configBuild cfg80211 into the gk7605v100 kernel +9/-1

Build cfg80211 into the gk7605v100 kernel

• Changes cfg80211 from a module to built-in to recover squashfs headroom without also moving mac80211 and mt7601u. The rationale records the resulting kernel-size and resident-memory costs.

br-ext-chip-goke/board/gk7205v200/gk7605v100.generic.config

hi3516cv200.generic.configRemove unusable Realtek wireless drivers +12/-8

Remove unusable Realtek wireless drivers

• Disables RTL_CARDS and RTL8XXXU because their required firmware is absent and no image script loads them. Retains R8188EU to support the shipped firmware and preserve WIRELESS_EXT/WEXT_PRIV consumers.

br-ext-chip-hisilicon/board/hi3516cv200/hi3516cv200.generic.config

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 18, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Most changed camera families lack tests ✓ Resolved 📘 Rule violation ☼ Reliability
Description
The changed load_* scripts alter persisted sensor handling across thirteen SoC-family packages,
but the PR reports a real-camera boot and stream check only for gk7205v200. The untested Grain
Media, Hisilicon, Novatek, and second Goke families will execute the new stale-value cleanup and
failed-detection guard during startup without board output showing that sensor detection and
streaming still work.
Code

general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia[R32-34]

+	if [ "$(fw_printenv -n sensor 2>/dev/null)" = "unknown" ]; then
+		fw_setenv sensor
+	fi
Evidence
Rule 1 requires real-camera output whenever a diff can change firmware behavior and explicitly
treats statements that hardware was unavailable as failures. The cited startup-script changes clear
persistent sensor state and therefore alter boot-time detection on cameras, while the PR description
identifies hardware testing only for gk7205v200 and explicitly says no hi3516cv200 camera was
available.

Rule 1: Hardware evidence is present and honest
general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia[32-34]
general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon[501-503]
general/package/novatek-osdrv-nt9856x/files/script/load_novatek[170-172]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes on-camera sensor startup behavior across multiple SoC families, but supplies hardware boot and stream evidence only for gk7205v200. Compliance requires real-camera evidence for firmware behavior changes on each affected board or family represented by these shared scripts.
## Fix Focus Areas
- general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia[32-34]
- general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon[501-503]
- general/package/novatek-osdrv-nt9856x/files/script/load_novatek[170-172]
## Recommended Fix
Test representative affected hardware for every changed SoC-family script and add actual boot, sensor-detection, and stream output to the PR evidence. If hardware evidence cannot be provided for a family, remove that family’s behavioral change from this PR rather than claiming build-only validation.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Four camera families stay latched dark 🐞 Bug ≡ Correctness
Description
load_sigmastar in four SigmaStar packages still writes every ipcinfo -s result to sensor and,
unlike the changed loaders, neither clears nor excludes unknown. S70vendor invokes these scripts
with -i, so after one failed probe the nonempty saved value suppresses all later detection on
Infinity6, Infinity6B0, Infinity6C, and Infinity6E cameras.
Code

general/package/goke-osdrv-gk7205v200/files/script/load_goke[R485-486]

+			if [ "$SENSOR" != "unknown" ]; then
+				fw_setenv sensor $SENSOR && logger -s -p daemon.info -t goke "Writing ${SENSOR} to U-Boot ENV"
Evidence
The changed Goke loader guards persistence against unknown, while every SigmaStar loader still
initializes from the saved environment and unconditionally persists the short sensor result on its
normal path. Startup passes -i; therefore their -z "$1" || -z "$SENSOR" gates do not rerun
detection when the saved value is the nonempty string unknown, after which the unsupported-sensor
branch loads no sensor module.

general/package/goke-osdrv-gk7205v200/files/script/load_goke[479-486]
general/overlay/etc/init.d/S70vendor[3-8]
general/package/sigmastar-osdrv-infinity6/files/script/load_sigmastar[7-16]
general/package/sigmastar-osdrv-infinity6/files/script/load_sigmastar[54-61]
general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar[7-16]
general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar[57-64]
general/package/sigmastar-osdrv-infinity6c/files/script/load_sigmastar[7-18]
general/package/sigmastar-osdrv-infinity6c/files/script/load_sigmastar[67-74]
general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar[7-18]
general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar[63-70]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR applies retry-safe sensor persistence to Goke, Hisilicon, Grainmedia, and Novatek loaders but leaves four SigmaStar loaders with the same `sensor=unknown` latching behavior. Because normal startup passes `-i`, a persisted failed result prevents subsequent probes and leaves affected cameras without a supported sensor module.
## Fix Focus Areas
- general/package/sigmastar-osdrv-infinity6/files/script/load_sigmastar[7-16]
- general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar[7-16]
- general/package/sigmastar-osdrv-infinity6c/files/script/load_sigmastar[7-18]
- general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar[7-18]
## Recommended Fix
Apply the same two-part behavior used by the changed loaders: clear a pre-existing `sensor=unknown` before deciding whether detection is needed, and call `fw_setenv sensor` only for successful values other than `unknown`. Preserve the Infinity6C and Infinity6E FPV condition that deliberately avoids persisting sensor detection.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Upgraded cameras stay latched off 🐞 Bug ≡ Correctness
Description
The new fw_setenv sensor recovery block is inside the else of if [ -n "$SENSOR" ], but rcS
has already exported SENSOR from U-Boot before it starts S70vendor. When a prior image stored
sensor=unknown, every normal vendor-loader invocation inherits that non-empty value, logs it as
manually set, and never reaches the new clear-and-redetect path; the same placement is repeated
across the changed loaders.
Code

general/package/goke-osdrv-gk7205v200/files/script/load_goke[R466-468]

+		if [ "$(fw_printenv -n sensor 2>/dev/null)" = "unknown" ]; then
+			fw_setenv sensor
+		fi
Evidence
rcS exports the U-Boot sensor value into the init environment before invoking init scripts, and
S70vendor subsequently executes the loader without unsetting it. The changed loader only executes
the cleanup after the non-empty SENSOR test has failed, so an inherited literal unknown bypasses
the cleanup entirely.

general/overlay/etc/init.d/rcS[1-2]
general/overlay/etc/init.d/S70vendor[4-7]
general/package/goke-osdrv-gk7205v200/files/script/load_goke[458-470]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Normal boot inherits `SENSOR=unknown` from `rcS`, so the stale-value cleanup currently located in the empty-`SENSOR` branch is unreachable. Move recovery ahead of the manual/explicit sensor check, and apply the corrected ordering consistently to every loader changed by this PR.
## Fix Focus Areas
- general/overlay/etc/init.d/rcS[1-2]
- general/package/goke-osdrv-gk7205v200/files/script/load_goke[458-470]
- general/package/goke-osdrv-gk7205v500/files/script/load_goke[270-282]
## Recommended Fix
Before testing whether `SENSOR` is non-empty, detect the inherited `SENSOR=unknown` value, clear the U-Boot `sensor` variable, and unset or replace the shell `SENSOR` value so execution continues into the existing environment-read/detection path. Apply this sequence to each modified vendor loader while preserving an explicitly supplied non-`unknown` sensor override.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia Outdated
Comment thread general/package/goke-osdrv-gk7205v200/files/script/load_goke Outdated
Comment thread general/package/goke-osdrv-gk7205v200/files/script/load_goke Outdated
The 2026-09-18 master matrix (run 35375141337, at 49908b5) failed on three
boards, each at 5124KB against the 5120KB squashfs cap -- over by exactly 4KB.
All three were reproduced locally from a clean worktree at that commit before
anything here was changed, and the cause is the same fleet-wide drift in the
unpinned majestic and majestic-webui refs that #2404, #2410, #2421, #2433,
#2437 and #2440 have each answered on other boards. #2437 landed one day ago
and left these two Goke boards 8KB of headroom while saying in as many words
that the drift would take them again; it did.

hi3516cv200 shipped two Realtek drivers waiting on firmware the image does not
carry. rtl8192cu asks for rtlwifi/rtl8192cufw*.bin, and rtl8xxxu -- with
RTL8XXXU_UNTESTED off, so RTL8723AU only -- asks for rtlwifi/rtl8723aufw*.bin.
The only Wi-Fi blobs this board installs are mediatek/mt7601u.bin and
rtlwifi/rtl8188eufw.bin, so neither could finish probing, and nothing loads
them either: /etc/wireless/usb, dispatched by S40network from the wlandev
U-Boot variable, is the one entry point and names mt7601u and 8188eu.
That was 350KB of .ko (rtl8xxxu 104KB, rtl8192cu 90KB, rtlwifi 85KB,
rtl8192c-common 54KB, rtl_usb 15KB), and RTLWIFI_DEBUG=y is why rtlwifi.ko was
as large as it was. Same argument as #2404 made for hi3519v101.

R8188EU stays, and the line is drawn where the firmware is: rtl8188eufw.bin is
what drivers/staging/rtl8188eu/hal/fw.c requests by name, and R8188EU is the
only symbol on this board selecting WIRELESS_EXT and WEXT_PRIV, which the
out-of-tree drivers a camera may add still need. This is #2410 in reverse --
there the same driver went, because that board had no wext consumer left.

gk7205v200 and gk7605v100 are out of free levers: #2376 took their SCSI stack,
#2421 stripped the modules they cannot load, #2437 built their crypto helpers
in, and every module left is named by a script or dependency-loaded by one that
is. So they take the cheaper half of the one lever #2420 found remaining, the
same half #2440 gave gk7205v300. Only cfg80211 moves; mac80211 and mt7601u stay
modules, because moving those too would trade "one commit from red on rootfs"
for the same on uImage. The cost is worth stating: cfg80211 is now permanently
resident, so every camera pays for the wireless core whether a dongle is ever
plugged in or not.

The load path survives being built in -- modules.builtin now lists
kernel/net/wireless/cfg80211.ko, which busybox modprobe consults, and
mac80211.ko's modules.dep line no longer names it.

Measured locally, clean builds of both the before and the after -- an
incremental rebuild keeps the old .ko in target/ and reports a nonsensical
saving, which is the trap #2437 documented:

  hi3516cv200_lite   rootfs 5124 -> 5012KB   uImage 1656 -> 1657KB
  gk7205v200_lite    rootfs 5124 -> 5044KB   uImage 1821 -> 1876KB
  gk7605v100_lite    rootfs 5124 -> 5044KB   uImage 1799 -> 1855KB

None of the three prints a headroom warning any more.
openipc-ai added a commit that referenced this pull request Sep 19, 2026
The previous attempt at this put the recovery inside the branch reached when
SENSOR is empty, which on a real camera is the one branch that never runs.
/etc/init.d/rcS line 2 is

    export SENSOR=$(fw_printenv -n sensor)

so by the time S70vendor calls load_<vendor> -i, an already-latched camera has
SENSOR=unknown in its environment. The loader takes

    if [ -n "$SENSOR" ]; then
            logger ... "SENSOR: ${SENSOR}"

logs the sentinel as a manually-set sensor, and the recovery below it is
unreachable. The fix was inert on exactly the cameras it was written for.

Clearing before that test, and blanking the shell variable as well as the
stored one, puts the camera back on the detection path.

Verified with the shipped block run under busybox ash, with fw_printenv /
fw_setenv backed by a file and -- this time -- SENSOR exported from that file
first, the way rcS does. The earlier harness set SENSOR= by hand, which is
precisely why it reported a fix that could not work:

    A. latched camera, sensor now detectable
       before: boot1 SENSOR=unknown detection_runs=0 env=[sensor=unknown]
       after:  boot1 SENSOR=sc2336  detection_runs=1 env=[sensor=sc2336]

    B. fresh camera, undetectable then detectable
       before: boot2 SENSOR=unknown detection_runs=1 env=[sensor=unknown]
       after:  boot2 SENSOR=sc2336  detection_runs=2 env=[sensor=sc2336]

    C. working camera, sensor already stored
       before: boot1 SENSOR=sc2336 detection_runs=0 env=[sensor=sc2336]
       after:  boot1 SENSOR=sc2336 detection_runs=0 env=[sensor=sc2336]

C is the no-regression case and is byte-identical either side.

Found by the Qodo review on #2442, which reviewed this branch's code against
that PR.
@openipc-ai
openipc-ai merged commit 0688bc0 into master Sep 19, 2026
35 of 36 checks passed
@openipc-ai
openipc-ai deleted the size-cap-cv200-goke branch September 19, 2026 04:33
openipc-ai added a commit that referenced this pull request Sep 19, 2026
The previous attempt at this put the recovery inside the branch reached when
SENSOR is empty, which on a real camera is the one branch that never runs.
/etc/init.d/rcS line 2 is

    export SENSOR=$(fw_printenv -n sensor)

so by the time S70vendor calls load_<vendor> -i, an already-latched camera has
SENSOR=unknown in its environment. The loader takes

    if [ -n "$SENSOR" ]; then
            logger ... "SENSOR: ${SENSOR}"

logs the sentinel as a manually-set sensor, and the recovery below it is
unreachable. The fix was inert on exactly the cameras it was written for.

Clearing before that test, and blanking the shell variable as well as the
stored one, puts the camera back on the detection path.

Verified with the shipped block run under busybox ash, with fw_printenv /
fw_setenv backed by a file and -- this time -- SENSOR exported from that file
first, the way rcS does. The earlier harness set SENSOR= by hand, which is
precisely why it reported a fix that could not work:

    A. latched camera, sensor now detectable
       before: boot1 SENSOR=unknown detection_runs=0 env=[sensor=unknown]
       after:  boot1 SENSOR=sc2336  detection_runs=1 env=[sensor=sc2336]

    B. fresh camera, undetectable then detectable
       before: boot2 SENSOR=unknown detection_runs=1 env=[sensor=unknown]
       after:  boot2 SENSOR=sc2336  detection_runs=2 env=[sensor=sc2336]

    C. working camera, sensor already stored
       before: boot1 SENSOR=sc2336 detection_runs=0 env=[sensor=sc2336]
       after:  boot1 SENSOR=sc2336 detection_runs=0 env=[sensor=sc2336]

C is the no-regression case and is byte-identical either side.

Found by the Qodo review on #2442, which reviewed this branch's code against
that PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant