Skip to content

cv200 family, gk7201v200: build and publish the split NOR image on every device - #222

Merged
openipc-ai merged 1 commit into
masterfrom
cv200-family-split-nor
Nov 2, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
cv200-family-split-nor

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

Problem

OpenIPC/firmware#2668 moved four generic profiles to the split NOR layout (uImage and squashfs in one firmware partition that the kernel divides at boot): hi3516cv200_lite, hi3518ev200_lite, hi3518ev200_ultimate and gk7201v200_lite. A camera on that layout takes only a -split package. Offered a device's plain package, sysupgrade refuses:

This camera runs the split NOR layout and upgrades from firmware.bin (openipc.hi3518ev200-nor-lite-split.tgz), not a separate kernel and rootfs. Nothing was written. Aborting.

That's how the OpenIPC/firmware#2675 camera met it, fixed for its own device in #221. None of the eleven devices built on those four profiles has the split layout, so any of them that has been on the generic image can't come back to its own.

Change

Exactly what #221 did for the Baolian, and firmware#2668 for the profiles:

  • All 11 defconfigs:
    BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh"
    BR2_OPENIPC_NOR_FIXED_PACKAGE=y
    
  • The 4 devices that ship their own kernel config (trassir-tr-d4121ir1-v2, lenovo-snowman-1080p lite and ultimate, vstarcam-c8892wip) get, appended where firmware's configs have them:
    CONFIG_MTD_ROOTFS_ROOT_DEV=y
    CONFIG_MTD_SPLIT_FIRMWARE=y
    CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware"
    CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y
    CONFIG_MTD_SPLIT_UIMAGE_FW=y
    
    The other 7 build with firmware's generic kernel configs, which have these since #2668.
Device defconfig kernel config
gk7201v200_lite_xm-7205-rtl8733bu-16mb split lines firmware's
hi3516cv200_lite_spezvision-svi-252b-k202 split lines firmware's
hi3516cv200_lite_trassir-tr-d4121ir1-v2 split lines own, + MTD_SPLIT
hi3518ev200_lite_lenovo-snowman-1080p split lines own, + MTD_SPLIT
hi3518ev200_lite_qtech-qvc-ipc-136w split lines firmware's
hi3518ev200_lite_smartwares-cip-37210 split lines firmware's
hi3518ev200_lite_switcam-hs303 split lines firmware's
hi3518ev200_lite_switcam-hs303-v2 split lines firmware's
hi3518ev200_lite_vstarcam-c8892wip split lines own, + MTD_SPLIT
hi3518ev200_ultimate_lenovo-snowman-1080p split lines own, + MTD_SPLIT
hi3518ev200_ultimate_tplink-kasa-kc110 split lines firmware's

