Skip to content

anyka: one 4.4.302 kernel for every AK39 part, and the AK3918AV130 - #2635

Merged
dimerr merged 4 commits into
masterfrom
anyka-ak39-unified
Oct 19, 2026
Merged

dimerr merged 4 commits into
masterfrom
anyka-ak39-unified

Conversation

@dimerr

@dimerr dimerr commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Anyka family covers only the AK3918EV300 and AK3916EV300, on the vendor's 3.4.35 kernel. Even those have no camera drivers, and there is no toolchain for them.

This PR builds every AK39 camera SoC from one kernel and one toolchain, with the media and network drivers from source, plus the AK3918AV130. The kernel is OpenIPC/linux#106, 4.4.302, meant to become anyka-ak3918ev300.

Boards

Board Parts Media and network
ak3910_lite, ak3918_lite AK3910 / AK3916 / AK3918 (Aimer39) ISP v1 host, the aksensor sensors, the old Anyka MAC
ak3918ev200_lite AK3918EV200 ISP2, the 8290 H.264/JPEG encoder on V4L2, ALSA
ak3918ev300_lite AK3918EV300/EV330 and their AK3916/AK3919 packages, as aliases ISP2 with DVP and MIPI sensors, the Synopsys GMAC, the encoder's UIO
ak3916ev300_lite the same 64 MB image, under the name it already had as ak3918ev300_lite
ak3918ev331_lite the 128 MB EV331 parts as ak3918ev300_lite
ak3918av130_lite AK3918AV130 the AnyCloud39AV130 SDK's prebuilt modules, in anyka-osdrv-ak3918av130

Commits

  • ipctool: the Anyka boards now build only the Anyka HAL into libipchw.
  • anyka: the family moves to the 4.4 kernel and gains the boards above.
  • anyka-osdrv-ak3918av130: the AV130 modules and load_anyka.

Hardware tested on

None. Nothing here has booted on a camera, so this is a draft.

Evidence

No camera evidence, as above.

Local builds of all seven boards against the kernel branch, with a locally built toolchain.anyka-ak3918ev300:

ak3910_lite: - uImage: [1570KB/2048KB] - rootfs.squashfs: [2804KB/5120KB] 
ak3918_lite: - uImage: [1571KB/2048KB] - rootfs.squashfs: [2804KB/5120KB] 
ak3918ev200_lite: - uImage: [1597KB/2048KB] - rootfs.squashfs: [2804KB/5120KB] 
ak3918ev300_lite: - uImage: [1594KB/2048KB] - rootfs.squashfs: [2804KB/5120KB] 
ak3916ev300_lite: - uImage: [1594KB/2048KB] - rootfs.squashfs: [2804KB/5120KB] 
ak3918ev331_lite: - uImage: [1594KB/2048KB] - rootfs.squashfs: [2804KB/5120KB] 
ak3918av130_lite: - uImage: [1645KB/2048KB] - rootfs.squashfs: [3780KB/5120KB] 

In the ak3918av130_lite image:

  • The modules land under /lib/modules/4.4.302-cip94/anyka.
  • Every undefined symbol of the 18 SDK modules resolves against the kernel's Module.symvers.
  • /etc/modules gains ak_eth and ak_mci.
  • check_target_modules.sh passes.

Checks run locally:

$ python3 .github/scripts/ci-matrix.py --self-test
ci-matrix: self-test ok (100 boards, 156 packages, 75 cases)
$ STRICT=1 bash .github/scripts/test_shell_parse.sh
all parsed clean under busybox ash
$ STRICT=1 bash .github/scripts/test_strip_shell_comments.sh
All strip-shell-comments checks passed.
$ python3 .github/scripts/lint-workflow-shell.py
all run blocks parse clean

Notes for review

  • The AV130 modules are binaries, copied unmodified from the AnyCloud39AV130 SDK (github.com/Link-WQS/ANYKA_130L_SDK at 3480d024b682ccb2cf8bcb87dc4d2ac0af4dc49e, os/driver_normal.tar.gz). The SDK has no source for the ISP, encoder, audio, Ethernet or SD drivers. It does have source for the sensors, so those could become a from-source package later.
  • CI won't build these boards yet. No toolchain.anyka-ak3918ev300 is published, and make toolchain takes its kernel headers from the family's kernel branch. The family therefore stays in UNBUILT_FAMILIES, and anyka-osdrv-ak3918av130 in NOT_BUILT.
  • Order to land it:
    1. Merge anyka: one 4.4.302 kernel for the AK39 family and the AK3918AV130 linux#106 and point anyka-ak3918ev300 at it.
    2. Run toolchain.yml for ak3918ev300_lite.
    3. Move the boards into ALL_BOARDS.
  • Kernel config: each board's kernel config is the full .config Buildroot produced from the branch.

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it

