Skip to content

lab240/napi-armbian-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Napi-armbian-build

Custom Armbian build configurations, kernel patches, device tree overlays, and build utilities for NAPI2 (RK3568) and NAPI-C (RK3308) industrial SBCs.

πŸ“§ To order boards or discuss integration: dj.novikov@gmail.com
πŸ”§ Board documentation and GPIO pinouts: napi-boards


What's Inside

This repository is a drop-in overlay for the Armbian build system. Clone it, copy the files into your Armbian tree, and build β€” no manual patching needed.

napi-armbian-build/
β”‚
β”œβ”€β”€ config/
β”‚   └── boards/
β”‚       β”œβ”€β”€ napi2.csc               # NAPI2 board config (RK3568J)
β”‚       └── napic.conf              # NAPI-C board config (RK3308)
β”‚
β”œβ”€β”€ userpatches/
β”‚   β”œβ”€β”€ customize-image.sh          # Image customization: users, packages,
β”‚   β”‚                               #   overlay compilation, desktop tweaks
β”‚   β”œβ”€β”€ lib.config                  # Armbian lib overrides
β”‚   β”œβ”€β”€ config-default.conf
β”‚   β”œβ”€β”€ bootscripts/
β”‚   β”‚   └── boot-rockchip64-ttyS0.cmd
β”‚   β”œβ”€β”€ kernel/
β”‚   β”‚   β”œβ”€β”€ archive/rockchip64-6.12/
β”‚   β”‚   β”‚   β”œβ”€β”€ dt/rk3568-napi2.dts         # NAPI2 DTS, mainline 6.12
β”‚   β”‚   β”‚   β”œβ”€β”€ dt/rk3308-napi-c.dts        # NAPI-C DTS, mainline 6.12
β”‚   β”‚   β”‚   └── 0150-mmc-ignore-sd-read-ext-regs-error.patch
β”‚   β”‚   └── rk35xx-vendor-6.1/
β”‚   β”‚       β”œβ”€β”€ dt/rk3568-napi2.dts         # NAPI2 DTS, vendor 6.1
β”‚   β”‚       └── 0150-mmc-ignore-sd-read-ext-regs-error.patch
β”‚   β”œβ”€β”€ overlay/
β”‚   β”‚   β”œβ”€β”€ overlays-rk3308/        # NAPI-C device tree overlays
β”‚   β”‚   β”œβ”€β”€ overlays-rk3568/        # NAPI2 device tree overlays
β”‚   β”‚   β”œβ”€β”€ overlays-rk3568-current/  # NAPI2 overlays, mainline kernel
β”‚   β”‚   β”œβ”€β”€ overlays-rk3568-vendor/   # NAPI2 overlays, vendor kernel
β”‚   β”‚   β”œβ”€β”€ dt-bindings.tar.gz      # DT header includes (packed, ~600 files)
β”‚   β”‚   β”œβ”€β”€ includes-rk35xx-vendor.tar.gz
β”‚   β”‚   β”œβ”€β”€ etc/                    # sysctl.d, apt sources and other system configs
β”‚   β”‚   β”œβ”€β”€ services/               # systemd units (create-home, getty)
β”‚   β”‚   β”œβ”€β”€ xfce-configs/           # XFCE desktop tweaks
β”‚   β”‚   β”œβ”€β”€ lightdm/                # Display manager config
β”‚   β”‚   β”œβ”€β”€ chromium-configs/
β”‚   β”‚   └── backgrounds/            # Custom wallpaper
β”‚   └── u-boot/
β”‚       β”œβ”€β”€ legacy/u-boot-radxa-rk35xx/   # NAPI2 U-Boot patches
β”‚       └── v2024.10/                     # NAPI-C U-Boot patches
β”‚
β”œβ”€β”€ run-mynapi.sh                   # Build wrapper (see below)
β”œβ”€β”€ run-xz-number.sh                # Compress output image with xz + sha256
β”œβ”€β”€ run-clean-images.sh             # Delete output images by pattern
β”œβ”€β”€ check-overlay.sh                # Compile single overlay without full kernel build
└── run-napi-pack.sh                # Pack this repo into timestamped archive

Quick Start

1. Setup Armbian build system

git clone --depth=1 https://github.com/armbian/build ~/arb

2. Apply napi-armbian-build

git clone https://github.com/your-org/napi-armbian-build.git
cd napi-armbian-build

