3. Compile Source

3.1 Unzip Source

Unzip the source and config the board.

1tar xvf rk356x_linux5.10_source-20230728.tar.bz2
2cd rk356x_linux5.10_source\
3sudo tar xvf debian.tar.bz2
4./build.sh -h                 //view the build command
5./build.sh lunch              //config the board

Print out as follow. Select 3

Serial terminal output
Pick a defconfig:

1. rockchip_defconfig
2. rockchip_rk3566_evb2_lp4x_v10_32bit_defconfig
3. rockchip_rk3566_evb2_lp4x_v10_defconfig
4. rockchip_rk3568_evb1_ddr4_v10_32bit_defconfig
5. rockchip_rk3568_evb1_ddr4_v10_defconfig
6. rockchip_rk3568_uvc_evb1_ddr4_v10_defconfig

Which would you like? [1]: 3

switching to defconfig: /home/Name/opt/rk3566/sdk-11.0/device/rockchip/.chip/rockchip_rk3566_evb2_lp4x_v10_defconfig

3.2 Compile uboot, kernel, recovery, buildroot

Compile all in one step:

1./build.sh

After compile the firmwares are generated in rk356x_linux5.10_source\rockdev

User can also compile step by step:

❶ compile uboot

1./build.sh uboot

❷ compile kernel

1./build.sh kernel

It will pop out a window about config the IO Power Domain Map when first time compile kernel, you need to configure according to below form.

RK3566-IO-Power-Domain-Map

kernel.img, resource.img and boot.img are generated in directory rk3566_linux_source\kernel\

If only configure the kernel, please complie kernel as follow:

1cd kernel
2make ARCH=arm64 menuconfig

The reconfig kernel file is located in kernel\

The kernel’s default configuration file is kernel\arch\arm64\configs\rockchip_linux_defconfig, so it needs to rename kernel\.config to kernel\rockchip_linux_defconfig after reconfig, and copy the file to replace kernel\arch\arm64\configs\rockchip_linux_defconfig

❸ compile recovery

1cd buildroot
2source envsetup.sh
3make recovery-rebuild
4cd ..
5./build.sh recovery

❹ compile buildroot

1./build.sh rootfs

3.3 Compile Debian

1cd debian/
2sudo apt-get install binfmt-support qemu-user-static live-build
3sudo dpkg -i ubuntu-build-service/packages/*
4sudo apt-get install -f
5RELEASE=bullseye TARGET=desktop ARCH=arm64 ./mk-base-debian.sh
6VERSION=debug ARCH=arm64 ./mk-rootfs-bullseye.sh
7./mk-image.sh

After compile, will get linaro-rootfs.img in the directory rk356x_linux5.10_source\debian

Compile_debian11

Execute the follow command to clean the build after compilation.

1sudo ./build.sh cleanall     //clean the build