1. Compile Linux firmware

1.1. Compile Ubuntu firmware

This chapter introduces the compilation process of Ubuntu firmware. It is recommended to develop under Ubuntu 20.04 system environment. If you use other system versions, you may need to adjust the compilation environment accordingly.

The compilation portion of this tutorial works with SDK versions above v0.1.0a

$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3576/.repo/manifests/rk3576/rk3576_linux_release_20240606_v0.1.0a.xml

1.1.1. Preparatory work

1.1.1.1. Set up compilation environment

sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool \
expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib \
unzip \
device-tree-compiler ncurses-dev \

1.1.2. Compile SDK

1.1.2.1. Precompile Configuration

There are configuration files for different board in device/rockchip/rk3576/, select the configuration file:

./build.sh firefly_rk3576_aio-3576q_ubuntu_defconfig

1.1.2.2. Build

1.1.2.2.1. Automatic compilation
  • Download: Rootfs,put in SDK path

7z x Ubuntu[xx.xx]-xxxx_RK3576_vx.x.xx_xxxxxxxx.7z
mkdir prebuilt_rootfs/
mv Ubuntu[xx.xx]-xxxx_RK3576_vx.x.xx_xxxxxxxx.img prebuilt_rootfs/rk3576_ubuntu_rootfs.img
  • start compiling

./build.sh

the firmware will be saved to the directory output/update/.

1.1.2.2.2. Partial compilation
  • u-boot

./build.sh uboot
  • kernel

./build.sh extboot
  • recovery

./build.sh recovery
  • Download: Rootfs,put in SDK path

7z x Ubuntu[xx.xx]-xxxx_RK3576_vx.x.xx_xxxxxxxx.7z
mkdir prebuilt_rootfs/
mv Ubuntu[xx.xx]-xxxx_RK3576_vx.x.xx_xxxxxxxx.img prebuilt_rootfs/rk3576_ubuntu_rootfs.img
  • Pack the firmware, the firmware will be saved to the directory output/update/.

./build.sh updateimg