RK3588 Ubuntu

Firefly Ubuntu 22.04

Posted by LXG on July 24, 2024

firefly rk3588

ubuntu-rockchip-download github

Firefly Linux SDK


$ tree -L 1
.
├── app
├── buildroot                                               # Buildroot 根文件系统编译目录
├── build.sh -> device/rockchip/common/build.sh             # 编译脚本
├── device                                                  # 编译相关配置文件
├── docs                                                    # 文档
├── envsetup.sh -> buildroot/build/envsetup.sh
├── external
├── kernel
├── Makefile -> buildroot/build/Makefile
├── mkfirmware.sh -> device/rockchip/common/mkfirmware.sh   # 链接脚本
├── prebuilts                                               # 交叉编译工具链
├── rkbin
├── rkflash.sh -> device/rockchip/common/rkflash.sh         # 烧写脚本
├── tools                                                   # 工具目录
├── u-boot

Firefly 编译 Ubuntu


firefly_rk3588_linux/Linux_SDK$ readlink -f .repo/manifest.xml
/home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK/.repo/manifests/rk3588/rk3588_linux_release_20240517_v1.4.0b.xml

rk3588_linux_release_20240517_v1.4.0b.xml


<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <include name="rk3588/rk3588_linux_bsp_release_20240517_v1.4.0b.xml" />
  <project name="external/security/rk_tee_user" />
  <project name="app/qfm" />
  <project name="app/QLauncher" />
  <project name="app/multivideoplayer" />
  <project name="app/qcamera" />
  <project name="app/qplayer" />
  <project name="app/qsetting" />
  <project name="app/rkadk" />
  <project name="buildroot" >
    <linkfile dest="envsetup.sh" src="build/envsetup.sh"/>
  </project>
  <project name="external/drm-cursor" />
  <project name="external/alsa-config" />
  <project name="external/camera_engine_rkaiq" />
  <project name="external/chromium" />
  <project name="external/rkwifibt-app" />
  <project name="external/rockchip-test" />
  <project name="uefi" />
  <project name="external/rk_pcba_test" />
  <project name="external/rkscript" dest-branch="firefly"/>
  <project name="external/rktoolkit" />
  <project name="external/rkupdate" />
  <project name="external/rkwifibt" />
  <project name="external/gstreamer-rockchip" />
  <project name="external/libmali" />
  <project name="external/linux-rga" />
  <project name="external/recovery" dest-branch="firefly"/>
  <project name="external/security/bin" />
  <project name="external/security/librkcrypto" />
  <project name="external/xserver" />
  <project name="external/mpp" />
  <project name="external/rknn-toolkit2" />
  <project name="external/rknpu2" />
  <project name="external/rockit" />
  <project name="external/common_algorithm" />
  <project name="external/dpdk" />
  <project name="external/uac_app" />
  <project name="external/uvc_app" />
  <project name="yocto/build/conf" path="yocto/build/conf" dest-branch="rk3588/firefly"/>
  <project name="yocto/meta-openembedded" path="yocto/meta-openembedded" dest-branch="rk3588/firefly"/>
  <project name="yocto/meta-qt5" path="yocto/meta-qt5" dest-branch="rk3588/firefly"/>
  <project name="yocto/meta-rockchip" path="yocto/meta-rockchip" dest-branch="rk3588/firefly"/>
  <project name="yocto/meta-clang" path="yocto/meta-clang" dest-branch="rk3588/firefly"/>
  <project name="yocto/meta-browser" path="yocto/meta-browser" dest-branch="rk3588/firefly"/>
  <project name="yocto/meta-lts-mixins" path="yocto/meta-lts-mixins" dest-branch="rk3588/firefly"/>
  <project name="yocto/poky" path="yocto/poky" dest-branch="rk3588/firefly">
    <linkfile dest="yocto/scripts" src="scripts"/>
    <linkfile dest="yocto/bitbake" src="bitbake"/>
    <linkfile dest="yocto/meta-poky" src="meta-poky"/>
    <linkfile dest="yocto/.templateconf" src=".templateconf"/>
    <linkfile dest="yocto/oe-init-build-env" src="oe-init-build-env"/>
    <linkfile dest="yocto/README.md" src="../../.repo/manifests/README_yocto.md"/>
  </project>
</manifest>

rk3588_linux_bsp_release_20240517_v1.4.0b.xml


