Skip to content

gk7205v200, gk7605v100: build the crypto modules in, and go back under the squashfs cap - #2437

Merged
openipc-ai merged 2 commits into
masterfrom
gk7205v200-crypto-builtin
Sep 17, 2026
Merged

openipc-ai merged 2 commits into
masterfrom
gk7205v200-crypto-builtin

Conversation

@openipc-ai

@openipc-ai openipc-ai commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Two boards do not produce an image on master: gk7205v200_lite and
gk7605v100_lite, each over its 5120KB squashfs cap by exactly 16KB.

gk7605v100_lite was not in the original diagnosis — it surfaced in this PR's
own matrix, which widened to the whole goke family because these board configs
share BR2_OPENIPC_SOC_FAMILY="gk7205v200". It has its own
gk7605v100.generic.config, untouched by the first commit here, and is red on
master for the same reason: nothing had built it lately.

gk7205v200_lite 5136KB against a
5120KB squashfs cap — over by 16KB, and repack fails the build.

It went unnoticed because nothing looks at this board. It is not in the ci-matrix
selection for any recent change, and gcc-compat — which builds gk7205v200_lite
and nothing else, and only when a diff touches Makefile,
general/package/*.mk or general/package/all-patches/ — last ran on master on
2026-09-13. I hit it because #2436 edits a .mk, which re-triggered that
workflow after four days.

Reproduced from a clean worktree at origin/master with no changes of any kind,
so this is not a side effect of that PR:

$ make BOARD=gk7205v200_lite
- uImage: [1808KB/2048KB]
- rootfs.squashfs: [5136KB/5120KB]
-- size exceeded by: 16KB
make[1]: *** [Makefile:178: repack] Error 1

What this changes

The eleven kernel crypto modules are 89,572 bytes of rootfs:

gcm 16604   ccm 12544   drbg 11840   gf128mul 9844   jitterentropy_rng 9740
ctr 6940    hmac 5456   seqiv 4640   echainiv 4172   ghash-generic 4020
crc32_generic 3772

None of them is modprobed by anything. The kernel crypto API resolves them
through its own request_module(), so they cannot simply be dropped — doing so
would break wireguard and mac80211 and save nothing. Building them in is the
shape #2397 used and #2433 repeated for gk7205v300, gk7202v300 and
hi3519v101. gk7205v200 has the identical seventeen symbols still at =m;
it was simply missed.

The diff is those seventeen =m → =y, nothing else.

Hardware tested on

No physical camera — and unlike a driver or script change, that matters less
here than usual: this moves code from a .ko to vmlinux without altering what
the code is. The lab does have a gk7205v200 board, which is the reason to say
what was not done rather than imply otherwise: I did not flash it.

What is verified is the thing the PR is for — that the board builds again, and
by how much.

Evidence

Both numbers from clean builds (make clean first). This matters: Buildroot's
target/ keeps a .ko that an earlier build installed, so an incremental
rebuild after this change still ships all eleven modules and reports the old
size. My first attempt measured exactly that and showed a nonsensical 0-byte
saving against a kernel that had visibly grown.

Before, origin/master, clean worktree:

- uImage: [1808KB/2048KB]
- rootfs.squashfs: [5136KB/5120KB]
-- size exceeded by: 16KB

After, this branch, clean build:

- uImage: [1821KB/2048KB]
- rootfs.squashfs: [5112KB/5120KB]
- Build time: 03:25
-- headroom warning: rootfs.squashfs has 8KB left of 5120KB

The kernel takes 13KB of the 89KB and still has 227KB spare. The rootfs saves
24KB and the board builds.
target/lib/modules/4.9.37/kernel/crypto/ no longer exists on the built image.

gk7605v100_lite, same change to its own config, measured by this PR's CI
rather than locally — before, from this PR's first run:

- uImage: [1787KB/2048KB]
- rootfs.squashfs: [5136KB/5120KB]
-- size exceeded by: 16KB

after, from the run that went green:

- uImage: [1799KB/2048KB]
- rootfs.squashfs: [5112KB/5120KB]
-- headroom warning: rootfs.squashfs has 8KB left of 5120KB

Identical arithmetic: 24KB off the rootfs, 12KB onto a kernel with 249KB spare.

All seven boards the matrix selected are green:

SUCCESS  gk7202v300_lite     SUCCESS  gk7202v300_ultimate
SUCCESS  gk7205v200_lite     SUCCESS  gk7205v200_ultimate
SUCCESS  gk7205v300_lite     SUCCESS  gk7205v300_ultimate
SUCCESS  gk7605v100_lite

gk7202v300 and gk7205v300 still carry their seventeen crypto symbols as
modules and are deliberately left alone: both build with room today, and
converting a board that is not broken would be churn.

What this does not do

It leaves 8KB on each board, and the build says so for both. This gets them
building; it does not give them room, and the fleet-wide majestic drift that has taken six boards
over cap in #2421 and three in #2433 will take this one again.

There is no easy next 24KB in its module set. Every remaining non-vendor module
is either named by a script or dependency-loaded by one that is — checked
individually, including the five that look consumerless to a grep and are not:
usbnet, cdc_ether, mii, usb_wwan and usb-serial-simple are pulled in
by option / usbserial / rndis_host, which general/overlay/etc/wireless/modem
does modprobe. The USB gadget set that #2421/#2433 harvested is already gone
from this image.

Scope

  • No kernel patches under general/package/all-patches/linux/ — this is a board kernel config, 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
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it

…fs cap

gk7205v200_lite does not produce an image on master: 5136KB against a 5120KB
cap, over by 16KB. It is not in any recent PR's board matrix, and gcc-compat --
which builds this board and nothing else -- last ran on master on 2026-09-13,
so nothing surfaced it until a .mk change re-triggered that workflow.

The eleven kernel crypto modules are 89,572 bytes of the rootfs:

    gcm 16604   ccm 12544   drbg 11840  gf128mul 9844  jitterentropy_rng 9740
    ctr 6940    hmac 5456   seqiv 4640  echainiv 4172  ghash-generic 4020
    crc32_generic 3772

None is loaded by a script. The kernel crypto API resolves them through its own
request_module(), which is why #2397 and #2433 built them in rather than
deleting them, and why deleting them would break wireguard and mac80211 rather
than save anything. #2433 made exactly this change for gk7205v300, gk7202v300
and hi3519v101; gk7205v200 has the same seventeen symbols still at =m and was
simply missed.

Measured on a clean build, since Buildroot's target/ keeps a .ko a previous
build installed and an incremental rebuild reports the old size:

                     master          this branch
    uImage           1808KB/2048KB   1821KB/2048KB
    rootfs.squashfs  5136KB/5120KB   5112KB/5120KB   (over by 16KB -> 8KB free)

The kernel takes 13KB of the 89KB and still has 227KB spare; the rootfs saves
24KB.

That leaves 8KB, and the build says so -- "headroom warning: rootfs.squashfs
has 8KB left of 5120KB". This gets the board building again; it does not give
it room. The sweep that found this also confirmed there is no dead weight left
in its module set: every other non-vendor module is named by a script or
dependency-loaded by one that is.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Build gk7205v200 crypto into kernel to restore image builds

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Builds required crypto algorithms into the gk7205v200 kernel instead of shipping modules.
• Reduces squashfs usage below the 5120KB cap while preserving crypto consumers.
• Restores clean gk7205v200_lite image builds with 8KB rootfs headroom.
Diagram

graph TD
  A["Board config"] --> B["Crypto built-ins"] --> C["Kernel image"]
  B --> D["Crypto consumers"]
  B --> E["No crypto modules"] --> F["Smaller rootfs"] --> G["Image repack"]
Loading
High-Level Assessment

Building the crypto implementations into the kernel is the appropriate approach. Removing them would break kernel-requested dependencies for WireGuard and mac80211, while trimming unrelated modules would broaden scope and risk modem functionality; built-ins preserve capabilities and shift enough data out of squashfs to restore packaging.

Files changed (1) +17 / -17

Bug fix (1) +17 / -17
gk7205v200.generic.configLink required crypto algorithms into the gk7205v200 kernel +17/-17

Link required crypto algorithms into the gk7205v200 kernel

• Changes 17 crypto configuration symbols from modules to built-ins, eliminating eleven crypto .ko files from the rootfs. This moves functionality into the kernel image and brings gk7205v200_lite below its squashfs cap without removing crypto support.

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

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Camera behavior remains unverified 📘 Rule violation ☼ Reliability
Description
CONFIG_CRYPTO_AEAD and sixteen related CONFIG_CRYPTO_* settings move runtime crypto support from
loadable modules into the boot kernel without validation on a physical camera. Because the shared
configuration reaches lite, original, and ultimate gk7205v200 images as well as gk7205v210 cameras,
clean-build and size measurements alone leave boot-time initialization, streaming, wireless, and
WireGuard behavior unchecked.
Code

br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[2653]

+CONFIG_CRYPTO_AEAD=y
Evidence
PR Compliance ID 1 requires real-camera evidence for changes that can alter firmware behavior and
explicitly fails changes reported as untested on hardware. The cited configuration contains the
module-to-built-in crypto conversion, and the PR description confirms that no physical camera was
flashed and supplies only build-size results; the relevant defconfigs select this shared kernel
configuration for all three gk7205v200 variants, while the lite image declares gk7205v210 as an
on-device upgrade alias and the retained gk7205v210 defconfig selects the same file.

Rule 1: Hardware evidence is present and honest
br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[2653-2672]
br-ext-chip-goke/configs/gk7205v200_lite_defconfig[18-48]
br-ext-chip-goke/configs/gk7205v200_original_defconfig[17-40]
br-ext-chip-goke/configs/gk7205v200_ultimate_defconfig[17-48]
br-ext-chip-goke/configs/gk7205v210_lite_defconfig[1-50]

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 image-affecting crypto configuration changes move runtime crypto support from modules into the built-in kernel across multiple board variants and an aliased SoC model, but the resulting image was only build-tested and was not validated on a physical camera.
## Fix Focus Areas
- br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[2653-2769]
## Recommended Fix
Flash a clean image onto an affected gk7205v200 camera, verify successful boot, streaming, wireless, and WireGuard operation, and add the exact observed hardware output, measurements, and test results to the pull request evidence.

ⓘ 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 enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

gk7605v100_lite is over its 5120KB cap by 16KB on master, exactly as
gk7205v200_lite was, and for the same reason: nothing had built it lately. It
surfaced in this PR's own matrix, which widened to the whole family because
these board configs share BR2_OPENIPC_SOC_FAMILY="gk7205v200" -- the board has
its own gk7605v100.generic.config, untouched by the previous commit.

Its config carries the identical seventeen CONFIG_CRYPTO_* symbols at =m.
Same change, same reasoning as the commit before this one.
@openipc-ai openipc-ai changed the title gk7205v200: build the crypto modules in, and go back under the squashfs cap gk7205v200, gk7605v100: build the crypto modules in, and go back under the squashfs cap Sep 17, 2026
@openipc-ai
openipc-ai merged commit 3456f88 into master Sep 17, 2026
27 of 28 checks passed
@openipc-ai
openipc-ai deleted the gk7205v200-crypto-builtin branch September 17, 2026 19:05
openipc-ai added a commit that referenced this pull request Sep 18, 2026
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.
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