Skip to content

hi3518ev300_lite: build vfat/fat into kernel to free 4 KB of rootfs#2163

Merged
widgetii merged 1 commit into
masterfrom
fix/hi3518ev300-lite-vfat-builtin
May 30, 2026
Merged

hi3518ev300_lite: build vfat/fat into kernel to free 4 KB of rootfs#2163
widgetii merged 1 commit into
masterfrom
fix/hi3518ev300-lite-vfat-builtin

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

Nightly CI run 26667982165 failed for hi3518ev300_lite with rootfs.squashfs 5124 KB > 5120 KB cap (4 KB over). The lite variant has been parked at the cap for two weeks — the HISILICON_OPENSDK_TRIM_SP2308 finalize hook already drops three sensor .so files to keep this board buildable, and ~12 KB of accumulated drift since 2026-05-17 (a5614d9c) has now tipped it over.

This change flips two kernel symbols in hi3518ev300.generic.config from =m to =y:

-CONFIG_FAT_FS=m
+CONFIG_FAT_FS=y
-CONFIG_VFAT_FS=m
+CONFIG_VFAT_FS=y

Why these symbols specifically

general/overlay/etc/modules lists vfat as a boot-time autoload (loaded by general/overlay/etc/init.d/S35modules). vfat is the only .ko on this board that loads on every boot — so making it built-in is a pure layout shift, zero runtime cost. The other entry exfat belongs to the out-of-tree exfat-openipc package which is not enabled in this defconfig.

Every other =m symbol in this config (MAC80211, MT7601U, R8188EU, TUN, F2FS_FS, SCSI*, the CRYPTO_* family, etc.) is on-demand — USB-dongle insertion, WireGuard interface bring-up, USB-storage mount. Making any of those =y would burn unconditional kernel bytes for code that may never run on a given camera.

All NLS helpers vfat needs (NLS_CODEPAGE_437, NLS_ISO8859_1, NLS_ASCII) are already =y — no follow-up symbols needed.

Local build results

hi3518ev300_lite:

- uImage:          1873 → 1893 KB / 2048 KB  (155 KB headroom)
- rootfs.squashfs: 5124 → 5096 KB / 5120 KB  (24 KB headroom, was 4 KB over)

vfat.ko + fat.ko confirmed absent from output/target/lib/modules/; CONFIG_VFAT_FS=y / CONFIG_FAT_FS=y confirmed in built kernel .config; vfat_rename / namei_vfat.c strings present in vmlinux.

Cross-variant note

The same hi3518ev300.generic.config is referenced by hi3518ev300_ultimate_defconfig. Last passing CI had ultimate at uImage 1873/2048 (175 KB headroom) and rootfs.squashfs 7664/8192 (528 KB headroom); the same +20 KB kernel growth fits comfortably in both caps.

Test plan

  • CI passes for hi3518ev300_lite
  • CI passes for hi3518ev300_ultimate (shared kernel config)
  • After merge, sysupgrade-flashed hi3518ev300_lite camera mounts a FAT-formatted SD card / USB stick without manual modprobe vfat

Follow-up (separate PR)

The lite variant remains within ~25 KB of the cap with the temporary TRIM_SP2308 block still removing SP2308 + SC500AI + GC5603. The underlying drift (most likely hisilicon-opensdk bump #2156 or unpinned majestic master) warrants a bisect + compaction pass so those sensors can be restored.

🤖 Generated with Claude Code

Nightly CI run 26667982165 (job 78605352324) tipped the lite variant
over the 5120 KB NOR rootfs cap by 4 KB (5124/5120). The HISILICON_OPENSDK_TRIM_SP2308
finalize hook already trims three sensor .so files on this variant and
the cap has been creeping for two weeks.

vfat is the only kernel module on this board that auto-loads at boot
(/etc/modules → S35modules), so flipping CONFIG_VFAT_FS and its FAT_FS
dependency from =m to =y removes vfat.ko + fat.ko from rootfs at zero
runtime cost — the module was going to be loaded anyway. All required
NLS helpers (NLS_CODEPAGE_437, NLS_ISO8859_1, NLS_ASCII) are already =y.

Local build hi3518ev300_lite:
- uImage:        1873 → 1893 KB / 2048 KB (155 KB headroom)
- rootfs.squashfs: 5124 → 5096 KB / 5120 KB (24 KB headroom, was 4 KB over)

The same hi3518ev300.generic.config is shared with hi3518ev300_ultimate;
last passing CI had it at uImage 1873/2048 and rootfs.squashfs 7664/8192
so the +20 KB kernel growth fits comfortably in both caps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 747829a into master May 30, 2026
98 checks passed
@widgetii widgetii deleted the fix/hi3518ev300-lite-vfat-builtin branch May 30, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant