Skip to content

kernel: drop the SCSI stack no Goke board can use, and build FAT in, so gk7205v200 lite fits again - #2376

Merged
openipc-ai merged 3 commits into
masterfrom
gk7205v200-lite-rebalance
Sep 7, 2026
Merged

openipc-ai merged 3 commits into
masterfrom
gk7205v200-lite-rebalance

Conversation

@openipc-ai

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

Copy link
Copy Markdown
Collaborator

What broke

Tonight's nightly (run 34048925366) failed on gk7205v300_lite: rootfs.squashfs: [5124KB/5120KB] -- size exceeded by: 4KB. It fit yesterday at 5108KB and the day before at 5100KB. The other lite boards built from this directory are at the same cliff: gk7205v200_lite 5116KB, gk7202v300_lite 5104KB, and this PR's own CI showed gk7605v100_lite at 5112KB. All have around 260KB of kernel partition unused. The rootfs of this family has been growing 8-16KB a night with the streamer build it ships, so the next board was going to fail tomorrow.

What changes

Two things, both measured from the sizes.gk7205v200-lite.json report of tonight's run, applied to all four kernel configs under br-ext-chip-goke/board/gk7205v200/:

  1. The SCSI stack is dropped. scsi_mod.ko (145KB), sd_mod.ko (36KB) and scsi_transport_fc.ko (53KB) ship in every rootfs of this family and nothing can use them: CONFIG_USB_STORAGE is not set in any Goke config, no other SCSI host driver is enabled, and SD cards come in as mmcblk, not sd. Same shape as kernel: disable f2fs on all *_lite configs to fix NOR rootfs overflow #2185 switching f2fs off. CONFIG_SCSI_MOD=y is what olddefconfig derives when SCSI is off.
  2. FAT and VFAT are built into the kernel instead of shipped as modules. Every SD card mounted on these boards needs them, so they are loaded on every camera with a card anyway. NLS was already built in, so nothing new is pulled in.

No feature changes hands.

Measured

Local from-scratch builds of this branch against the same majestic tarball the failed nightly fetched (686248 bytes, fetched 2026-09-06 18:50 UTC), compared with the nightly's numbers. This PR's CI rows reproduce the same numbers to the kilobyte.

board uImage before → after (of 2048KB) rootfs before → after (of 5120KB)
gk7205v300_lite 1783 → 1802 5124 → 5020
gk7205v200_lite 1781 → 1800 5116 → 5012
gk7202v300_lite 1839 → 1858 5104 → 5000
gk7605v100_lite 1768 → 1787 5112 → 5008

Kernel +19KB and rootfs −104KB on every board. In each built tree the effective kernel .config has # CONFIG_SCSI is not set, CONFIG_FAT_FS=y, CONFIG_VFAT_FS=y, and the rootfs carries no scsi_mod, sd_mod, scsi_transport_fc, fat or vfat module (66 modules, from 71). The ultimate images of the same configs shrink by the same amount and were never near their 8192KB limit.

Tested on hardware

gk7205v200 (IMX307, Xiongmai IPC_GK7205V200_50H20AI_S38, NOR, 5120 KB rootfs partition), flashed from nightly-20260902-dc2b3fe to an image built at this PR's head (stamped BUILD_SHA=5c4361c9…, uImage 1800KB/2048KB, rootfs 5012KB/5120KB) with sysupgrade --kernel= --rootfs=. Both partitions verified by flashcp; the camera was back on SSH about 15 s after the reboot.

  • After: /proc/filesystems lists vfat with no module loaded, modules.builtin carries fat/vfat, and kernel/drivers/scsi and kernel/fs/fat are gone from /lib/modules. modprobe vfat from S35modules exits 0.
  • FAT: mkfs.vfat on a 4 MB file, loop-mount, write, remount, read back — OK on both the old and the new kernel. No SD card is fitted to this camera, so the card path itself was not exercised; the SD host controllers register as before.
  • USB flash drive (mass-storage class 08/06): binds no driver on either image, because usb-storage was never built for Goke — modprobe usb-storage says not found, and loading sd_mod by hand on the old image still produced no /dev/sda. The dropped SCSI modules could not be used on this firmware.
  • Streaming: RTSP H.264 1920x1080 20 fps, a 10 s TCP capture received 200 frames with 0 dropped; /image.jpg HTTP 200. Overlay (majestic.yaml, shadow) preserved.
  • dmesg: the only error line is the vendor SPI-NAND probe failing on a NOR board, present regardless of this diff.

