3. Compile Source

3.1 Unzip source

unzip the source and config the board

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

Print out as follow. Select 3

 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

./build.sh    //Compile all in one step

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

User can also use the single-step to compile.

./build.sh uboot      //compile uboot
./build.sh kernel     //compile 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 complied kernel as follow

cd kernel
make 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

cd buildroot
source envsetup.sh
make recovery-rebuild
cd ..
./build.sh recovery             //compile recovery
./build.sh rootfs   //compile buildroot

3.3 Compile debian11

cd debian/
sudo apt-get install binfmt-support qemu-user-static live-build
sudo dpkg -i ubuntu-build-service/packages/*
sudo apt-get install -f
RELEASE=bullseye TARGET=desktop ARCH=arm64 ./mk-base-debian.sh
VERSION=debug ARCH=arm64 ./mk-rootfs-bullseye.sh
./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.

sudo ./build.sh cleanall     //Clean the build