Compile Linux firmware
Download Firefly_Linux_SDK
First prepare an empty folder to place SDK, better under home, here we use ~/proj as example.
Compilation Notes
Attention:
1. SDK uses cross-compile, so download SDK to your X86_64 PC, do not download SDK to arm64 board.
2. Build environment needs to be Ubuntu18.04 (real PC or docker container), other versions may cause build failure.
3. Do not put SDK under shared directory of VM or non-English path.
4. Please get/build SDK as a normal user, root privilege are neither allowed nor required (except installing sth. with apt)
Install Tools
sudo apt update
sudo apt install -y repo git pythonInit Code Repository
- Method One
Download via repo, you can choose to get full SDK or BSP:
mkdir ~/proj/rk3588_sdk/
cd ~/proj/rk3588_sdk/
## Full SDK
repo init --no-clone-bundle --repo-url https://github.com/Firefly-rk-linux-utils/git-repo.git --no-repo-verify -u https://github.com/Firefly-rk-linux/manifests.git -b master -m rk3588_linux_release.xml
## BSP (Only include some basic repositories and compile tools(Only for ubuntu & debian))
## BSP includes device/rockchip, docs, kernel, u-boot, rkbin, tools and cross-compile toolchian
repo init --no-clone-bundle --repo-url https://github.com/Firefly-rk-linux-utils/git-repo.git --no-repo-verify -u https://github.com/Firefly-rk-linux/manifests.git -b master -m rk3588_linux_bsp_release.xml- Method Two
Download Firefly_Linux_SDK sub-volume compressed package: Linux SDK, follow the README document:
└── rk3588_linux_release_xxx
├── linux_sdk_tar
│ ├── rk3588_linux_release_xxx.sdk.split00
│ ├── rk3588_linux_release_xxx.sdk.split01
│ ├── rk3588_linux_release_xxx.sdk.split02
│ ├── rk3588_linux_release_xxx.sdk.split03
├── md5sum.txt
├── README_EN.txt
├── README_ZH.txt
└── sdk_tools.shSync Code
Execute the following command to synchronize the code:
# Enter the SDK root directory
cd ~/proj/rk3588_sdk
# Sync
.repo/repo/repo sync -c --no-tags
.repo/repo/repo start firefly --allYou can use the following command to update the SDK later:
.repo/repo/repo sync -c --no-tagsLinux SDK Configuration introduction
Compile firmware
Compile Ubuntu firmware
This chapter introduces the compilation process of Ubuntu 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.
The compilation portion of this tutorial works with SDK versions above v1.0.6e$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3588/.repo/manifests/rk3588/rk3588_linux_release_20230301_v1.0.6e.xmlPreparatory work
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 \Compile SDK
Precompile Configuration
There are configuration files for different board in device/rockchip/rk3588/, select the configuration file:
./build.sh aio-3588jd4-ubuntu.mkBuild
Automatic compilation
- Download: Ubuntu rootfs(64-bit),put in SDK path
7z x ubuntu-aarch64-rootfs.7z
mkdir ubuntu_rootfs
mv ubuntu-aarch64-rootfs.img ubuntu_rootfs/rootfs.img- start compiling
./build.shthe firmware will be saved to the directory rockdev/pack/.
Partial compilation
- u-boot
./build.sh uboot- kernel
./build.sh extboot- recovery
./build.sh recovery- Download: Ubuntu rootfs(64-bit),put in SDK path
7z x ubuntu-aarch64-rootfs.7z
mkdir ubuntu_rootfs
mv ubuntu-aarch64-rootfs.img ubuntu_rootfs/rootfs.img- Update each part of the
.imglink to the directoryrockdev/:
./mkfirmware.sh- Pack the firmware, the firmware will be saved to the directory
rockdev/pack/.
./build.sh updateimgCompile 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.
The compilation portion of this tutorial works with SDK versions above v1.0.6e$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3588/.repo/manifests/rk3588/rk3588_linux_release_20230301_v1.0.6e.xmlPreparatory work
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 \Compile SDK
Precompile Configuration
There are configuration files for different board in device/rockchip/rk3588/, select the configuration file:
./build.sh aio-3588jd4-debian.mkBuild
Automatic compilation
- Download: Debian rootfs(64-bit),put in SDK path
7z x debian_rk3588_rootfs_xxx.7z
mkdir debian
mv debianxx-rootfs.img debian/debian-rootfs.img- start compiling
./build.shthe firmware will be saved to the directory rockdev/pack/.
Partial compilation
- u-boot
./build.sh uboot- kernel
./build.sh extboot- recovery
./build.sh recovery- Download: Debian rootfs(64-bit),put in SDK path
7z x debian_rk3588_rootfs_xxx.7z
mkdir debian
mv debianxx-rootfs.img debian/rootfs.img- Update each part of the
.imglink to the directoryrockdev/:
./mkfirmware.sh- Pack the firmware, the firmware will be saved to the directory
rockdev/pack/.
./build.sh updateimgCompile Buildroot firmware
This chapter introduces the compilation process of Buildroot 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.
The compilation portion of this tutorial works with SDK versions above v1.0.6e$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3588/.repo/manifests/rk3588/rk3588_linux_release_20230301_v1.0.6e.xmlPreparatory work
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 \Compile SDK
Precompile Configuration
There are configuration files for different board in device/rockchip/rk3588/, select the configuration file:
./build.sh aio-3588jd4-buildroot.mkBuild
Automatic compilation
- start compiling
./build.shthe firmware will be saved to the directory rockdev/pack/.
Partial compilation
- u-boot
./build.sh uboot- kernel
./build.sh extboot- recovery
./build.sh recovery- buildroot
./build.sh rootfs- Update each part of the
.imglink to the directoryrockdev/:
./mkfirmware.sh- Pack the firmware, the firmware will be saved to the directory
rockdev/pack/.
./build.sh updateimgDownload the SDK
Please contact sales@t-firefly.com to get SDK download link and read the readme file
Compilation Notes
Notice:
1. SDK use cross-compilation, so use SDK in x86_64 PC, do not download SDK to the device
2. We suggest to use Ubuntu20.04 (real PC or docker) to build, other OS may cause building failure
3. Do not place or decompress the SDK archive in Virtual Machine share folder or non-english folder
4. Please use the regular user to get/compile the SDK, use root privilege may cause building failure
SDK Introduction
Compile firmware
Build Ubuntu Firmware
Preparations
Run these two commands to install necessary tools
sudo apt update
sudo apt 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 p7zip-fullDownload rootfs here Ubuntu rootfs(64-bit) Kernel6.1, please use rootfs under kernel-6.1 folder.
After download, decompress and move the rootfs image to SDK/prebuilt_rootfs/, then create a symbolic link.
# Decompress
7z x Ubuntu22.04-xxxx.7z
mkdir ./SDK/prebuilt_rootfs/
mv Ubuntu22.04-xxxx.img ./SDK/prebuilt_rootfs/
cd ./SDK/prebuilt_rootfs/
ln -sf Ubuntu22.04-xxxx.img rk3588_ubuntu_rootfs.img
cd ..Configurations
Run ./build.sh lunch to list all available configs, enter a number to select. Please choose one with "ubuntu" keyword:
./build.sh lunch
############### Rockchip Linux SDK ###############
Manifest: rk3588_linux6.1_release_20250114_v1.1.1c
Log colors: message notice warning error fatal
Log saved at /home2/daijh/p/rk3588/sdk_6.1/output/sessions/2025-01-14_14-39-08
Pick a defconfig:
1. rockchip_defconfig
2. firefly_rk3588_aio-3588jd4_buildroot_defconfig
3. firefly_rk3588_aio-3588jd4_debian_defconfig
4. firefly_rk3588_aio-3588jd4_ubuntu_defconfig
5. firefly_rk3588_aio-3588l_debian_defconfig
6. firefly_rk3588_aio-3588l_ubuntu_defconfig
7. firefly_rk3588_aio-3588q_debian_defconfig
8. firefly_rk3588_aio-3588q_ubuntu_defconfig
9. firefly_rk3588_aio-3588sjd4_debian_defconfig
10. firefly_rk3588_aio-3588sjd4_ubuntu_defconfig
11. firefly_rk3588_itx-3588j_buildroot_defconfig
12. firefly_rk3588_itx-3588j_debian_defconfig
13. firefly_rk3588_itx-3588j_ubuntu_defconfig
14. firefly_rk3588_roc-rk3588-rt-ext-10ge_debian_defconfig
15. firefly_rk3588_roc-rk3588-rt-ext-10ge_ubuntu_defconfig
16. firefly_rk3588_roc-rk3588-rt-ext-2g5e_debian_defconfig
17. firefly_rk3588_roc-rk3588-rt-ext-2g5e_ubuntu_defconfig
18. firefly_rk3588_roc-rk3588-rt_debian_defconfig
19. firefly_rk3588_roc-rk3588-rt_ubuntu_defconfig
20. firefly_rk3588_roc-rk3588s-pc-ext_debian_defconfig
21. firefly_rk3588_roc-rk3588s-pc-ext_ubuntu_defconfig
22. firefly_rk3588_roc-rk3588s-pc_debian_defconfig
23. firefly_rk3588_roc-rk3588s-pc_ubuntu_defconfig
24. rockchip_rk3588_evb1_lp4_v10_defconfig
25. rockchip_rk3588_evb7_v11_defconfig
26. rockchip_rk3588_ipc_evb1_v10_defconfig
27. rockchip_rk3588_ipc_evb7_lp4_v11_defconfig
28. rockchip_rk3588_multi_ipc_evb1_v10_defconfig
29. rockchip_rk3588s_evb1_lp4x_v10_defconfig
Which would you like? [1]:Compilation
Full Compilation
Run
./build.sh allThe output firmware will be output/update/update.img
Partial Compilation
After a full compilation, if you modified kernel or uboot, you can do partial compilation to save time.
- Only build u-boot, will generate u-boot/uboot.img
./build.sh uboot- Only build kernel, will generate kernel/extboot.img
./build.sh extboot- Pack all parts to update.img
./build.sh updateimgBuild Debian Firmware
Preparations
Run these two commands to install necessary tools
sudo apt update
sudo apt 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 p7zip-fullDownload rootfs here Debian Rootfs, please use rootfs under kernel-6.1 folder.
After download, decompress and move the rootfs image to SDK/prebuilt_rootfs/, then create a symbolic link.
# Decompress
7z x debian12_xxxx_rootfs_xxxx.7z
# Move the rootfs image to sdk and then create a symbolic link.
mkdir ./SDK/prebuilt_rootfs/
mv debian12_xxxx_rootfs_xxxx.img ./SDK/prebuilt_rootfs/
cd ./SDK/prebuilt_rootfs/
ln -sf debian12_xxxx_rtoofs_xxxx.img rk3588_debian_rootfs.img
cd ..Configurations
Run ./build.sh lunch to list all available configs, enter a number to select. Please choose one with "debian" keyword:
./build.sh lunch
############### Rockchip Linux SDK ###############
Manifest: rk3588_linux6.1_release_20241203_v1.1.1b.xml
Log colors: message notice warning error fatal
Log saved at /home4/lth/project/linux/rk3588_6.1_release/rk3588_6.1/output/sessions/2024-12-11_09-15-44
Pick a defconfig:
1. rockchip_defconfig
2. firefly_rk3588_aio-3588l_debian_defconfig
3. firefly_rk3588_aio-3588q_debian_defconfig
4. firefly_rk3588_aio-3588sjd4_debian_defconfig
5. firefly_rk3588_itx-3588j_buildroot_defconfig
6. firefly_rk3588_itx-3588j_debian_defconfig
7. firefly_rk3588_roc-rk3588-rt-ext-10ge_debian_defconfig
8. firefly_rk3588_roc-rk3588-rt-ext-2g5e_debian_defconfig
9. firefly_rk3588_roc-rk3588-rt_debian_defconfig
10. firefly_rk3588_roc-rk3588s-pc-ext_debian_defconfig
11. firefly_rk3588_roc-rk3588s-pc_debian_defconfig
12. rockchip_rk3588_evb1_lp4_v10_defconfig
13. rockchip_rk3588_evb7_v11_defconfig
14. rockchip_rk3588_ipc_evb1_v10_defconfig
15. rockchip_rk3588_ipc_evb7_lp4_v11_defconfig
16. rockchip_rk3588_multi_ipc_evb1_v10_defconfig
17. rockchip_rk3588s_evb1_lp4x_v10_defconfig
Which would you like? [1]:Compilation
Full Compilation
Run
./build.sh allThe output firmware will be output/update/update.img
Partial Compilation
After a full compilation, if you modified kernel or uboot, you can do partial compilation to save time.
- Only build u-boot, will generate u-boot/uboot.img
./build.sh uboot- Only build kernel, will generate kernel/extboot.img
./build.sh extboot- Pack all parts to update.img
./build.sh updateimgBuild Buildroot Firmware
Preparations
Run these two commands to install necessary tools
sudo apt update
sudo apt 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-devConfigurations
Run ./build.sh lunch to list all available configs, enter a number to select. Please choose one with "buildroot" keyword:
./build.sh lunch
############### Rockchip Linux SDK ###############
Manifest: rk3588_linux6.1_release_20241203_v1.1.1b.xml
Log colors: message notice warning error fatal
Log saved at /home4/lth/project/linux/rk3588_6.1_release/rk3588_6.1/output/sessions/2024-12-11_09-15-44
Pick a defconfig:
1. rockchip_defconfig
2. firefly_rk3588_aio-3588l_debian_defconfig
3. firefly_rk3588_aio-3588q_debian_defconfig
4. firefly_rk3588_aio-3588sjd4_debian_defconfig
5. firefly_rk3588_itx-3588j_buildroot_defconfig
6. firefly_rk3588_itx-3588j_debian_defconfig
7. firefly_rk3588_roc-rk3588-rt-ext-10ge_debian_defconfig
8. firefly_rk3588_roc-rk3588-rt-ext-2g5e_debian_defconfig
9. firefly_rk3588_roc-rk3588-rt_debian_defconfig
10. firefly_rk3588_roc-rk3588s-pc-ext_debian_defconfig
11. firefly_rk3588_roc-rk3588s-pc_debian_defconfig
12. rockchip_rk3588_evb1_lp4_v10_defconfig
13. rockchip_rk3588_evb7_v11_defconfig
14. rockchip_rk3588_ipc_evb1_v10_defconfig
15. rockchip_rk3588_ipc_evb7_lp4_v11_defconfig
16. rockchip_rk3588_multi_ipc_evb1_v10_defconfig
17. rockchip_rk3588s_evb1_lp4x_v10_defconfig
Which would you like? [1]:Compilation
Full Compilation
Run
./build.sh allThe output firmware will be output/update/update.img
Partial Compilation
After a full compilation, if you modified kernel or uboot, you can do partial compilation to save time.
- Only build u-boot, will generate u-boot/uboot.img
./build.sh uboot- Only build kernel, will generate kernel/extboot.img
./build.sh extboot- Pack all parts to update.img
./build.sh updateimgBut if you modified buildroot, you need to do full compilation.