Anyka was the one vendor with boards in the tree and no entry in either
map, so ak3918ev300 got every vendor HAL compiled into libipchw. ipctool's
IPCHW_VENDORS has had an anyka option all along, and Anyka is not a
HiSilicon derivative, so it asks for no HiSilicon generation.
The family ran the vendor's 3.4.35 for the AK3918EV300 and AK3916EV300
only, with no camera drivers in it. It now builds every AK39 generation
from one kernel, OpenIPC/linux anyka-ak3918ev300 at 4.4.302 (the
AK3918EV200 port at github.com/difanz/ak3918ev200-kernel, with the parts
below added), one toolchain, and the media drivers from source:

  ak3910, ak3918   AK3910/AK3916/AK3918 (Aimer39): ISP v1 host and the
                   aksensor sensors, the old Anyka MAC
  ak3918ev200      AK3918EV200: ISP2, the 8290 H.264/JPEG encoder on
                   V4L2, ALSA
  ak3918ev300      AK3918EV300/EV330 and their AK3916/AK3919 packages,
                   one 64 MB image: ISP2 with DVP and MIPI sensors, the
                   Synopsys GMAC, the encoder's UIO
  ak3916ev300      the same image under the name it already had
  ak3918ev331      the 128 MB EV331 parts

Anyka's own 4.4 SDK builds its AK3918EV300 boards from the ak39ev330
dtsi, and the chip-ID registers tell EV300 and EV330 apart only by
revision, hence one image and the aliases. The uImage is the zImage with
the board's DTB appended, built by the kernel as on hisilicon.

Not one of these has booted on a camera. No toolchain.anyka-ak3918ev300 is
published yet, so the family stays in UNBUILT_FAMILIES and toolchain.yml
learns to build it.
The AV130's ISP, encoder, audio, Ethernet and SD drivers exist only as
the prebuilt modules of the AnyCloud39AV130 SDK
(github.com/Link-WQS/ANYKA_130L_SDK, os/driver_normal.tar.gz), built for
4.4.302-cip94. The family's kernel imports the AV130 machine from the
same SDK and lays out the structures those modules share the vendor's
way, and ak3918av130's config sets the -cip94 release string so their
vermagic matches; every symbol they import resolves against it.

load_anyka brings the modules up after the SDK's own scripts, picking
the sensor from the sensor variable or ipcinfo. ak_eth and ak_mci go in
/etc/modules from a post-build hook, because S70vendor runs after
S40network.

Not run on a camera. The package waits in NOT_BUILT with its family.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Unify AK39 boards on Linux 4.4 and add AK3918AV130 drivers

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add seven AK39 board builds using one Linux 4.4 kernel family and toolchain.
Diagram