<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <include name="include/firefly_gitlab.xml" />
  <default remote="firefly-linux" sync-j="4" dest-branch="rk3588/firefly" revision="refs/tags/rk3588/linux_release_v1.4.0b"/>
  <project name="u-boot" />
  
  <project name="docs" path="docs"/>
  <project name="docs-cn" path="docs/cn"/>
  <project name="docs-en" path="docs/en"/>
  <project name="docs-soc_internal-cn" path="docs/cn/RK3588"/>
  <project name="docs-soc_internal-en" path="docs/en/RK3588"/>
  
  <project name="device/rockchip" revision="firefly" >
    <linkfile dest="mkfirmware.sh" src="common/mkfirmware.sh"/>
    <linkfile dest="build.sh" src="common/build.sh"/>
    <linkfile dest="rkflash.sh" src="common/rkflash.sh"/>
    <linkfile dest="device/rockchip/.target_product" src="rk3588"/>
    <linkfile dest="firefly-update.sh" src="common/firefly-update.sh"/>
  </project>
  <project name="tools" >
    <linkfile dest="tools/windows/RKDevTool/RKDevTool_Release/config.cfg" src="windows/RKDevTool/RKDevTool_Release/rk3588-config.cfg"/>
    <linkfile dest="tools/windows/RKDevTool/rockdev/package-file" src="windows/RKDevTool/rockdev/rk3588-package-file"/>
    <linkfile dest="tools/windows/RKDevTool/rockdev/mkupdate.bat" src="windows/RKDevTool/rockdev/rk3588-mkupdate.bat"/>
    <linkfile dest="tools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh" src="linux/Linux_Pack_Firmware/rockdev/rk3588-mkupdate.sh"/>
    <linkfile dest="tools/linux/Linux_Pack_Firmware/rockdev/package-file" src="linux/Linux_Pack_Firmware/rockdev/rk3588-package-file"/>
  </project>
  <project name="kernel" />
  <project name="prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu" />
  <project name="prebuilts/gcc/linux-x86/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf" />
  <project name="rkbin" />
</manifest>

编译环境

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

ubuntu 根文件系统

  1. 7z x Ubuntu22.04-Xfce_RK3588_v3.11-27_20240410.img.7z
  2. mkdir mkdir ubuntu_rootfs
  3. mv Ubuntu22.04-Xfce_RK3588_v3.11-27_20240410.img ubuntu_rootfs/rootfs.img

编译


firefly_rk3588_linux/Linux_SDK$ ./build.sh roc-rk3588s-pc-ubuntu.mk 

You're building on Linux
Launch menu...pick a combo:

0. default BoardConfig.mk
1. BoardConfig-ab-base.mk
2. BoardConfig-rk3588-evb1-lp4-v10.mk
3. BoardConfig-rk3588-evb3-lp5-v10.mk
4. BoardConfig-rk3588-evb7-lp4-v10.mk
5. BoardConfig-rk3588s-evb1-lp4x-v10.mk
6. BoardConfig-security-base.mk
7. BoardConfig.mk
8. CS-A1-N8S-3588s-jd4-main-ubuntu.mk
9. CS-R1-3588s-jd4-sub-minimal-ubuntu.mk
10. CS-R2-3588s-jd4-sub-minimal-ubuntu.mk
11. aio-3588l-buildroot.mk
12. aio-3588l-ubuntu.mk
13. aio-3588q-BE45-A1-buildroot.mk
14. aio-3588q-BE45-A1-debian.mk
15. aio-3588q-BE45-A1-ubuntu.mk
16. aio-3588q-buildroot.mk
17. aio-3588q-debian.mk
18. aio-3588q-edp-buildroot.mk
19. aio-3588q-edp-debian.mk
20. aio-3588q-edp-ubuntu.mk
21. aio-3588q-kylin.mk
22. aio-3588q-ubuntu.mk
23. aio-3588sg-buildroot.mk
24. aio-3588sg-debian.mk
25. aio-3588sg-kylin.mk
26. aio-3588sg-lvds101-buildroot.mk
27. aio-3588sg-lvds101-debian.mk
28. aio-3588sg-lvds101-ubuntu.mk
29. aio-3588sg-ubuntu.mk
30. aio-3588sjd4-BE45-A1-buildroot.mk
31. aio-3588sjd4-BE45-A1-debian.mk
32. aio-3588sjd4-BE45-A1-ubuntu.mk
33. aio-3588sjd4-buildroot.mk
34. aio-3588sjd4-debian.mk
35. aio-3588sjd4-kylin.mk
36. aio-3588sjd4-ubuntu.mk
37. firefly-ab-one-rootfs.mk
38. firefly-ab.mk
39. itx-3588j-BE45-A1-buildroot.mk
40. itx-3588j-BE45-A1-debian.mk
41. itx-3588j-BE45-A1-ubuntu.mk
42. itx-3588j-buildroot.mk
43. itx-3588j-debian.mk
44. itx-3588j-kylin.mk
45. itx-3588j-stationp3-buildroot.mk
46. itx-3588j-stationp3-debian.mk
47. itx-3588j-stationp3-ubuntu.mk
48. itx-3588j-ubuntu.mk
49. roc-rk3588-pc-buildroot.mk
50. roc-rk3588-pc-debian.mk
51. roc-rk3588-pc-kylin.mk
52. roc-rk3588-pc-stationp3-buildroot.mk
53. roc-rk3588-pc-stationp3-debian.mk
54. roc-rk3588-pc-stationp3-ubuntu.mk
55. roc-rk3588-pc-ubuntu.mk
56. roc-rk3588-rt-10g-ext-buildroot.mk
57. roc-rk3588-rt-10g-ext-ubuntu.mk
58. roc-rk3588-rt-buildroot.mk
59. roc-rk3588-rt-ext-buildroot.mk
60. roc-rk3588-rt-ext-ubuntu.mk
61. roc-rk3588-rt-kylin.mk
62. roc-rk3588-rt-ubuntu.mk
63. roc-rk3588s-pc-BE45-A1-buildroot.mk
64. roc-rk3588s-pc-BE45-A1-debian.mk
65. roc-rk3588s-pc-BE45-A1-ubuntu.mk
66. roc-rk3588s-pc-buildroot.mk
67. roc-rk3588s-pc-debian.mk
68. roc-rk3588s-pc-ext-BE45-A1-buildroot.mk
69. roc-rk3588s-pc-ext-BE45-A1-debian.mk
70. roc-rk3588s-pc-ext-BE45-A1-ubuntu.mk
71. roc-rk3588s-pc-ext-buildroot.mk
72. roc-rk3588s-pc-ext-debian.mk
73. roc-rk3588s-pc-ext-ubuntu.mk
74. roc-rk3588s-pc-kylin.mk
75. roc-rk3588s-pc-stationm3-buildroot.mk
76. roc-rk3588s-pc-stationm3-debian.mk
77. roc-rk3588s-pc-stationm3-ubuntu.mk
78. roc-rk3588s-pc-ubuntu.mk
Which would you like? [0]: 78
/home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK
/home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK
switching to board: /home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK/device/rockchip/rk3588/roc-rk3588s-pc-ubuntu.mk
processing option: roc-rk3588s-pc-ubuntu.mk
switching to board: /home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK/device/rockchip/rk3588/roc-rk3588s-pc-ubuntu.mk
/home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK
/home/lxg/code/firefly/firefly_rk3588_linux/Linux_SDK

