From 0eb7bfde2590e29210d81e9a37516bdf810c2ee1 Mon Sep 17 00:00:00 2001 From: valov Date: Sun, 6 Dec 2026 00:08:47 +0300 Subject: [PATCH 1/2] devices: add rv1109_lite_mbk-ip4510a (RV1109 eMMC, IMX335) --- README.md | 1 + .../configs/rv1109_lite_mbk-ip4510a_defconfig | 69 +++++++++++++++++++ .../general/overlay/etc/init.d/S39net | 7 ++ .../general/overlay/etc/init.d/S39slot | 28 ++++++++ .../general/overlay/etc/network/interfaces | 5 ++ .../usr/local/sbin/switch-to-vendor.sh | 5 ++ .../overlay/usr/share/openipc/customizer.sh | 7 ++ .../general/scripts/excludes/rv1109_lite.list | 3 + 8 files changed, 125 insertions(+) create mode 100644 devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig create mode 100755 devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39net create mode 100755 devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39slot create mode 100644 devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/network/interfaces create mode 100755 devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/local/sbin/switch-to-vendor.sh create mode 100755 devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/share/openipc/customizer.sh create mode 100644 devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list diff --git a/README.md b/README.md index 815878aea..67d4d75f1 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Jooan Q3R-U T23N SC1346 ATBM6012B_USB NOR_8M **INI JVS INGT10 GQS60EP T10A OV9750 - NOR_8M done Lenovo Snowman 1080P HI3518EV200 SC2035 RTL8188EUS_USB NOR_16M in progress, LightSensor-no LSC 3215672 T23N SC2331 ATBM6012B_USB NOR_8M **INIT** - progress +MBK-IP4510A RV1109 IMX335 - eMMC in progress: base OpenIPC, stock-web-UI FLS, eth/ssh/ipctool; video-no (OpenIPC/majestic#427); zoom/focus-no Meari Speed 6S SSC333 JXF37 RTL8188FU_USB NOR_16M video-yes, wifi-yes, motors-no Misecu XM-63-AI-50W XM550 SC5332 ATBM603X_USB NOR_8M testing, video-ok, wifi-ok (several-day owner test), ircut-ok, irled-ok, day/night-ok (exposure), speaker-ok, mic-ok Night Owl WCM-PWNVR20W-BU HI3518EV200 SC2135 RTL8188EUS_USB NOR_8M testing, video-ok, wifi-ok (several-day owner test), ircut-ok, irled-ok, audio-ok, lightsensor-ok diff --git a/devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig b/devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig new file mode 100644 index 000000000..f5d9f3c2d --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/br-ext-chip-rockchip/configs/rv1109_lite_mbk-ip4510a_defconfig @@ -0,0 +1,69 @@ +# Architecture +BR2_arm=y +BR2_cortex_a7=y +BR2_ARM_FPU_NEON_VFPV4=y + +# Toolchain +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-gnueabihf" +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y +# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set +BR2_TOOLCHAIN_EXTERNAL_CXX=y +BR2_TOOLCHAIN_EXTERNAL_OPENMP=y + +# Kernel: the eMMC DTS and the vendor U-Boot's Android boot.img flow. +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/rv1126.generic.config" +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y +BR2_LINUX_KERNEL_XZ=y +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="rv1109-38x38-v10-emmc.img" +BR2_LINUX_KERNEL_IMAGE_NAME="zboot.img" + +# Filesystem: writable ext4 on system_a (736 MiB); zboot.img/flash.fls are +# built by post-image-emmc.sh from zImage + rv1109-38x38-v10-emmc.dtb. +BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config" +BR2_PACKAGE_MTD=y +BR2_PACKAGE_UBOOT_TOOLS=y +BR2_PACKAGE_ZLIB=y +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set +BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y +BR2_PACKAGE_WIREGUARD_TOOLS=y +# BR2_TARGET_ROOTFS_UBI is not set +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" + +# OpenIPC +BR2_OPENIPC_SOC_VENDOR="rockchip" +BR2_OPENIPC_SOC_MODEL="rv1109" +BR2_OPENIPC_SOC_FAMILY="rv11xx" +BR2_OPENIPC_SNS_MODEL="IMX335" +BR2_OPENIPC_VARIANT="lite" +BR2_OPENIPC_FLASH_SIZE="8" + +# Packages +BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_LIBCURL_OPENIPC=y +BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y +# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set +BR2_PACKAGE_LIBEVENT_OPENIPC=y +BR2_PACKAGE_LIBOGG_OPENIPC=y +BR2_PACKAGE_MAJESTIC_WEBUI=y +BR2_PACKAGE_MBEDTLS_OPENIPC=y +BR2_PACKAGE_MOTORS=y +BR2_PACKAGE_OPUS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y +BR2_PACKAGE_VTUND_OPENIPC=y +BR2_PACKAGE_YAML_CLI=y diff --git a/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39net b/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39net new file mode 100755 index 000000000..531d0eb12 --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39net @@ -0,0 +1,7 @@ +#!/bin/sh +case "$1" in +start) + ifconfig lo 127.0.0.1 up + ifup eth0 2>/dev/null || true + ;; +esac diff --git a/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39slot b/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39slot new file mode 100755 index 000000000..d6e73191d --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/init.d/S39slot @@ -0,0 +1,28 @@ +#!/bin/sh +# Copy the vendor updateEngine from the stock slot and mark the current +# OpenIPC slot successful. The vendor stock on the other slot is the only +# source of the tool; if it is gone, the A/B retry eventually falls back. +case "$1" in +start) + case "$(cat /proc/cmdline 2>/dev/null)" in + *slot_suffix=_a*) OTHER=p7 ;; + *slot_suffix=_b*) OTHER=p6 ;; + *) OTHER=p7 ;; + esac + mkdir -p /mnt/vendor /usr/local/ue /usr/local/sbin /dev/block/by-name + mount -t squashfs -o ro "/dev/mmcblk0${OTHER}" /mnt/vendor 2>/dev/null || true + if [ -x /mnt/vendor/usr/bin/updateEngine ]; then + cp -f /mnt/vendor/usr/bin/updateEngine /usr/local/ue/ 2>/dev/null + cp -f /mnt/vendor/usr/lib/libssl.so.1.0.0 \ + /mnt/vendor/usr/lib/libcrypto.so.1.0.0 \ + /mnt/vendor/usr/lib/libcurl.so.4.5.0 /usr/local/ue/ 2>/dev/null + ln -sf libcurl.so.4.5.0 /usr/local/ue/libcurl.so.4 + ln -sf libssl.so.1.0.0 /usr/local/ue/libssl.so + ln -sf libcrypto.so.1.0.0 /usr/local/ue/libcrypto.so + fi + ln -sf /dev/mmcblk0p3 /dev/block/by-name/misc + if [ -x /usr/local/ue/updateEngine ]; then + LD_LIBRARY_PATH=/usr/local/ue /usr/local/ue/updateEngine --misc=now >/dev/null 2>&1 || true + fi + ;; +esac diff --git a/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/network/interfaces b/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/network/interfaces new file mode 100644 index 000000000..104c1a1b6 --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/general/overlay/etc/network/interfaces @@ -0,0 +1,5 @@ +auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet dhcp diff --git a/devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/local/sbin/switch-to-vendor.sh b/devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/local/sbin/switch-to-vendor.sh new file mode 100755 index 000000000..bf943f868 --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/local/sbin/switch-to-vendor.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +mkdir -p /dev/block/by-name +ln -sf /dev/mmcblk0p3 /dev/block/by-name/misc +exec env LD_LIBRARY_PATH=/usr/local/ue /usr/local/ue/updateEngine --misc=other --reboot diff --git a/devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/share/openipc/customizer.sh b/devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/share/openipc/customizer.sh new file mode 100755 index 000000000..4c852a80d --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/general/overlay/usr/share/openipc/customizer.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# MBK-IP4510A (RV1109 eMMC, IMX335): base OpenIPC. +# Network: /etc/init.d/S39net (DHCP on eth0). +# Slot success: /etc/init.d/S39slot (copies vendor updateEngine from the +# stock slot and runs --misc=now). +# No U-Boot environment on eMMC; no majestic/rkvenc backend yet +# (OpenIPC/majestic#427); zoom/focus is not supported by the OpenIPC kernel. diff --git a/devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list b/devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list new file mode 100644 index 000000000..bd619b62f --- /dev/null +++ b/devices/rv1109_lite_mbk-ip4510a/general/scripts/excludes/rv1109_lite.list @@ -0,0 +1,3 @@ +# rv1109_lite / MBK-IP4510A eMMC: the vendor-env network script is replaced +# by the device overlay's S39net (DHCP on eth0). +/etc/init.d/S40network From 003d7e01c0bf8e9ad892e4b79e2e7041717d89ea Mon Sep 17 00:00:00 2001 From: valov Date: Sun, 6 Dec 2026 00:59:31 +0300 Subject: [PATCH 2/2] builder: support eMMC artifacts in CI and the local archive --- .github/scripts/ci-matrix.py | 1 + .github/scripts/enrich_manifest.py | 7 ++++--- .github/workflows/build-one.yml | 17 +++++++++++++++-- .github/workflows/master.yml | 26 +++++++++++++++++++------- builder.sh | 28 ++++++++++++++++++++-------- 5 files changed, 59 insertions(+), 20 deletions(-) diff --git a/.github/scripts/ci-matrix.py b/.github/scripts/ci-matrix.py index 5ccfb0f4a..715d995a9 100644 --- a/.github/scripts/ci-matrix.py +++ b/.github/scripts/ci-matrix.py @@ -123,6 +123,7 @@ "xm530_lite_anbiux-a8b-3mp", # Xiongmai "nt98566_lite_xm-ivg-n8s", # Novatek "fh8852v200_lite_tuya-f1602-d2", # Fullhan + "rv1109_lite_mbk-ip4510a", # Rockchip, the only eMMC/ext4 target ] # LICENSE and README anchored to whole filenames; unanchored they would also diff --git a/.github/scripts/enrich_manifest.py b/.github/scripts/enrich_manifest.py index 19bd56246..b76dc5e51 100644 --- a/.github/scripts/enrich_manifest.py +++ b/.github/scripts/enrich_manifest.py @@ -41,9 +41,10 @@ # also publishes ...-nor-split.tgz (compound) or openipc.-nor--split.tgz # (simple), beside the plain package or instead of it. As in firmware's index it # is listed under its own flash key, nor_split, which sysupgrade falls back to -# when a build has no plain nor package for the camera. -COMPOUND_RE = re.compile(r"^(?P[a-z0-9]+_[a-z0-9]+_[a-z0-9_.-]+)-(?Pnor|nand)(?P-split)?\.tgz$") -SIMPLE_RE = re.compile(r"^openipc\.(?P[^.]+)-(?Pnor|nand)-(?P\w+)(?P-split)?\.tgz$") +# 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[a-z0-9]+_[a-z0-9]+_[a-z0-9_.-]+)-(?Pnor|nand|emmc)(?P-split)?\.tgz$") +SIMPLE_RE = re.compile(r"^openipc\.(?P[^.]+)-(?Pnor|nand|emmc)-(?P\w+)(?P-split)?\.tgz$") # Retry budget for transient GitHub API failures (mirrors firmware/#2129). GH_RETRY_DELAYS = (0, 5, 15, 40) diff --git a/.github/workflows/build-one.yml b/.github/workflows/build-one.yml index 1bd6baf60..27bbd775a 100644 --- a/.github/workflows/build-one.yml +++ b/.github/workflows/build-one.yml @@ -250,7 +250,19 @@ jobs: fi fi - if [ -z "${NORFW}" ] && [ -z "${NORSPLIT}" ] && [ -z "${NANDFW}" ]; then + # eMMC boards (rv1109 boot_android) ship one package: the kernel + # boot image, the ext4 rootfs and the web-UI FLS. + EMMCFW=$(find output/images -name 'openipc*emmc*.tgz' | head -n 1) + if [ -n "${EMMCFW}" ]; then + if [ ${COMMON} -eq 1 ]; then + echo EMMCFW=openipc/${EMMCFW} >> ${GITHUB_ENV} + else + mv ${EMMCFW} ../${NAME}-emmc.tgz + echo EMMCFW=${NAME}-emmc.tgz >> ${GITHUB_ENV} + fi + fi + + if [ -z "${NORFW}" ] && [ -z "${NORSPLIT}" ] && [ -z "${NANDFW}" ] && [ -z "${EMMCFW}" ]; then exit 1 fi @@ -269,7 +281,7 @@ jobs: fi - name: Upload firmware - if: env.NORFW || env.NORSPLIT || env.NANDFW + if: env.NORFW || env.NORSPLIT || env.NANDFW || env.EMMCFW uses: softprops/action-gh-release@v2 with: tag_name: ${{ needs.resolve.outputs.tag_name }} @@ -288,6 +300,7 @@ jobs: ${{env.NORFW}} ${{env.NORSPLIT}} ${{env.NANDFW}} + ${{env.EMMCFW}} - name: Reply on the build request if: always() && inputs.request_issue != '' diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 9e374372f..018cc56fd 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -385,12 +385,24 @@ jobs: fi fi - if [ -z "${NORFW}" ] && [ -z "${NORSPLIT}" ] && [ -z "${NANDFW}" ]; then + # eMMC boards (rv1109 boot_android) ship one package: the kernel + # boot image, the ext4 rootfs and the web-UI FLS. + EMMCFW=$(find output/images -name 'openipc*emmc*.tgz' | head -n 1) + if [ -n "${EMMCFW}" ]; then + if [ ${COMMON} -eq 1 ]; then + echo EMMCFW=openipc/${EMMCFW} >> ${GITHUB_ENV} + else + mv ${EMMCFW} ../${NAME}-emmc.tgz + echo EMMCFW=${NAME}-emmc.tgz >> ${GITHUB_ENV} + fi + fi + + if [ -z "${NORFW}" ] && [ -z "${NORSPLIT}" ] && [ -z "${NANDFW}" ] && [ -z "${EMMCFW}" ]; then exit 1 fi - name: Build size report - if: env.NORFW || env.NORSPLIT || env.NANDFW + if: env.NORFW || env.NORSPLIT || env.NANDFW || env.EMMCFW run: | cd openipc NAME=${{matrix.platform}} @@ -421,7 +433,7 @@ jobs: # had the tab. Best-effort like the size report: an image never fails # for want of its graph. - name: Build kconfig graph - if: env.NORFW || env.NORSPLIT || env.NANDFW + if: env.NORFW || env.NORSPLIT || env.NANDFW || env.EMMCFW run: | python3 -m pip install --user --break-system-packages kconfiglib || \ { echo "::warning::kconfiglib install failed for ${{matrix.platform}}"; exit 0; } @@ -460,7 +472,7 @@ jobs: # image and then discards it, so they cannot test their own device profile # without asking a maintainer to dispatch build-one for them. - name: Stage artifacts - if: env.NORFW || env.NORSPLIT || env.NANDFW + if: env.NORFW || env.NORSPLIT || env.NANDFW || env.EMMCFW run: | mkdir -p dist reports # The size report goes to its own artifact below, not with the image. @@ -472,7 +484,7 @@ jobs: cp -a "$f" reports/ fi done - for f in "${NORFW:-}" "${NORSPLIT:-}" "${NANDFW:-}"; do + for f in "${NORFW:-}" "${NORSPLIT:-}" "${NANDFW:-}" "${EMMCFW:-}"; do # An `if` rather than a `&&` chain: the step runs under `bash -e`, # where a trailing `&&` that tests false is only harmless because # something after it resets the status. @@ -501,7 +513,7 @@ jobs: # builds a handful and has a person waiting on them, plausibly in another # timezone, so one day is too short a window there. - name: Upload build artifacts - if: env.NORFW || env.NORSPLIT || env.NANDFW + if: env.NORFW || env.NORSPLIT || env.NANDFW || env.EMMCFW uses: actions/upload-artifact@v4 with: name: fw-${{ matrix.platform }} @@ -515,7 +527,7 @@ jobs: # consumes within the run -- so a push that could not reach openipc.org # can be re-run days later. Optional, so is this. - name: Upload report - if: github.event_name != 'pull_request' && (env.NORFW || env.NORSPLIT || env.NANDFW) + if: github.event_name != 'pull_request' && (env.NORFW || env.NORSPLIT || env.NANDFW || env.EMMCFW) uses: actions/upload-artifact@v4 continue-on-error: true with: diff --git a/builder.sh b/builder.sh index b1f95c1bc..4b3b5ff03 100755 --- a/builder.sh +++ b/builder.sh @@ -49,16 +49,28 @@ autoup_rootfs() { copy_to_archive() { echo_c 32 "Copying files to local archive" - mkdir -p "${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}" - cp -a \ - ${FIRMWARE_DIR}/output/images/rootfs.squashfs.* \ - ${FIRMWARE_DIR}/output/images/uImage.* \ - ${FIRMWARE_DIR}/output/images/*.tar \ - ${FIRMWARE_DIR}/output/images/openipc.*.tgz \ - ${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP} + DEST="${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}" + mkdir -p "${DEST}" + # Each pattern is optional: a NOR board ships squashfs + uImage, while an + # SD/eMMC board ships a single .tgz. For the RV1109 eMMC target also keep + # the boot image and rootfs that go into that package, so a local archive + # is usable without unpacking it. Unmatched patterns are skipped instead of + # handing the literal glob to cp. + for pattern in \ + "${FIRMWARE_DIR}/output/images/rootfs.squashfs."* \ + "${FIRMWARE_DIR}/output/images/uImage."* \ + "${FIRMWARE_DIR}/output/images/"*.tar \ + "${FIRMWARE_DIR}/output/images/openipc."*.tgz \ + "${FIRMWARE_DIR}/output/images/zboot.img" \ + "${FIRMWARE_DIR}/output/images/rootfs.ext2" \ + "${FIRMWARE_DIR}/output/images/flash.fls"; do + if [ -e "${pattern}" ]; then + cp -a "${pattern}" "${DEST}/" + fi + done cp -a ${FIRMWARE_DIR}/output/images/sizes.*.json \ - ${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP} 2>/dev/null || true + "${DEST}" 2>/dev/null || true if [ -f "${FIRMWARE_DIR}/output/images/autoupdate-kernel.img" ]; then cp -a ${FIRMWARE_DIR}/output/images/autoupdate* ${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}