What stays the same:

  • Fixed-slot package: still made while it fits, for cameras whose sysupgrade predates the split layout. A build whose rootfs has outgrown its slot ships the split package alone, with a warning, instead of failing. hi3518ev200_lite_switcam-hs303 is in that case today: its master build fails 20 KB over the 5120 KB slot.
  • NAND: a NOR+NAND ultimate still packages its NAND image whichever NOR layout it ships.
  • Publishing: the workflow publishes <device>-nor-split.tgz (Imou Cue 2: build and publish the split NOR image #220), and sysupgrade finds it beside the plain package named in upgrade (firmware#2743).

hi3518ev200_lite_lenovo-snowman-1080p is in NOT_BUILT, so CI doesn't build it. It gets the same lines for consistency, but nothing here exercises them.

Tested

  • python3 .github/scripts/ci-matrix.py --self-test → self-test ok (130 devices, 16 smoke, 39 cases). The selector builds the 10 built devices.
  • Boot test in QEMU (qemu-bench, hi3516cv200 machine): results to follow in a comment, once CI has built the images.
  • Not on a camera.

…ery device

Since OpenIPC/firmware#2668 the generic hi3516cv200_lite, hi3518ev200_lite,
hi3518ev200_ultimate and gk7201v200_lite images use the split NOR layout:
uImage and squashfs in one "firmware" partition the kernel divides at
boot. A camera on that layout takes only a -split package; offered a
device's plain one, sysupgrade refuses ("This camera runs the split NOR
layout ... Nothing was written"), which is how the #2675 camera met it
(fixed for its own device in #221).

None of the eleven devices built on those four profiles had the split
layout. Each gets what #221 gave the Baolian and firmware#2668 gave the
profiles: the post-image script and BR2_OPENIPC_NOR_FIXED_PACKAGE in the
defconfig, and, for the four that ship their own kernel config (trassir,
lenovo-snowman lite and ultimate, vstarcam), CONFIG_MTD_SPLIT_* with
CONFIG_MTD_ROOTFS_ROOT_DEV; the other seven take firmware's, which has
them. The fixed-slot package is still made while it fits, and a
NOR+NAND ultimate still packages its NAND image either way. The workflow
publishes <device>-nor-split.tgz (#220); sysupgrade finds it beside the
plain one (firmware#2743).
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Publish split NOR images for 11 cv200-family and GK7201V200 devices

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

Grey Divider

AI Description

• Enable split NOR packaging for 11 devices whose generic profiles already use the split layout.
• Add firmware-partition splitting support to four device-specific kernel configs.
• Retain fixed-slot packages when they fit, preserving upgrades for older cameras.
Diagram

graph TD
  D["Device defconfigs"] --> P["Split image script"] --> A["NOR packages"] --> C["Existing CI publisher"] --> U["Sysupgrade"]
  K["Kernel configs"] --> M["MTD firmware splitter"]
  U --> M
Loading
High-Level Assessment

Extending the existing split-image script and publication path is the appropriate approach. A separate packaging mechanism would duplicate established firmware behavior without addressing the need for matching options in device-specific kernels.

Files changed (15) +42 / -0

Other (15) +42 / -0
gk7201v200_lite_xm-7205-rtl8733bu-16mb_defconfigEnable split NOR packaging for XM-7205 +2/-0

Enable split NOR packaging for XM-7205

• Selects the split post-image script and requests a fixed-slot NOR package when it fits. The device uses the generic kernel config for split-partition support.

devices/gk7201v200_lite_xm-7205-rtl8733bu-16mb/br-ext-chip-goke/configs/gk7201v200_lite_xm-7205-rtl8733bu-16mb_defconfig

hi3516cv200_lite_spezvision-svi-252b-k202_defconfigEnable split NOR packaging for Spezvision SVI-252B +2/-0

Enable split NOR packaging for Spezvision SVI-252B

• Selects the split post-image script while retaining fixed-slot package generation when possible. Split-partition kernel support comes from the generic config.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/br-ext-chip-hisilicon/configs/hi3516cv200_lite_spezvision-svi-252b-k202_defconfig

hi3516cv200.generic.configEnable firmware-partition splitting in the Trassir kernel +5/-0

Enable firmware-partition splitting in the Trassir kernel

• Enables MTD root-device selection and uImage/squashfs splitting of the named firmware partition in this device-specific kernel config.

devices/hi3516cv200_lite_trassir-tr-d4121ir1-v2/br-ext-chip-hisilicon/board/hi3516cv200/hi3516cv200.generic.config

hi3516cv200_lite_trassir-tr-d4121ir1-v2_defconfigEnable split NOR packaging for Trassir TR-D4121IR1 +2/-0

Enable split NOR packaging for Trassir TR-D4121IR1

• Selects split-image generation and requests a fixed-slot package when it fits, matching the device-specific kernel's new split support.

devices/hi3516cv200_lite_trassir-tr-d4121ir1-v2/br-ext-chip-hisilicon/configs/hi3516cv200_lite_trassir-tr-d4121ir1-v2_defconfig

hi3518ev200.generic.configEnable firmware-partition splitting in the lite Snowman kernel +5/-0

Enable firmware-partition splitting in the lite Snowman kernel

• Adds MTD root-device and firmware uImage/squashfs splitting options to the lite variant's device-specific kernel config.

devices/hi3518ev200_lite_lenovo-snowman-1080p/br-ext-chip-hisilicon/board/hi3516cv200/hi3518ev200.generic.config

hi3518ev200_lite_lenovo-snowman-1080p_defconfigEnable split NOR packaging for lite Lenovo Snowman +2/-0

Enable split NOR packaging for lite Lenovo Snowman

• Selects split-image generation and requests a fixed-slot package when possible. This device is in NOT_BUILT, so CI does not build it.

devices/hi3518ev200_lite_lenovo-snowman-1080p/br-ext-chip-hisilicon/configs/hi3518ev200_lite_lenovo-snowman-1080p_defconfig

hi3518ev200_lite_qtech-qvc-ipc-136w_defconfigEnable split NOR packaging for Qtech QVC-IPC-136W +2/-0

Enable split NOR packaging for Qtech QVC-IPC-136W

• Selects the split post-image script and requests a fixed-slot package when it fits; the generic kernel config supplies split support.

devices/hi3518ev200_lite_qtech-qvc-ipc-136w/br-ext-chip-hisilicon/configs/hi3518ev200_lite_qtech-qvc-ipc-136w_defconfig

hi3518ev200_lite_smartwares-cip-37210_defconfigEnable split NOR packaging for Smartwares CIP-37210 +2/-0

Enable split NOR packaging for Smartwares CIP-37210

• Selects split-image generation and requests a fixed-slot package when possible, alongside generic-kernel split support.

devices/hi3518ev200_lite_smartwares-cip-37210/br-ext-chip-hisilicon/configs/hi3518ev200_lite_smartwares-cip-37210_defconfig

hi3518ev200_lite_switcam-hs303-v2_defconfigEnable split NOR packaging for Switcam HS303 v2 +2/-0

Enable split NOR packaging for Switcam HS303 v2

• Selects the split post-image script and requests a fixed-slot package when it fits. The device uses the generic kernel config.

devices/hi3518ev200_lite_switcam-hs303-v2/br-ext-chip-hisilicon/configs/hi3518ev200_lite_switcam-hs303-v2_defconfig

hi3518ev200_lite_switcam-hs303_defconfigEnable split NOR packaging for Switcam HS303 +2/-0

Enable split NOR packaging for Switcam HS303

• Selects split-image generation and requests a fixed-slot package when it fits. If its rootfs exceeds the fixed slot, the split package can still be shipped.

devices/hi3518ev200_lite_switcam-hs303/br-ext-chip-hisilicon/configs/hi3518ev200_lite_switcam-hs303_defconfig

hi3518ev200.generic.configEnable firmware-partition splitting in the Vstarcam kernel +5/-0

Enable firmware-partition splitting in the Vstarcam kernel

• Adds MTD root-device and named firmware-partition splitting options for uImage and squashfs to the device-specific kernel config.

devices/hi3518ev200_lite_vstarcam-c8892wip/br-ext-chip-hisilicon/board/hi3516cv200/hi3518ev200.generic.config

hi3518ev200_lite_vstarcam-c8892wip_defconfigEnable split NOR packaging for Vstarcam C8892WIP +2/-0

Enable split NOR packaging for Vstarcam C8892WIP

• Selects split-image generation and requests a fixed-slot package when it fits, paired with the device-specific kernel split options.

devices/hi3518ev200_lite_vstarcam-c8892wip/br-ext-chip-hisilicon/configs/hi3518ev200_lite_vstarcam-c8892wip_defconfig

hi3518ev200.generic.configEnable firmware-partition splitting in the ultimate Snowman kernel +5/-0

Enable firmware-partition splitting in the ultimate Snowman kernel

• Adds MTD root-device and firmware uImage/squashfs splitting options to the ultimate variant's device-specific kernel config.

devices/hi3518ev200_ultimate_lenovo-snowman-1080p/br-ext-chip-hisilicon/board/hi3516cv200/hi3518ev200.generic.config

hi3518ev200_ultimate_lenovo-snowman-1080p_defconfigEnable split NOR packaging for ultimate Lenovo Snowman +2/-0

Enable split NOR packaging for ultimate Lenovo Snowman

• Selects split NOR image generation and requests a fixed-slot package when possible. Its existing NAND image packaging remains in place.

devices/hi3518ev200_ultimate_lenovo-snowman-1080p/br-ext-chip-hisilicon/configs/hi3518ev200_ultimate_lenovo-snowman-1080p_defconfig

hi3518ev200_ultimate_tplink-kasa-kc110_defconfigEnable split NOR packaging for TP-Link Kasa KC110 +2/-0

Enable split NOR packaging for TP-Link Kasa KC110

• Selects split-image generation and requests a fixed-slot package when it fits. Split-partition support comes from the generic kernel config.

devices/hi3518ev200_ultimate_tplink-kasa-kc110/br-ext-chip-hisilicon/configs/hi3518ev200_ultimate_tplink-kasa-kc110_defconfig

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

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

@openipc-ai

Copy link
Copy Markdown
Contributor Author

QEMU boot results (qemu-bench SoC models). Each split image is this PR's CI artifact (run 41424624362) at commit 889ce21. These are emulated boots, not cameras.

Method. I placed firmware.bin from each *-nor-split.tgz at 0x50000 on a blank flash (8 MB, or 16 MB for the 16 MB devices) attached to hi_sfc. I booted with -kernel <uImage cut from firmware.bin> and the cmdline the split layout gives, mtdparts=hi_sfc:256k(boot),64k(env),-(firmware) root=/dev/mtdblock4. Each boot passes when the kernel splits firmware itself, mounts the squashfs from the split, and init reaches the login prompt.

Device Kernel config kernel / rootfs / rootfs_data Root mounted Login
hi3516cv200_lite_spezvision-svi-252b-k202 firmware generic 0x50000 / 0x1d0000 / 0x5b0000 31:4 yes
hi3516cv200_lite_trassir-tr-d4121ir1-v2 own (this PR) 0x50000 / 0x1f0000 / 0x6a0000 31:4 yes
hi3518ev200_lite_qtech-qvc-ipc-136w firmware generic 0x50000 / 0x220000 / 0x720000 31:4 yes
hi3518ev200_lite_smartwares-cip-37210 firmware generic 0x50000 / 0x220000 / 0x720000 31:4 yes
hi3518ev200_lite_switcam-hs303 firmware generic 0x50000 / 0x220000 / 0x730000 31:4 yes
hi3518ev200_lite_switcam-hs303-v2 firmware generic 0x50000 / 0x220000 / 0x710000 31:4 yes
hi3518ev200_lite_vstarcam-c8892wip own (this PR) 0x50000 / 0x210000 / 0x6e0000 31:4 yes
hi3518ev200_ultimate_lenovo-snowman-1080p own (this PR) 0x50000 / 0x210000 / 0x820000 31:4 yes
hi3518ev200_ultimate_tplink-kasa-kc110 firmware generic 0x50000 / 0x220000 / 0x870000 31:4 yes
gk7201v200_lite_xm-7205-rtl8733bu-16mb firmware generic 0x50000 / 0x220000 / 0x780000 31:4 yes

Every boot logged 2 uimage-fw partitions found on MTD device firmware and 1 squashfs-split partitions found on MTD device rootfs.

Baseline. The current latest release of hi3518ev200_lite_vstarcam-c8892wip-nor.tgz has an own kernel config without MTD_SPLIT. Packed into the same split layout, it gets only the 3 cmdline partitions, then VFS: Cannot open root device "mtdblock4" ... error -6 and a kernel panic. That is what a split sysupgrade would do to these cameras without the kernel lines here.

Packages.

  • hi3518ev200_lite_switcam-hs303 now ships -nor-split.tgz only. Its rootfs is over the 5120 KB fixed slot, which is also why latest has no package for it today.
  • The other devices ship both NOR packages. The two ultimate devices ship their -nand.tgz too.

Not covered.

  • hi3518ev200_lite_lenovo-snowman-1080p is in NOT_BUILT, so CI didn't build it. Its kernel config change is the same five lines as the ultimate snowman, which booted.
  • fw_printenv complains about /etc/fw_env.config on some devices in QEMU. The env sector of my test flash is blank, and the same image on the classic fixed layout logs the same 13 lines, so this is not from split.
  • No camera has run these images.

@openipc-ai
openipc-ai merged commit 8cfa8f9 into master Nov 2, 2026
16 checks passed
@openipc-ai
openipc-ai deleted the cv200-family-split-nor branch November 2, 2026 11:10
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