Full before/after transcript in the review thread. Not on hardware: gk7205v300, gk7202v300, gk7605v100 — same kernel tree and the same two config changes, built by CI, but the lab has only the v200.

…so gk7205v200 lite fits again

Tonight's nightly failed on gk7205v300_lite: rootfs.squashfs 5124KB against
a 5120KB partition. It is not alone. Every lite image built from this
directory is at the cliff -- gk7205v200_lite 5116KB, gk7202v300_lite 5104KB
-- while all three carry 266KB of unused kernel partition (uImage 1783KB of
2048KB). The rootfs has been growing about 8-16KB a night with the streamer
it ships, so this was going to be tomorrow's failure on the next board.

Two things pay for it, both measured from the size report of tonight's
gk7205v200_lite build:

- The SCSI stack is dead weight. scsi_mod.ko (145KB), sd_mod.ko (36KB) and
  scsi_transport_fc.ko (53KB) sit in every rootfs of this family, and
  nothing here can use them: CONFIG_USB_STORAGE is not set in any Goke
  config, no other SCSI host driver is enabled, and SD cards come in as
  mmcblk, not sd. A Fibre Channel transport on a camera was never going to
  find a fabric. Off, the same way #2185 switched f2fs off.

- FAT and VFAT move from modules into the kernel. Every SD card mounted on
  these boards needs them, so they load on every camera with a card anyway;
  as .ko files they cost 77KB of rootfs, built in they cost the kernel
  partition roughly a third of that after compression, out of 266KB spare.
  NLS is already built in, so nothing new is pulled in.

Together that is about 310KB of uncompressed rootfs, on the order of 110KB
after xz, moved off the partition that is full and partly onto the one that
is not. No feature changes hands.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Rebalance Goke lite images by removing SCSI and embedding FAT

🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Disable unused SCSI support across three Goke kernel configurations.
• Build FAT and VFAT into kernels to free constrained root filesystem space.
• Restore lite image builds while using available kernel partition headroom.
Diagram

graph TD
  A["Goke configs"] --> B{"Kernel options"} --> C["Disable SCSI"] --> D["Smaller rootfs"] --> G["Lite images"]
  B --> E["Built-in FAT"] --> F["Larger kernel"] --> G
  E --> D
Loading
High-Level Assessment

The selected approach is appropriate because it removes demonstrably unusable SCSI functionality and relocates always-required FAT support to the partition with spare capacity. Resizing flash partitions or relying on stronger rootfs compression would add compatibility or build variability without eliminating dead weight.

Files changed (3) +12 / -114

Other (3) +12 / -114
gk7202v300.generic.configRebalance GK7202V300 kernel and rootfs features +4/-38

Rebalance GK7202V300 kernel and rootfs features

• Disables the unused SCSI stack, including disk and Fibre Channel transport modules. Builds FAT and VFAT support into the kernel instead of packaging them as rootfs modules.

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

gk7205v200.generic.configRebalance GK7205V200 kernel and rootfs features +4/-38

Rebalance GK7205V200 kernel and rootfs features

• Removes modular SCSI support that has no enabled host driver. Converts FAT and VFAT from modules to built-in support to recover root filesystem space.

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

gk7205v300.generic.configRebalance GK7205V300 kernel and rootfs features +4/-38

Rebalance GK7205V300 kernel and rootfs features

• Drops unused SCSI disk and transport support from the firmware configuration. Embeds FAT and VFAT in the kernel to restore headroom for the size-constrained lite image.

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

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

qodo-free-for-open-source-projects Bot commented Sep 6, 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 owners get unverified changes 📘 Rule violation ☼ Reliability
Description
The PR disables CONFIG_SCSI and builds FAT/VFAT into three shared Goke configurations but provides
only CI image sizes and projected results, with no completed before-and-after boot, SD-card mount,
or streaming output from a real camera. Because these configurations feed eight lite, original, and
ultimate images—including the gk7205v210 alias—an unverified storage or boot regression can reach
deployed cameras during upgrade.
Code

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

+# CONFIG_SCSI is not set
Evidence
The cited kernel configurations contain the image-affecting changes that disable the SCSI stack and
move FAT/VFAT from modules into the kernel. Their consuming defconfigs show that the gk7205v200
configuration feeds lite, original, ultimate, and gk7205v210 images, while the other changed
configurations also feed ultimate images; however, the supplied review materials contain only CI
size data and expected results, not the real-camera before-and-after boot, SD-card mount, or
streaming evidence required by PR Compliance ID 1 for behavior-affecting changes.

Rule 1: Hardware evidence is present and honest
br-ext-chip-goke/board/gk7205v200/gk7202v300.generic.config[1106-1108]
br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[1102-1104]
br-ext-chip-goke/board/gk7205v200/gk7205v300.generic.config[1104-1106]
br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[2309-2311]
br-ext-chip-goke/configs/gk7205v200_lite_defconfig[18-24]
br-ext-chip-goke/configs/gk7205v200_original_defconfig[18-24]
br-ext-chip-goke/configs/gk7205v200_ultimate_defconfig[18-24]
br-ext-chip-goke/configs/gk7205v210_lite_defconfig[23-30]
br-ext-chip-goke/configs/gk7202v300_ultimate_defconfig[18-24]
br-ext-chip-goke/configs/gk7205v300_ultimate_defconfig[18-24]

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 kernel storage functionality used by multiple deployed Goke images but provides only CI size measurements and projected results. Validate representative real hardware for each changed SoC and record actual before-and-after image sizes, successful boot output, successful FAT/VFAT SD-card mounting, and successful streaming.
## Issue Context
The three shared kernel configurations disable SCSI and move FAT/VFAT from modules into the kernel. They are consumed by eight lite, original, and ultimate images, including the `gk7205v210` alias, so validation must cover the three distinct changed SoCs and confirm that both the kernel and root filesystem remain within their flash partitions. The compliance gate requires real-camera evidence for changes that can affect firmware behavior.
## Fix Focus Areas
- br-ext-chip-goke/board/gk7205v200/gk7202v300.generic.config[1106-1108]
- br-ext-chip-goke/board/gk7205v200/gk7202v300.generic.config[2222-2224]
- br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[1102-1104]
- br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config[2309-2311]
- br-ext-chip-goke/board/gk7205v200/gk7205v300.generic.config[1104-1106]
- br-ext-chip-goke/board/gk7205v200/gk7205v300.generic.config[2311-2313]

ⓘ 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 copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

…KB from the same wall

The first commit left gk7605v100.generic.config alone because that board
was not in tonight's failure. The pull request's own CI then built it:
rootfs.squashfs 5112KB of 5120KB. Same modules nobody can use, same FAT
modules every SD card needs, same 8MB layout, so the same change.
@openipc-ai
openipc-ai enabled auto-merge (squash) September 6, 2026 20:13
@openipc-ai
openipc-ai merged commit 8a68e9d into master Sep 7, 2026
26 of 27 checks passed
@openipc-ai
openipc-ai deleted the gk7205v200-lite-rebalance branch September 7, 2026 05:48
openipc-ai added a commit that referenced this pull request Sep 18, 2026
Both boards were over the 5120KB squashfs cap on master at 839b990, and each
needed a different lever.

hi3516ev300 still shipped scsi_mod, scsi_transport_fc and sd_mod -- 276KB of
modules -- while CONFIG_USB_STORAGE, CONFIG_ATA, CONFIG_ISCSI_TCP and
CONFIG_LIBFC were all unset. With no transport of any kind sd_mod can never bind
a device, and scsi_transport_fc is Fibre Channel on an IP camera; storage on
these boards is MMC, which is untouched. Nothing in general/overlay/ or any
package's files/ names them. Same dead stack #2376 removed from the four Goke
boards.

This matters because #2420 recorded hi3516ev300_lite as the hardest board to fix
-- only 43KB of kernel headroom, so it cannot pay for the build-in trade used
elsewhere. It did not have to: the crypto shape was measured on it too and came
out at 5104KB rootfs but 2018KB uImage, tripping the headroom warning on both
axes, where dropping SCSI costs no kernel bytes at all.