graph TD
  Boards["AK39 board builds"] --> Configs["Kernel configurations"] --> Kernel["Linux 4.4 kernel"] --> Modules["AV130 modules"]
  Boards --> Package["AV130 package"] --> Loader["Driver startup"] --> Modules
  Boards --> Ipctool["Anyka HAL"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Maintain separate vendor kernels
  • ➕ Could preserve each SDK's native driver ABI and reduce initial porting risk.
  • ➖ Duplicates kernel and toolchain maintenance across AK39 variants.
  • ➖ Does not address missing source-built media support in the existing 3.4 images.
2. Defer AV130 until its drivers are source-built
  • ➕ Avoids shipping proprietary binaries tied to a vendor-compatible kernel ABI.
  • ➖ The cited SDK lacks source for essential AV130 media, Ethernet, audio, and SD drivers.
  • ➖ Would leave AV130 without the proposed functionality.

Recommendation: The shared 4.4 kernel is a reasonable consolidation strategy, with a separate AV130 package making the binary-driver exception explicit. Keep the rollout staged: merge the kernel branch, publish its toolchain, then enable CI board builds; require hardware bring-up before treating the images as validated.

Files changed (42) +16911 / -889

Enhancement (7) +454 / -0
ak3910_lite_defconfigAdd an AK3910 lite image +66/-0

Add an AK3910 lite image

• Selects the shared 4.4-header toolchain, AK3910 kernel configuration and 8 MB flash image.

br-ext-chip-anyka/configs/ak3910_lite_defconfig

ak3918_lite_defconfigAdd an AK3918 lite image +67/-0

Add an AK3918 lite image

• Adds a first-generation board image, with AK3916 as a package alias.

br-ext-chip-anyka/configs/ak3918_lite_defconfig

ak3918av130_lite_defconfigAdd an AK3918AV130 lite image +65/-0

Add an AK3918AV130 lite image

• Selects the AV130 kernel configuration and the new SDK-module package.

br-ext-chip-anyka/configs/ak3918av130_lite_defconfig

ak3918ev200_lite_defconfigAdd an AK3918EV200 lite image +64/-0

Add an AK3918EV200 lite image

• Adds the EV200 board with its kernel configuration and board-specific uImage load address.

br-ext-chip-anyka/configs/ak3918ev200_lite_defconfig

ak3918ev331_lite_defconfigAdd an EV331 lite image +66/-0

Add an EV331 lite image

• Adds the 128 MB EV331 image and aliases for its AK3916 and AK3919 packages.

br-ext-chip-anyka/configs/ak3918ev331_lite_defconfig

load_anykaLoad AV130 media drivers by detected sensor +99/-0

Load AV130 media drivers by detected sensor

• Loads supporting and ISP modules, chooses a sensor from the environment or ipcinfo, then loads encoder modules. Also supports removing media modules.

general/package/anyka-osdrv-ak3918av130/files/script/load_anyka

post-build-hook.shLoad AV130 Ethernet and SD drivers before networking +27/-0

Load AV130 Ethernet and SD drivers before networking

• Idempotently appends ak_eth and ak_mci to the target's /etc/modules after the rootfs overlay is applied.

general/package/anyka-osdrv-ak3918av130/post-build-hook.sh

Other (35) +16457 / -889
check_target_modules.shCheck for the AV130 ISP module +1/-0

Check for the AV130 ISP module

• Adds an installed-module check when the AV130 driver package is selected.

.github/scripts/check_target_modules.sh

ci-matrix.pyDocument temporary Anyka CI exclusions +9/-1

Document temporary Anyka CI exclusions

• Keeps the family out of board builds until its toolchain is published and excludes the new AV130 package from package builds.

.github/scripts/ci-matrix.py

toolchain.ymlOffer an Anyka toolchain build target +3/-0

Offer an Anyka toolchain build target

• Adds ak3918ev300_lite to the toolchain workflow's selectable boards.

.github/workflows/toolchain.yml

ak3910.generic.configConfigure the AK3910 Linux 4.4 kernel +2627/-0

Configure the AK3910 Linux 4.4 kernel

• Adds a full configuration with the AK3910 DTB, first-generation ISP and Anyka Ethernet.

br-ext-chip-anyka/board/ak3918ev300/ak3910.generic.config

ak3916ev300.generic.configMigrate the AK3916EV300 kernel configuration +1302/-443

Migrate the AK3916EV300 kernel configuration

• Replaces its Linux 3.4 configuration with Linux 4.4 settings for the EV300 DTB, ISP2 and GMAC.

br-ext-chip-anyka/board/ak3918ev300/ak3916ev300.generic.config

ak3918.generic.configConfigure the AK3918 Linux 4.4 kernel +2627/-0

Configure the AK3918 Linux 4.4 kernel

• Adds a full first-generation configuration with the AK3918 DTB, ISP v1 and Anyka Ethernet.

br-ext-chip-anyka/board/ak3918ev300/ak3918.generic.config

ak3918av130.generic.configConfigure the AV130 vendor-compatible kernel ABI +3252/-0

Configure the AV130 vendor-compatible kernel ABI

• Adds the AV130 machine and DTB configuration with a -cip94 local version for the prebuilt SDK modules.

br-ext-chip-anyka/board/ak3918ev300/ak3918av130.generic.config

ak3918ev200.generic.configConfigure EV200 camera and audio support +2639/-0

Configure EV200 camera and audio support

• Adds a Linux 4.4 EV200 configuration including ISP2, the V4L2 video encoder and audio support.

br-ext-chip-anyka/board/ak3918ev300/ak3918ev200.generic.config

ak3918ev300.generic.configMigrate the EV300 kernel configuration +1302/-443

Migrate the EV300 kernel configuration

• Replaces Linux 3.4 settings with Linux 4.4 settings for the EV300 DTB, ISP2, GMAC and encoder UIO.

br-ext-chip-anyka/board/ak3918ev300/ak3918ev300.generic.config

ak3918ev331.generic.configConfigure the 128 MB EV331 kernel +2633/-0

Configure the 128 MB EV331 kernel

• Adds the EV331 DTB configuration with 128 MB boot parameters and EV300-generation drivers.

br-ext-chip-anyka/board/ak3918ev300/ak3918ev331.generic.config

ak3916ev300_lite_defconfigMove AK3916EV300 to Linux 4.4 +4/-1

Move AK3916EV300 to Linux 4.4

• Updates the existing board to 4.4 toolchain headers and an explicit appended-DTB uImage load address.

br-ext-chip-anyka/configs/ak3916ev300_lite_defconfig

ak3918ev300_lite_defconfigMove EV300 to Linux 4.4 and add aliases +9/-1

Move EV300 to Linux 4.4 and add aliases

• Updates the toolchain headers and uImage load address; identifies compatible 64 MB EV300 and EV330 packages as aliases.

br-ext-chip-anyka/configs/ak3918ev300_lite_defconfig

Config.inExpose the AV130 driver package +1/-0

Expose the AV130 driver package

• Sources the new package's Buildroot configuration.

general/package/Config.in

Config.inDeclare the AV130 SDK-module package +10/-0

Declare the AV130 SDK-module package

• Adds the Linux-kernel-dependent Buildroot option for AV130 modules and their loader.

general/package/anyka-osdrv-ak3918av130/Config.in

anyka-osdrv-ak3918av130.mkInstall AV130 modules and loader +35/-0

Install AV130 modules and loader

• Records the proprietary SDK provenance and installs its modules under 4.4.302-cip94 alongside load_anyka.

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk

ak_efuse.koBundle the AV130 efuse module +0/-0

Bundle the AV130 efuse module

• Adds the prebuilt SDK efuse driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_efuse.ko

ak_eth.koBundle the AV130 Ethernet module +0/-0

Bundle the AV130 Ethernet module

• Adds the prebuilt Ethernet driver for early boot loading.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_eth.ko

ak_hcd.koBundle the AV130 USB host module +0/-0

Bundle the AV130 USB host module

• Adds the prebuilt USB host-controller driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_hcd.ko

ak_i2c.koBundle the AV130 I2C module +0/-0

Bundle the AV130 I2C module

• Adds the prebuilt I2C driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_i2c.ko

ak_ion.koBundle the AV130 ION module +0/-0

Bundle the AV130 ION module

• Adds the prebuilt memory-allocation driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_ion.ko

ak_isp.koBundle the AV130 ISP module +0/-0

Bundle the AV130 ISP module

• Adds the prebuilt image-signal-processor driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_isp.ko

ak_leds.koBundle the AV130 LED module +0/-0

Bundle the AV130 LED module

• Adds the prebuilt LED driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_leds.ko

ak_mci.koBundle the AV130 SD-card module +0/-0

Bundle the AV130 SD-card module

• Adds the prebuilt SD-card controller driver for early boot loading.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_mci.ko

ak_pcm.koBundle the AV130 PCM module +0/-0

Bundle the AV130 PCM module

• Adds the prebuilt audio PCM driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_pcm.ko

ak_rtc.koBundle the AV130 RTC module +0/-0

Bundle the AV130 RTC module

• Adds the prebuilt real-time-clock driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_rtc.ko

ak_uio.koBundle the AV130 UIO module +0/-0

Bundle the AV130 UIO module

• Adds the prebuilt userspace-I/O driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_uio.ko

ak_venc_adapter.koBundle the AV130 encoder adapter +0/-0

Bundle the AV130 encoder adapter

• Adds the prebuilt video-encoder adapter module.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_venc_adapter.ko

ak_venc_bridge.koBundle the AV130 encoder bridge +0/-0

Bundle the AV130 encoder bridge

• Adds the prebuilt video-encoder bridge module.

general/package/anyka-osdrv-ak3918av130/files/kmod/ak_venc_bridge.ko

sensor_gc1084.koBundle the GC1084 sensor module +0/-0

Bundle the GC1084 sensor module

• Adds the AV130 SDK's prebuilt GC1084 driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/sensor_gc1084.ko

sensor_gc2063.koBundle the GC2063 sensor module +0/-0

Bundle the GC2063 sensor module

• Adds the prebuilt GC2063 driver, also selected for GC2053 with a different I2C address.

general/package/anyka-osdrv-ak3918av130/files/kmod/sensor_gc2063.ko

sensor_gc20c3.koBundle the GC20C3 sensor module +0/-0

Bundle the GC20C3 sensor module

• Adds the AV130 SDK's prebuilt GC20C3 driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/sensor_gc20c3.ko

sensor_gc3003.koBundle the GC3003 sensor module +0/-0

Bundle the GC3003 sensor module

• Adds the AV130 SDK's prebuilt GC3003 driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/sensor_gc3003.ko

sensor_sc3332.koBundle the SC3332 sensor module +0/-0

Bundle the SC3332 sensor module

• Adds the AV130 SDK's prebuilt SC3332 driver.

general/package/anyka-osdrv-ak3918av130/files/kmod/sensor_sc3332.ko

ipctool.mkRestrict Anyka builds to the Anyka HAL +2/-0

Restrict Anyka builds to the Anyka HAL

• Maps Anyka to its vendor HAL and disables unnecessary HiSilicon generation code in libipchw.

general/package/ipctool/ipctool.mk

late-post-build-hooks.listRegister the AV130 late post-build hook +1/-0

Register the AV130 late post-build hook

• Runs the AV130 /etc/modules adjustment only for images selecting its driver package.

general/scripts/late-post-build-hooks.list

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

qodo-free-for-open-source-projects Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Camera boot behavior is unverified ✓ Resolved
Description
The new Anyka defconfigs change the kernel, toolchain, and shipped driver set without any
real-camera boot or streaming result. Because the PR explicitly reports that no camera has booted,
every affected board reaches users without evidence that its firmware starts and provides video.
Code

br-ext-chip-anyka/configs/ak3918av130_lite_defconfig[R15-19]

+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)/ak3918av130.generic.config"
Evidence
The PR adds a new kernel configuration and changes the firmware image contents, so it can change
camera behavior. The PR description states that no camera has booted and that no hardware evidence
is available, which fails the hardware-evidence gate.

