Skip to content

devices: add rv1109_lite_mbk-ip4510a (RV1109 eMMC, IMX335) - #300

Open
yatotoshka wants to merge 2 commits into
OpenIPC:masterfrom
yatotoshka:rv1109-mbk
Open

yatotoshka wants to merge 2 commits into
OpenIPC:masterfrom
yatotoshka:rv1109-mbk

Conversation

@yatotoshka

@yatotoshka yatotoshka commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

What

Add rv1109_lite_mbk-ip4510a for the MBK-IP4510A (RV1109, 8 GB eMMC,
IMX335, PCB LS-RV1126/1109-EMMC-3PHY-V1.0).

  • br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig — the
    eMMC lite target (ext4 32 MiB, zImage + rv1109-38x38-v10-emmc.dtb).
  • overlay:
    • S39net + etc/network/interfaces: DHCP on eth0. The eMMC vendor
      U-Boot has no environment; the stock S40network relies on
      fw_printenv and is excluded.
    • S39slot: copies the vendor updateEngine + libs from the stock slot
      (_a → p7, _b → p6) and runs --misc=now, so the OpenIPC slot is
      marked successful and the A/B retry does not fall back.
    • switch-to-vendor.sh: updateEngine --misc=other --reboot.
    • customizer.sh: no-op note (no U-Boot env; no video backend yet).
  • exclude list rv1109_lite.list: drop /etc/init.d/S40network (the rootfs
    exclude step prefixes entries with ${TARGET_DIR}, so the entry needs its
    leading slash).
  • one row in README.md (storage eMMC).

CI/packaging support, so the profile can actually be built and published:

  • .github/scripts/ci-matrix.py: the target is in SMOKE_TARGETS — it is
    the only Rockchip/eMMC/EXT2 target, and the selector's self-test requires
    every trait to be covered.
  • .github/workflows/master.yml + build-one.yml: detect
    openipc*emmc*.tgz, rename a compound device's package to
    <device>-emmc.tgz, and include it in the staging/upload/report gates.
    push_build.py already knows the emmc storage kind.
  • .github/scripts/enrich_manifest.py: accept emmc in the nightly
    manifest.
  • builder.sh: copy the optional eMMC files next to the .tgz instead of
    handing unmatched globs to cp.

Dependency

OpenIPC/firmware#3115: the rv1109_emmc_lite target and the
openipc.rv1109-emmc-lite.tgz (zboot.img, rootfs.ext2, flash.fls).
Without it the profile resolves to the NAND target and will not boot this
eMMC board.

Testing

  • The same ext4 rootfs + the stock vendor boot.img (4.19 kernel) were
    installed via the stock web UI on this board: {"code":0}, slot A,
    OpenIPC 2.6.12.03, SSH/ipctool; reboot stays A with
    updateEngine --misc=now.
  • The firmware target rv1109_emmc_lite builds cleanly locally
    (zboot.img, 32 MiB rootfs.ext2, 36,930,072 B flash.fls).
  • Board report: https://openipc.ru/cameras/report/?id=r-zjj9rear
  • Not yet: a clean ./builder.sh rv1109_lite_mbk-ip4510a build; CI runs the
    profile for this PR.

Status / caveats

  • Video: no — no majestic/rkvenc backend for RV1109
    (RV1109/RV1126 (rockchip-rv11xx): no majestic build for this SoC — eMMC board available for testing majestic#427). The profile is a
    base/networking target, not a streaming camera yet.
  • Zoom/focus: no — the OpenIPC kernel exposes only iris_absolute on
    m01_f_hall-dc; the vendor MS41929 lens_drv.ko is stock-kernel-only
    and is not included.
  • IR-cut: the eMMC DTS has cam_ircut0; no majestic config yet.
  • The eMMC artifact is openipc.rv1109-emmc-lite.tgz; CI renames it to
    <device>-emmc.tgz for compound devices. The eMMC storage kind is new
    to the builder table and manifest (push_build.py already accepts it);
    naming may still need a maintainer decision. The customizer.sh does not
    set an upgrade URL (fw_setenv is not available on eMMC); updates are
    done through the stock web UI FLS.
  • The FLS in the firmware PR carries boot + system; the stock-UI test
    used uboot + boot + system; the stock uboot can be added via
    mkfls.py --uboot if needed.

Scope

  • No binary files: device profile + scripts + one README row, plus the CI
    and builder.sh changes that make eMMC artifacts visible.
  • Device-specific packaging stays in the firmware PR.

🤖 This description was drafted with AI assistance (OpenCode agent) and reviewed/approved by @yatotoshka.

@yatotoshka
yatotoshka marked this pull request as ready for review December 5, 2026 21:31
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

devices: add rv1109_lite_mbk-ip4510a (RV1109 eMMC, IMX335)

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Adds a defconfig and overlay for the MBK-IP4510A RV1109 eMMC board with IMX335.
• Adds DHCP networking and a slot script that copies vendor updateEngine and marks the slot
 successful.
• Excludes stock S40network, which depends on fw_printenv, and adds one README row.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 3 capabilities

  • 3 affected capabilities span independent functional scopes: Local firmware archive workflow, MBK-IP4510A device runtime integration, RV1109 eMMC firmware distribution integration.
  • The workflow produces, names, stages, uploads, and indexes one end-to-end RV1109 eMMC firmware artifact; these are delivery hops of the same capability rather than separate capabilities.
  • This is a distinct local-operator outcome: collecting usable build outputs into archive/device/timestamp, independent of CI release publication and device runtime behavior.
  • DHCP startup, vendor-slot success marking, and explicit vendor switching are distinct runtime outcomes within one bounded board integration; they share the board's partition layout and recovery behavior.
Sources

devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig[39-43]

BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_GEN=4
BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
BR2_TARGET_ROOTFS_EXT2_LABEL="OPENIPC"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/post-image-emmc.sh"

.github/scripts/enrich_manifest.py[44-47]

# when a build has no plain nor package for the camera. eMMC boards publish a
# single ...-emmc.tgz (no -split form).
COMPOUND_RE = re.compile(r"^(?P<platform>[a-z0-9]+_[a-z0-9]+_[a-z0-9_.-]+)-(?P<flash>nor|nand|emmc)(?P<split>-split)?\.tgz$")
SIMPLE_RE   = re.compile(r"^openipc\.(?P<soc>[^.]+)-(?P<flash>nor|nand|emmc)-(?P<variant>\w+)(?P<split>-split)?\.tgz$")
Behavioral complexity 🔴 High 🧩 State transitions, Coordinated invariants

  • Before: this board had no repository-local runtime integration.
  • After: startup selects an alternate slot, mounts vendor storage, copies a binary and libraries, creates a misc device link, and invokes updateEngine.
  • New correctness condition: partition selection, copied runtime dependencies, misc-device mapping, updateEngine invocation, and A/B success semantics must remain consistent across slot states.
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the changed build or naming path regresses, users may not receive a usable or discoverable RV1109 firmware archive.
  • Re-running the build and republishing repairs the delivery path; already published metadata or artifacts may need replacement.
  • Rebuild and republish are supported recovery actions.
  • Reverting code stops new failures but does not remove an already missing or incorrectly indexed release asset.
Sources

devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig[39-43]

BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_GEN=4
BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
BR2_TARGET_ROOTFS_EXT2_LABEL="OPENIPC"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/post-image-emmc.sh"

.github/scripts/enrich_manifest.py[44-47]

# when a build has no plain nor package for the camera. eMMC boards publish a
# single ...-emmc.tgz (no -split form).
COMPOUND_RE = re.compile(r"^(?P<platform>[a-z0-9]+_[a-z0-9]+_[a-z0-9_.-]+)-(?P<flash>nor|nand|emmc)(?P<split>-split)?\.tgz$")
SIMPLE_RE   = re.compile(r"^openipc\.(?P<soc>[^.]+)-(?P<flash>nor|nand|emmc)-(?P<variant>\w+)(?P<split>-split)?\.tgz$")
Assessed commit 003d7e0
Diagram

graph TD
  A["S39slot (boot)"] --> B["Vendor slot p6/p7"] --> C["updateEngine + libs"] --> D["updateEngine --misc=now"] --> E[("misc: mmcblk0p3")]
  F["S39net (boot)"] --> G["ifup eth0 (DHCP)"]
  H["switch-to-vendor.sh"] --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Rely on the stock web UI or vendor U-Boot to mark slot success
  • ➕ No custom boot-time code that touches A/B state
  • ➕ Matches how the vendor firmware already behaves
  • ➖ Requires the vendor updateEngine to be present on the stock slot anyway
  • ➖ Not portable to a fully OpenIPC-owned slot layout
2. Use ifupdown scripts or a common eMMC network script in the firmware PR
  • ➕ Avoids a per-device DHCP script and keeps networking logic in one place
  • ➕ Consistent with other OpenIPC targets
  • ➖ Device defconfig disables BR2_PACKAGE_IFUPDOWN_SCRIPTS, so a common script would need a config change
  • ➖ Would delay this device profile until the firmware PR lands

Recommendation: The approach fits the constraint that the eMMC vendor U-Boot has no environment, so stock S40network cannot work. Keeping the slot-success logic in a device overlay is reasonable. The main risk is that S39slot hardcodes /dev/mmcblk0p3 and the p6/p7 partition layout and runs --misc=now on every boot. Consider making it a one-time or verified step, and confirm the updateEngine copy fails safe when the stock slot is missing.

Files changed (8) +125 / -0

Enhancement (3) +40 / -0
S39netAdd boot-time loopback and eth0 DHCP init script +7/-0

Add boot-time loopback and eth0 DHCP init script

• Brings up loopback and runs ifup on eth0 at start. Errors from ifup are suppressed with '2>/dev/null || true', so a failed DHCP lease is silent.

devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39net

S39slotAdd boot-time vendor updateEngine copy and slot-success marking +28/-0

Add boot-time vendor updateEngine copy and slot-success marking

• Mounts the other vendor squashfs slot (p6 or p7) chosen from the kernel cmdline, copies updateEngine and its libraries to /usr/local/ue, and links /dev/mmcblk0p3 as misc. It then runs updateEngine --misc=now on every boot. The partition layout is hardcoded and the script suppresses all errors.

devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39slot

switch-to-vendor.shAdd helper to boot into vendor slot +5/-0

Add helper to boot into vendor slot

• Links the misc partition and runs updateEngine --misc=other --reboot to switch to the vendor slot. It uses set -e and exec, so failure exits the script.

devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/local/sbin/switch-to-vendor.sh

Documentation (2) +8 / -0
README.mdAdd MBK-IP4510A row to the device table +1/-0

Add MBK-IP4510A row to the device table

• Adds one table row for MBK-IP4510A with RV1109, IMX335, eMMC storage, and status notes. It also adds the new eMMC storage value to the table.

README.md

customizer.shAdd no-op customizer note for the device +7/-0

Add no-op customizer note for the device

• Contains only comments about networking, slot success, and missing U-Boot env, video backend, and zoom/focus support. It does not change any settings.

devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/share/openipc/customizer.sh

Other (3) +77 / -0
rv1109_lite_mbk-ip4510a_defconfigAdd eMMC lite defconfig for RV1109 MBK-IP4510A +69/-0

Add eMMC lite defconfig for RV1109 MBK-IP4510A

• Sets the RV1126/1109 kernel, zboot.img output, and 32M ext2 rootfs with post-image-emmc.sh. Selects the rv1109 SoC, IMX335 sensor, lite variant, and 8 MB flash size. The comment says system_a is 736 MiB, which may be confusing next to the 32M rootfs size.

devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig

interfacesDefine loopback and DHCP eth0 interface +5/-0

Define loopback and DHCP eth0 interface

• Defines the lo loopback interface and sets eth0 to auto-configure with DHCP. This is the config that S39net's ifup call reads.

devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/network/interfaces

rv1109_lite.listExclude stock S40network from the rv1109_lite build +3/-0

Exclude stock S40network from the rv1109_lite build

• Adds etc/init.d/S40network to the exclude list so the vendor-env network script is not installed. The overlay's S39net replaces it.

devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list

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

qodo-free-for-open-source-projects Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. The new camera image fails in CI ✓ Resolved Bug Correctness

Resolving commit: 003d7e0

Resolution reason
The PR diff adds EMMCFW detection to both workflows: build-one.yml and master.yml now find
'openipc*emmc*.tgz', rename it for compound devices, exit-guard includes EMMCFW, and EMMCFW is added
to the upload-firmware files list (build-one) and to the size report, kconfig, stage, artifact
upload and report gates (master.yml). This covers the detection, staging, and one-off upload points
the finding names.
Description
The eMMC image selected by the new defconfig is not recognized by either workflow's NOR/NAND-only
firmware detection. When the build produces openipc.rv1109-emmc-lite.tgz, the main workflow exits
before staging it, and the one-off workflow exits before uploading it.


Remediation recommended

2. Local archives omit the boot images ✓ Resolved Bug Correctness

Resolving commit: 003d7e0

Resolution reason
builder.sh copy_to_archive() now iterates over a pattern list that includes
"${FIRMWARE_DIR}/output/images/zboot.img", "rootfs.ext2" and "flash.fls", copying each with cp -a
when it exists (guarded by [ -e ]). So the eMMC boot image and ext4 rootfs are archived locally, and
absent optional patterns are skipped. The concern that the archive omits these images is addressed.
The remaining question of whether a missing required output should be flagged is only partly handled
(no failure on absent required artifacts), but the specific omission described is fixed.
Description
copy_to_archive() has no matches for the ext4 root filesystem or zboot.img selected by this
defconfig. A local build can finish and report an assembled archive containing the package tarball
but not those separate images, because the copy failure is not checked.

3. The network replacement may stay active 🐞 Bug ≡ Correctness
Description
rv1109_lite.list names etc/init.d/S40network without the leading slash used by the repository's
rootfs exclusion entries. If the exclusion step requires that absolute-path format, it will leave
the stock script beside S39net, so startup can run both network configurations.
Code

devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list[3]

+etc/init.d/S40network
Evidence
The added list entry is relative, whereas the repository's documented rootfs exclusion list and
existing device lists use slash-prefixed rootfs paths. The new overlay supplies S39net as the
intended replacement.

devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list[1-3]
devices/common/general/scripts/excludes/hi3516ev200_lte.list[1-18]
devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39net[1-7]

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 new network-script exclusion lacks the leading slash used by existing rootfs exclusion lists, risking retention of the stock startup script.
## Fix Focus Areas
- devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list[1-3]
## Recommended Fix
Change the entry to `/etc/init.d/S40network` and verify that the resulting root filesystem contains `S39net` but not `S40network`.

ⓘ 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 open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@yatotoshka

Copy link
Copy Markdown
Contributor Author

Addressed the three Qodo findings in 003d7e0:

  • .github/workflows/master.yml and build-one.yml now detect
    openipc*emmc*.tgz, rename compound devices to <device>-emmc.tgz, and
    include it in the staging/upload/report gates;
  • builder.sh copies the optional eMMC images and skips unmatched globs
    instead of handing literal paths to cp;
  • the exclude entry is now /etc/init.d/S40network (the step prefixes
    entries with ${TARGET_DIR}).

Also registered the target in SMOKE_TARGETS (the only Rockchip/eMMC/EXT2
target) and taught enrich_manifest.py the emmc storage kind.

CI is action_required for this fork; a maintainer has to approve the run.


🤖 This comment was drafted with AI assistance (OpenCode agent) and reviewed/approved by @yatotoshka.

This branch has not been deployed

No deployments
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.

2 participants