gk7205v300 is genuinely out of free levers -- #2376 took its SCSI stack and built
FAT in, #2421 stripped the modules it cannot load, #2433 built its crypto helpers
in, and the config is down to 13 modules with every one live. So it takes the
cheaper half of the only lever left. #2420's table shows cfg80211 + mac80211 +
mt7601u built in saves 272KB of rootfs but costs 198KB of uImage, and calls that
a trap: it trades "one commit from red on rootfs" for "one commit from red on
uImage". Only cfg80211 moves; mac80211 and mt7601u stay modules. The cost is
worth stating -- cfg80211 is now permanently resident, so every camera pays
~278KB of RAM for the wireless core whether a dongle is ever plugged in or not.

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

Measured in CI:

  hi3516ev300_lite      rootfs 5124 -> 5044KB   uImage 2005 -> 2005KB
  gk7205v300_lite       rootfs 5124 -> 5036KB   uImage 1823 -> 1885KB
  hi3516ev300_ultimate  rootfs 8124 -> 8044KB
  gk7205v300_ultimate   rootfs 6688 -> 6600KB

Neither board prints a headroom warning any more.

Not run on a camera: the one hi3516ev300 in the lab is unclaimed and its login
shell is openipc-claim, the other is down with no bootlimit/altbootcmd or serial,
and there is no gk7205v300. Stated plainly in the PR with the Scope box unticked.
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.
johnchia pushed a commit to johnchia/firmware that referenced this pull request Sep 23, 2026
Both boards were over the 5120KB squashfs cap on master at 839b990, and each
needed a different lever.

hi3516ev300 still shipped scsi_mod, scsi_transport_fc and sd_mod -- 276KB of
modules -- while CONFIG_USB_STORAGE, CONFIG_ATA, CONFIG_ISCSI_TCP and
CONFIG_LIBFC were all unset. With no transport of any kind sd_mod can never bind
a device, and scsi_transport_fc is Fibre Channel on an IP camera; storage on
these boards is MMC, which is untouched. Nothing in general/overlay/ or any
package's files/ names them. Same dead stack OpenIPC#2376 removed from the four Goke
boards.

This matters because OpenIPC#2420 recorded hi3516ev300_lite as the hardest board to fix
-- only 43KB of kernel headroom, so it cannot pay for the build-in trade used
elsewhere. It did not have to: the crypto shape was measured on it too and came
out at 5104KB rootfs but 2018KB uImage, tripping the headroom warning on both
axes, where dropping SCSI costs no kernel bytes at all.

gk7205v300 is genuinely out of free levers -- OpenIPC#2376 took its SCSI stack and built
FAT in, OpenIPC#2421 stripped the modules it cannot load, OpenIPC#2433 built its crypto helpers
in, and the config is down to 13 modules with every one live. So it takes the
cheaper half of the only lever left. OpenIPC#2420's table shows cfg80211 + mac80211 +
mt7601u built in saves 272KB of rootfs but costs 198KB of uImage, and calls that
a trap: it trades "one commit from red on rootfs" for "one commit from red on
uImage". Only cfg80211 moves; mac80211 and mt7601u stay modules. The cost is
worth stating -- cfg80211 is now permanently resident, so every camera pays
~278KB of RAM for the wireless core whether a dongle is ever plugged in or not.

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

Measured in CI:

  hi3516ev300_lite      rootfs 5124 -> 5044KB   uImage 2005 -> 2005KB
  gk7205v300_lite       rootfs 5124 -> 5036KB   uImage 1823 -> 1885KB
  hi3516ev300_ultimate  rootfs 8124 -> 8044KB
  gk7205v300_ultimate   rootfs 6688 -> 6600KB

Neither board prints a headroom warning any more.

Not run on a camera: the one hi3516ev300 in the lab is unclaimed and its login
shell is openipc-claim, the other is down with no bootlimit/altbootcmd or serial,
and there is no gk7205v300. Stated plainly in the PR with the Scope box unticked.

(cherry picked from commit 947a366)
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