3. Compile Source

Step 1, unzip the source

tar xvf rk356x_android12_sdk.tar.bz2
cd rk356x_android12_sdk
./build.sh -h                //view the build command

Step 2, compile uboot

cd u-boot
./make.sh rk3566

Step 3, compile kernel

cd kernel-4.19
make ARCH=arm64 rockchip_defconfig
make ARCH=arm64 em3566-boardcon-hdmi.img                   //HDMI display

or

make ARCH=arm64 em3566-boardcon-mipi.img                   // 10.1-inch MIPI LCD
make ARCH=arm64 em3566-boardcon-lvds.img                   // 10.1-inch LVDS
make ARCH=arm64 em3566-boardcon-lvds_7inch.img             // 7-inch LVDS

kernel.img and resource.img are included in boot.img, and boot.img is generated in Android12/kernel.

If only update kernel, complie as follow. After compiling, user can directly flash the boot.img under kernel directory.

make make ARCH=arm64 rockchip_defconfig
make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3566_r/boot.img em3566-boardcon-hdmi.img    // for HDMI

or

make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3566_r/boot.img em3566-boardcon-mipi.img          // for MIPI LCD
make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3566_r/boot.img em3566-boardcon-lvds.img          // for 10.1-inch LVDS
make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3566_r/boot.img em3566-boardcon-lvds_7inch.img    // for 7-inch LVDS

Step 4, compile Android

source build/envsetup.sh
lunch rk3566_r-userdebug
make -j8

Step 5, generated image file

./mkimage.sh
./build.sh -u     //package update.img
cd rockdev
ls

Images and update.img are generated in current directory. After compilation, clean the build.

./build.sh cleanall