全部编译

./build.sh

编译生成文件


firefly_rk3588_linux/Linux_SDK/rockdev$ tree
.
├── MiniLoaderAll.bin -> ../u-boot/rk3588_spl_loader_v1.15.113.bin
├── boot.img -> ../kernel/extboot.img
├── misc.img -> ../device/rockchip/rockimg/wipe_all-misc.img
├── pack
│   └── ROC-RK3588S-PC_Ubuntu_v1.4.0b_240724.img
├── parameter.txt -> ../device/rockchip/rk3588/parameter-ubuntu-fit.txt
├── recovery.img
├── rootfs.img -> ../ubuntu_rootfs/rootfs.img
└── uboot.img -> ../u-boot/uboot.img

DIY 自己的系统

Rockchip_Developer_Guide_Linux_Software_CN.pdf

原厂 SDK 获取方式

  1. mkdir sdk && cd sdk
  2. git clone https://gerrit.rock-chips.com:8443/repo-release/tools/repo
  3. ./repo/repo init –repo-url https://gerrit.rock-chips.com:8443/repo-release/tools/repo -u https://gerrit.rock-chips.com:8443/linux/rockchip/platform/manifests -b rk3588 -m rk3588_linux6.1_release.xml

需要获得原厂帐户名和密码的授权


/rk3588_linux$ ./repo/repo init --repo-url https://gerrit.rock-chips.com:8443/repo-release/tools/repo -u https://gerrit.rock-chips.com:8443/linux/rockchip/platform/manifests -b rk3588 -m rk3588_linux6.1_release.xml
Downloading Repo source from https://gerrit.rock-chips.com:8443/repo-release/tools/repo
remote: ******************************************************************************************************************
remote: * Welcome to Rockchip Code Review !                                                                              *
remote: * Repo Tool Download Command = git clone https://gerrit.rock-chips.com:8443/repo-release/tools/repo              *
remote: * Credential Generator Download Command = git clone https://gerrit.rock-chips.com:8443/repo-release/tools/script *
remote: * Credential Generator Run Command = ./Generate-Credential.x                                                     *
remote: * -------------------------------------------------------------------------------------------------------------- *
remote: * 同步代码时如遇需要输入用户名和密码,请核实是否具有相关SDK下载权限,以及授权脚本已成功运行!                    *
remote: * When encountering the need to enter a username and password during SDK synchronization,                        *
remote: * please verify if you have the necessary download permissions and ensure that                                   *
remote: * the Credential Generator has been successfully executed!                                                       *
remote: ******************************************************************************************************************
remote: Counting objects: 8692, done
remote: Finding sources: 100% (8692/8692)
remote: Getting sizes: 100% (545/545)
remote: Total 8692 (delta 6058), reused 8692 (delta 6058)
Downloading manifest from https://gerrit.rock-chips.com:8443/linux/rockchip/platform/manifests
Username for 'https://gerrit.rock-chips.com:8443': 
Password for 'https://gerrit.rock-chips.com:8443':

Ubuntu 根文件系统制作

根文件系统

linux_filesystem

根文件系统首先是内核启动时所mount的第一个文件系统,内核代码映像文件保存在根文件系统中,而系统引导启动程序会在根文件系统挂载之后从中把一些基本的初始化脚本和服务等加载到内存中去运行。 相当于windows下的C盘,保存了系统启动后的应用程序和系统配置

Ubuntu 根文件系统定制

[ubuntu-base]https://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/

Ubuntu 针对不同的 CPU 架构提供相应的 ubuntu base 根文件系统,目前提供的架构有amd64、arm64、armhf、i386、s390x、ppc64