4. Compile Debian firmware

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

4.1. Preparatory work

4.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 \

# sdk root dir
sudo dpkg -i debian/ubuntu-build-service/packages/*
sudo apt-get install -f

4.2. Compile SDK

4.2.1. Precompile Configuration

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

./build.sh roc-rk3588s-pc-debian.mk

or

./build.sh roc-rk3588s-pc-BE45-A1-debian.mk # MIPI DSI

4.2.2. Build

4.2.2.1. Automatic compilation

  • Since compiling debian requires sudo privileges, you need to compile debian separately first.。

mkdir -p ubuntu_rootfs/
sudo ./build.sh debian
  • start compiling

./build.sh

the firmware will be saved to the directory rockdev/pack/.

4.2.2.2. Partial compilation

  • u-boot

./build.sh uboot
  • kernel

./build.sh extboot
  • recovery

./build.sh recovery
  • debian

mkdir -p ubuntu_rootfs/
sudo ./build.sh debian
ln -sf debian/debian*-rootfs.img ubuntu_rootfs/rootfs.img
  • Update each part of the .img link to the directory rockdev/:

./mkfirmware.sh
  • Pack the firmware, the firmware will be saved to the directory rockdev/pack/.

./build.sh updateimg