cp -r config/  ~/arb/config/
cp -r userpatches/ ~/arb/userpatches/
cp run-mynapi.sh run-xz-number.sh run-clean-images.sh check-overlay.sh run-napi-pack.sh ~/arb/
chmod +x ~/arb/*.sh

3. Build

cd ~/arb

# NAPI2 β€” minimal image, mainline kernel 6.12
./run-mynapi.sh --napi2 --current --minimal

# NAPI2 β€” minimal image, vendor kernel 6.1 (recommended for production)
./run-mynapi.sh --napi2 --vendor --minimal

# NAPI2 β€” XFCE desktop, vendor kernel
./run-mynapi.sh --napi2 --vendor --desktop

# NAPI-C β€” minimal image (always current, always minimal)
./run-mynapi.sh --napic

# Kernel only (faster iteration)
./run-mynapi.sh --napi2 --current --kernelonly

Output images: ~/arb/output/images/


Build Scripts

run-mynapi.sh

Wrapper over compile.sh with sane defaults for NAPI boards.

Options:
  --napi2 / --napic      Select board (default: napi2)
  --current              Mainline kernel 6.12
  --vendor               Rockchip BSP kernel 6.1
  --edge                 Edge kernel
  --minimal              Minimal console image
  --desktop              XFCE desktop (napi2 only)
  --kernelonly           Build kernel package only
  --noclean              Skip cache cleanup (faster rebuilds)
  --skiparmbian          Skip apt.armbian.com (if upstream is down)
  --help                 Show usage

check-overlay.sh

Compile a single .dts overlay against the kernel headers β€” without rebuilding the kernel. Uses the kernel source tree in ~/arb/cache/sources/.

./check-overlay.sh lvds          # β†’ /tmp/lvds.dtbo
./check-overlay.sh rs485-uart3   # β†’ /tmp/rs485-uart3.dtbo

run-xz-number.sh

Find a built image by ID fragment, compress with xz -9 -T8, generate sha256.

./run-xz-number.sh 0317    # finds output/images/*0317*.img β†’ *.img.xz + *.img.xz.sha256

run-clean-images.sh

Delete output images matching one or more patterns. Supports -y (skip confirmation) and -s (show contents only).

./run-clean-images.sh napic vendor    # delete all images matching *napic* or *vendor*
./run-clean-images.sh -s              # show what's in output/images/
./run-clean-images.sh -y 25Mar        # delete without confirmation

run-napi-pack.sh

Pack all napi-relevant files from ~/arb into a timestamped archive for backup or transfer.

./run-napi-pack.sh
# β†’ ~/tmp/napi-pack-20260405-1423.tar.gz

Kernel Branches

Branch Kernel Use case
current 6.12 Mainline β€” upstream development, overlay debugging
vendor 6.1 Rockchip BSP β€” production, MPP hardware video (/dev/mpp_service)

APT Mirror & Napilab Repository

The build uses the Russian Armbian mirror (stpete-mirror.armbian.com), can be changed.

The image includes the Napilab APT repository which provides packages not available in standard Ubuntu Noble repos:

  • mbusd β€” Modbus TCP to RTU gateway daemon
  • mbscan β€” Modbus device scanner
  • modbus-slave β€” Modbus slave emulator

These packages are pre-configured in the image and available via apt-get install.


Image Defaults

After build, the image has:

Parameter Value
User napi (sudo), root
Root password napilinux
Timezone Europe/Moscow
Locale en_US.UTF-8
Console ttyS2, 1500000
Auto-login Disabled
IPv6 Disabled (sysctl)
SSH Enabled
First-login wizard Disabled
Kernel headers Installed (linux-headers-${BRANCH}-${LINUXFAMILY})
APT repos Ubuntu Noble + Armbian + Napilab
Pre-installed vim, net-tools, can-utils, mbpoll, minicom, tcpdump, screen, i2c-tools, python3-pymodbus, mosquitto, mbusd, memtester, build-essential
Desktop (optional) XFCE, Firefox (non-snap), x11vnc, Mesa/GPU drivers

Compiled overlay .dtbo files are placed in /boot/dtb/rockchip/overlay/. Source .dts files are saved to /root/dts/.


Overlays

Enable in /boot/armbianEnv.txt after flashing:

overlays=rk3568-napi2-rs485-uart3 rk3568-napi2-can0

NAPI2 (RK3568) β€” overlay/overlays-rk3568*/:

File Interface
rs485-uart3 RS485 / UART3
rk3568-can2 CAN 2.0B
lvds-current LVDS, mainline
lvds-vendor LVDS, vendor
i2c4-m1 I2C4
rtc1338 RTC DS1338

NAPI-C (RK3308) β€” overlay/overlays-rk3308/:

File Interface
rk3308-uart1/2/3/4 UART
rk3308-i2c1/3 I2C
rk3308-i2c1-ds1307/38 I2C + RTC
rk3308-spi1-w5500 SPI Ethernet
rk3308-usb20-host USB 2.0 Host

Related


Ordering & Contact

To order NAPI2 / NAPI-C boards or custom carrier boards, or to discuss integration into your project:

πŸ“§ dj.novikov@gmail.com


rockchip rk3568 rk3308 armbian embedded-linux device-tree industrial sbc single-board-computer rs485 can-bus modbus iot-gateway lvds rockchip-rk3568

Updates

12-04-2026

  • Replace gpiod 1.6.3 -> gpiod 2.2 from repi.napilab.ru

About

Armbian builid scripts for Napi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors