Openwrt compile

This chapter introduces the compilation process of Openwrt/Lede firmware. It is recommended to use Ubuntu18.04 to compile.

For how to use the Openwrt/Lede system, please check the wiki 《Openwrt User Manual

Get the source code

mkdir firefly_openwrt
cd firefly_openwrt
repo init --repo-url= -u -b master -m rk356x_openwrt_release.xml --no-clone-bundle
.repo/repo/repo sync -c --no-clone-bundle

After obtaining the source code, update the code from the official website and run it directly:

.repo/repo/repo sync -c --no-clone-bundle

Configure before Compile

  • Compile Openwrt firmware

  • Compile Lede firmware


Auto Compile

Compile after configuration

./ all
./ firmware

Manual Compile

Compile uboot

./ uboot

Compile kernel

./ kernel

Compile openwrt

Method 1:

./ openwrt

Method 2:

cd openwrt_sdk/openwrt/
# Or cd openwrt_sdk/lede/: It depends on the version you compiled
./scripts/feeds update -a
./scripts/feeds install -a
cp configs/XXXX_config .config
make defconfig
make download -j8
make -j8

Compile recovery

./ recovery

Package the firmware

Prepare before package firmware

./ firmware

SDK supports packaging two kinds of firmware:

The first type: flash firmware, SD card upgrade firmware

./ updateimg

The second type: SD card boot firmware

./ rawimg

Firmware burning

Wire flash firmware, SD card upgrade firmware

Please read the Wiki tutorials “Using USB cable to upgrade firmware” and “[Using SD card to upgrade firmware](05 -upgrade_firmware_sd.html#shi-yong-sd-ka-sheng-ji-gu-jian)”

SD card boot firmware

Use tool balenaEtcher, download link:

Custom firmware

Take as an example,

# Uboot defconfig
export RK_UBOOT_DEFCONFIG=firefly-rk3568
# Kernel defconfig
export RK_KERNEL_DEFCONFIG=station_linux_defconfig
# Kernel dts
export RK_KERNEL_DTS=rk3568-firefly-roc-pc

# Openwrt version select
# Openwrt defconfig
export RK_OPENWRT_DEFCONFIG=ROC-3568-PC_config
  • RK_UBOOT_DEFCONFIG=firefly-rk3568

    This parameter specifies the uboot configuration file to be used, and the path is u-boot/configs/firefly-rk3568_defconfig

  • RK_KERNEL_DEFCONFIG=station_linux_defconfig

    This parameter specifies the kernel configuration file to be used, and the path is kernel/arch/arm64/configs/station_linux_defconfig

  • RK_KERNEL_DTS=rk3568-firefly-roc-pc

    This parameter specifies the kernel device tree file, and the path is kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts


    This parameter indicates the Openwrt system to be compiled, if it is openwrt, compile openwrt_sdk/openwrt/

    If it is lede, compile openwrt_sdk/lede


    This parameter specifies the configuration file used to compile openwrt, and the path is openwrt_sdk/openwrt/configs/ROC-3568-PC_config