Rule 3: Hardware evidence is present and honest
br-ext-chip-anyka/configs/ak3918av130_lite_defconfig[15-19]

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 camera firmware images but provides no hardware boot or streaming evidence, while the compliance gate requires output from a real affected camera.
## Fix Focus Areas
- br-ext-chip-anyka/configs/ak3918av130_lite_defconfig[15-19]
## Recommended Fix
Boot representative affected Anyka boards with the new images and attach before/after boot logs, kernel messages, and streaming results identifying the board and observed symptoms; if hardware testing is unavailable, do not mark the change as verified.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. AV130 drivers cannot be rebuilt 📘 Rule violation ⚙ Maintainability
Description
ANYKA_OSDRV_AK3918AV130_INSTALL_TARGET_CMDS copies prebuilt SDK kernel modules into the image,
while the package provides no source site or version and documents that source is unavailable for
the ISP, encoder, audio, Ethernet, and SD drivers. Every AV130 image selecting this package depends
on those binaries and their 4.4.302-cip94 kernel ABI, so a kernel or driver change cannot be rebuilt
from the sources in this tree.
Code

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[R27-29]

+define ANYKA_OSDRV_AK3918AV130_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/$(ANYKA_OSDRV_AK3918AV130_KVER)/anyka
+	$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/$(ANYKA_OSDRV_AK3918AV130_KVER)/anyka $(ANYKA_OSDRV_AK3918AV130_PKGDIR)/files/kmod/*.ko
Evidence
The package comments identify the modules as unmodified SDK binaries and state that the SDK lacks
source for the ISP, encoder, audio, Ethernet, and SD drivers. Its source site and version are empty,
its install commands copy the supplied .ko files into a 4.4.302-cip94 module directory, and the
AV130 defconfig selects the package.

CLAUDE.md: Do Not Introduce Unbuildable Binary or Extracted Vendor Content: CLAUDE.md: Do Not Introduce Unbuildable Binary or Extracted Vendor Content: CLAUDE.md: Do Not Introduce Unbuildable Binary or Extracted Vendor Content: CLAUDE.md: Do Not Introduce Unbuildable Binary or Extracted Vendor Content
general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[11-17]
general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[27-29]
general/package/anyka-osdrv-ak3918av130/files/kmod/ak_isp.ko[1-1]
general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[7-25]
br-ext-chip-anyka/configs/ak3918av130_lite_defconfig[46-47]

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 AV130 package installs opaque, prebuilt SDK modules for core hardware drivers that cannot be rebuilt from the sources in this tree, tying images that select it to one kernel ABI.
## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[7-29]
- general/package/anyka-osdrv-ak3918av130/files/kmod/ak_isp.ko[1-1]
- br-ext-chip-anyka/configs/ak3918av130_lite_defconfig[46-47]
## Recommended Fix
Obtain buildable driver sources from a stable, pinned source location and compile the modules as part of the package build, retaining only artifacts reproducible from documented source. If source for every added binary is unavailable, defer selecting and shipping the AV130 driver package rather than installing opaque modules.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. AV130 images ship 18 unrebuildable driver blobs 🐞 Bug ⛨ Security
Description
files/kmod/*.ko adds 18 prebuilt kernel modules (ISP, encoder, PCM, Ethernet, SD, sensors). The
diff shows them only as binary files, so their contents can't be reviewed, and they come from
github.com/Link-WQS/ANYKA_130L_SDK, a personal GitHub account rather than an OpenIPC repository or
a vendor release. Every ak3918av130_lite image installs them unchanged. Ethernet and SD on that
board depend on ak_eth and ak_mci, so any kernel change that breaks their ABI leaves the camera
with no network, and there is no source to rebuild them from.
Code

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[R11-14]

+# files/kmod is a subset of driver/external/ from os/driver_normal.tar.gz
+# in the AnyCloud39AV130 SDK, unmodified:
+#   https://github.com/Link-WQS/ANYKA_130L_SDK
+#   commit 3480d024b682ccb2cf8bcb87dc4d2ac0af4dc49e
Evidence
The .mk says the modules are copied unmodified from a third-party GitHub account's SDK snapshot, and
that the SDK has no source for the ISP, encoder, audio, Ethernet or SD drivers. INSTALL_TARGET_CMDS
copies files/kmod/*.ko straight into the rootfs. The patch files for each .ko contain no text
hunks, which means they are binary blobs. The PR's own scope checklist leaves 'no binaries that
cannot be rebuilt from source' unticked.

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[11-29]
general/package/anyka-osdrv-ak3918av130/post-build-hook.sh[4-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
anyka-osdrv-ak3918av130 ships 18 prebuilt .ko blobs taken from a personal GitHub account's SDK copy. They cannot be reviewed or rebuilt for another kernel.
## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[7-33]
- general/package/anyka-osdrv-ak3918av130/Config.in[1-10]
## Recommended Fix
Mirror the AnyCloud39AV130 SDK snapshot into an OpenIPC-org repository pinned at a full SHA, and fetch the modules through _SITE/_VERSION instead of committing them to this tree. Build the sensor drivers from the SDK's `os/driver_src/sensor` source now rather than later. Keep the remaining blobs explicitly documented as vendor binaries until source is available.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. Fake kernel version hides driver ABI mismatches ✓ Resolved
Description
CONFIG_LOCALVERSION="-cip94" is set only so the vendor modules' vermagic matches, and
CONFIG_MODVERSIONS is off. As a result, the kernel never checks the CRCs of the struct layouts and
function signatures these modules were built against. A kernel struct or export that differs from
the SDK's CIP tree still loads without warning and fails at runtime with an oops or memory
corruption. One such change in ak_eth's code paths kills networking on a camera nobody can reach.
Code

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[R19-25]

+# The SDK builds these against its own 4.4.302-cip94 tree. The family's
+# kernel (OpenIPC/linux anyka-ak3918ev300) is mainline 4.4.302 with the
+# AV130 machine imported and the structures these modules share laid out the
+# vendor's way; board/ak3918ev300/ak3918av130's CONFIG_LOCALVERSION="-cip94"
+# gives it the release string and vermagic they were built for. That is a
+# vermagic match, not a CIP kernel.
+ANYKA_OSDRV_AK3918AV130_KVER = 4.4.302-cip94
Evidence
The .mk comment says outright that this is 'a vermagic match, not a CIP kernel'. The AV130 kernel
config sets LOCALVERSION -cip94 with MODVERSIONS disabled, so the loader checks only the release
string. The PR's own check is that undefined symbols resolve against Module.symvers, which confirms
the names exist but not that their layouts match.

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[19-25]
br-ext-chip-anyka/board/ak3918ev300/ak3918av130.generic.config[34-35]
br-ext-chip-anyka/board/ak3918ev300/ak3918av130.generic.config[214-214]

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 AV130 kernel fakes the SDK's release string so the blob modules load. MODVERSIONS is off, so ABI drift goes undetected.
## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[19-25]
- br-ext-chip-anyka/board/ak3918ev300/ak3918av130.generic.config[34-35]
## Recommended Fix
If the SDK modules carry __versions sections, build the kernel with CONFIG_MODVERSIONS=y and check them against the CRCs in Module.symvers. Otherwise, document which structs were verified to match, and boot-test every module on hardware before the board joins ALL_BOARDS.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. AV130 package help text hides where its binaries came from 🐞 Bug ⚙ Maintainability
Description
The BR2_PACKAGE_ANYKA_OSDRV_AK3918AV130 help text gives only https://openipc.org as its URL. The
modules actually come from github.com/Link-WQS/ANYKA_130L_SDK at commit 3480d024…, and the package
has an empty _SITE. Anyone reading menuconfig cannot tell that the package installs third-party
prebuilt binaries, or where they came from.
Code

general/package/anyka-osdrv-ak3918av130/Config.in[10]

+	  https://openipc.org
Evidence
Config.in names openipc.org, while the only recorded source of the blobs is the Link-WQS SDK commit
given in a comment in the .mk.

general/package/anyka-osdrv-ak3918av130/Config.in[4-10]
general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[7-14]

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 Config.in help URL does not name where the package's binaries come from.
## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/Config.in[4-10]
## Recommended Fix
Replace the openipc.org URL with the SDK repository URL and commit the .mk cites, or with the OpenIPC mirror if one is created. Also state that the modules are prebuilt vendor binaries.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. AV130 modules miss the kernel after a version bump ✓ Resolved
Description
ANYKA_OSDRV_AK3918AV130_KVER hardcodes 4.4.302-cip94 as the install directory instead of using
the version Buildroot detects from the kernel it built ($(LINUX_VERSION_PROBED)). A sublevel bump
on the kernel branch, or a change to LOCALVERSION, puts the modules under a directory the running
kernel never searches. modprobe in S35modules and load_anyka then fails without anyone noticing,
which leaves the camera with no Ethernet or SD.
Code

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[R25-29]

+ANYKA_OSDRV_AK3918AV130_KVER = 4.4.302-cip94
+
+define ANYKA_OSDRV_AK3918AV130_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/$(ANYKA_OSDRV_AK3918AV130_KVER)/anyka
+	$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/$(ANYKA_OSDRV_AK3918AV130_KVER)/anyka $(ANYKA_OSDRV_AK3918AV130_PKGDIR)/files/kmod/*.ko
Evidence
The install path is the literal KVER, and the family's kernel tarball tracks a branch
(anyka-ak3918ev300) rather than a fixed release. S35modules sends modprobe output to /dev/null, so
a load failure leaves no trace. check_target_modules.sh would catch it, but the PR says CI does not
build this board.

general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[25-29]
general/external.mk[11-12]
general/overlay/etc/init.d/S35modules[7-14]

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 module install directory is hardcoded to 4.4.302-cip94 and can drift from the kernel's actual release string.
## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[25-29]
## Recommended Fix
Add `ANYKA_OSDRV_AK3918AV130_DEPENDENCIES = linux` and install to `$(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/anyka`. Fail the build when LINUX_VERSION_PROBED is not 4.4.302-cip94, so the vermagic assumption is checked rather than silently broken.

ⓘ 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 import rules and skills only from the repositories your team follows

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread br-ext-chip-anyka/configs/ak3918av130_lite_defconfig
Comment on lines +27 to +29
define ANYKA_OSDRV_AK3918AV130_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/$(ANYKA_OSDRV_AK3918AV130_KVER)/anyka
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/$(ANYKA_OSDRV_AK3918AV130_KVER)/anyka $(ANYKA_OSDRV_AK3918AV130_PKGDIR)/files/kmod/*.ko

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Av130 drivers cannot be rebuilt 📘 Rule violation ⚙ Maintainability

ANYKA_OSDRV_AK3918AV130_INSTALL_TARGET_CMDS copies prebuilt SDK kernel modules into the image,
while the package provides no source site or version and documents that source is unavailable for
the ISP, encoder, audio, Ethernet, and SD drivers. Every AV130 image selecting this package depends
on those binaries and their 4.4.302-cip94 kernel ABI, so a kernel or driver change cannot be rebuilt
from the sources in this tree.
Agent Prompt
## Issue description
The AV130 package installs opaque, prebuilt SDK modules for core hardware drivers that cannot be rebuilt from the sources in this tree, tying images that select it to one kernel ABI.

## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[7-29]
- general/package/anyka-osdrv-ak3918av130/files/kmod/ak_isp.ko[1-1]
- br-ext-chip-anyka/configs/ak3918av130_lite_defconfig[46-47]

## Recommended Fix
Obtain buildable driver sources from a stable, pinned source location and compile the modules as part of the package build, retaining only artifacts reproducible from documented source. If source for every added binary is unavailable, defer selecting and shipping the AV130 driver package rather than installing opaque modules.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +11 to +14
# files/kmod is a subset of driver/external/ from os/driver_normal.tar.gz
# in the AnyCloud39AV130 SDK, unmodified:
# https://github.com/Link-WQS/ANYKA_130L_SDK
# commit 3480d024b682ccb2cf8bcb87dc4d2ac0af4dc49e

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

3. Av130 images ship 18 unrebuildable driver blobs 🐞 Bug ⛨ Security

files/kmod/*.ko adds 18 prebuilt kernel modules (ISP, encoder, PCM, Ethernet, SD, sensors). The
diff shows them only as binary files, so their contents can't be reviewed, and they come from
github.com/Link-WQS/ANYKA_130L_SDK, a personal GitHub account rather than an OpenIPC repository or
a vendor release. Every ak3918av130_lite image installs them unchanged. Ethernet and SD on that
board depend on ak_eth and ak_mci, so any kernel change that breaks their ABI leaves the camera
with no network, and there is no source to rebuild them from.
Agent Prompt
## Issue description
anyka-osdrv-ak3918av130 ships 18 prebuilt .ko blobs taken from a personal GitHub account's SDK copy. They cannot be reviewed or rebuilt for another kernel.

## Fix Focus Areas
- general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk[7-33]
- general/package/anyka-osdrv-ak3918av130/Config.in[1-10]

## Recommended Fix
Mirror the AnyCloud39AV130 SDK snapshot into an OpenIPC-org repository pinned at a full SHA, and fetch the modules through _SITE/_VERSION instead of committing them to this tree. Build the sensor drivers from the SDK's `os/driver_src/sensor` source now rather than later. Keep the remaining blobs explicitly documented as vendor binaries until source is available.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread general/package/anyka-osdrv-ak3918av130/anyka-osdrv-ak3918av130.mk
… was checked

The modules went to a literal /lib/modules/4.4.302-cip94. The family's
kernel tracks a branch, and if its release string ever moved, ak_eth and
ak_mci would sit where modprobe never looks and S35modules, which sends
modprobe's output to /dev/null, would leave the camera without network
or SD and say nothing. Install under the release the built kernel
reports, after linux, and stop the build when that is not the -cip94 the
modules were built for.

The vermagic match is the only thing checked at load time: the modules
carry no __versions, so CONFIG_MODVERSIONS has no CRCs to compare. Write
down in the .mk what was checked instead -- symbol resolution against
Module.symvers and the struct-layout probe from OpenIPC/linux#106 -- and,
in ci-matrix.py, that the board waits for a boot on an AV130 before it
joins ALL_BOARDS.
@dimerr

dimerr commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

Summary finding 6 (AV130 modules miss the kernel after a version bump) is fixed in 4e761fe.

  • The package now depends on linux and installs under $(LINUX_VERSION_PROBED).
  • The build stops when the release isn't the 4.4.302-cip94 the modules were built for.
  • Checked locally: the normal build installs all 18 modules under /lib/modules/4.4.302-cip94/anyka, modules.dep lists all 18 and check_target_modules.sh passes. Overriding the expected release makes the package step fail with the mismatch message.

Findings 2, 3 and 5 are left as they are for now.

@dimerr
dimerr merged commit afad8e7 into master Oct 19, 2026
126 of 129 checks passed
@dimerr
dimerr deleted the anyka-ak39-unified branch October 19, 2026 11:07
@dimerr dimerr mentioned this pull request Oct 19, 2026
7 tasks
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