Difference between revisions of "APITestPage/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
Line 1: Line 1:
===搭建编译环境===
 
建议使用'''64位'''的[http://mirrors.aliyun.com/ubuntu-releases/20.04/ Ubuntu 20.04系统],下载并执行以下脚本,会安装编译及打包所需要的软件包,以及交叉编译器:
 
<syntaxhighlight lang="bash">
 
sudo apt-get -y update
 
sudo apt-get install -y sudo curl
 
sudo bash -c \
 
  "$(curl -fsSL https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh)"
 
</syntaxhighlight>
 
脚本执行完成后,你的电脑上会安装好如下交叉编译器:
 
 
{| class="wikitable"  
 
{| class="wikitable"  
 
|-
 
|-
! 版本
+
! 操作系统
! 架构
+
! 内核版本
! 编译器路径
+
! uboot版本
! 用途
+
! 交叉编译器
 +
! 内核代码分支
 +
! 内核配置
 +
! uboot代码分支
 +
! uboot配置
 
|-
 
|-
| 4.9.3
+
| lubuntu
| armhf
+
| linux v4.4.y
| /opt/FriendlyARM/toolchain/4.9.3
+
| u-boot v2014.10
| 用于编译32位的arm应用程序
+
| 6.4-aarch64<br />
 +
| nanopi4-linux-v4.4.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2014.10_oreo
 +
| rk3399_defconfig
 
|-
 
|-
| 6.4
+
| friendlycore-arm64
| aarch64
+
| linux v4.4.y
| /opt/FriendlyARM/toolchain/6.4-aarch64
+
| u-boot v2014.10
| 用于交叉编译4.4内核及Qt5.10应用程序
+
| 6.4-aarch64
 +
| nanopi4-linux-v4.4.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2014.10_oreo
 +
| rk3399_defconfig
 
|-
 
|-
| 11.3
+
| friendlydesktop-arm64
| aarch64
+
| linux v4.4.y
| /opt/FriendlyARM/toolchain/11.3-aarch64
+
| u-boot v2014.10
| 用于交叉编译4.19及以上内核(含5.10,5.15)及uboot
+
| 6.4-aarch64<br />
 +
| nanopi4-linux-v4.4.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2014.10_oreo
 +
| rk3399_defconfig
 +
|-
 +
| eflasher
 +
| linux v4.4.y
 +
| u-boot v2014.10
 +
| 6.4-aarch64<br />
 +
| nanopi4-linux-v4.4.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2014.10_oreo
 +
| rk3399_defconfig
 +
|-
 +
| buildroot
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| debian-buster-desktop-arm64
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| debian-bullseye-core-arm64
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| debian-bullseye-desktop-arm64
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| debian-bullseye-minimal-arm64
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlycore-focal-arm64
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlycore-lite-focal-kernel4-arm64
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlycore-lite-focal-kernel5-arm64
 +
| linux v5.15.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi-r2-v5.15.y
 +
| nanopi4_linux_defconfig
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlywrt21-kernel4
 +
| linux v4.19.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi4-v4.19.y
 +
| nanopi4_linux_defconfig+friendlywrt.config
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlywrt21
 +
| linux v5.15.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi-r2-v5.15.y
 +
| nanopi4_linux_defconfig+friendlywrt.config
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlywrt21-docker
 +
| linux v5.15.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi-r2-v5.15.y
 +
| nanopi4_linux_defconfig+friendlywrt.config
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlywrt22
 +
| linux v5.15.y
 +
| u-boot <br />v2017.09
 +
| 11.3-aarch64
 +
| nanopi-r2-v5.15.y
 +
| nanopi4_linux_defconfig+friendlywrt.config
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 +
|-
 +
| friendlywrt22-docker
 +
| linux v5.15.y
 +
| u-boot v2017.09
 +
| 11.3-aarch64
 +
| nanopi-r2-v5.15.y
 +
| nanopi4_linux_defconfig+friendlywrt.config
 +
| nanopi4-v2017.09
 +
| rk3399_defconfig
 
|}
 
|}
===设置交叉编译器===
 
参考上一节的表格,选用合适版本的编译器,然后将编译器的路径加入到PATH中,例加要使用11.3的交叉编译器,用vi编辑vi ~/.bashrc,在末尾加入以下内容:
 
<syntaxhighlight lang="bash">
 
export PATH=/opt/FriendlyARM/toolchain/11.3-aarch64/bin:$PATH
 
export GCC_COLORS=auto
 
</syntaxhighlight>
 
执行一下~/.bashrc脚本让设置立即在当前shell窗口中生效,注意"."后面有个空格:
 
<syntaxhighlight lang="bash">
 
. ~/.bashrc
 
</syntaxhighlight>
 
这个编译器是64位的,不能在32位的PC Linux系统上运行,设置完成后,用以下命令可以验证是否安装成功:
 
<syntaxhighlight lang="bash">
 
$ aarch64-linux-gcc -v
 
Using built-in specs.
 
COLLECT_GCC=aarch64-linux-gcc
 
COLLECT_LTO_WRAPPER=/opt/FriendlyARM/toolchain/11.3-aarch64/libexec/gcc/aarch64-cortexa53-linux-gnu/11.3.0/lto-wrapper
 
Target: aarch64-cortexa53-linux-gnu
 
Configured with: /home/cross/arm64/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=aarch64-cortexa53-linux-gnu --prefix=/opt/FriendlyARM/toolchain/11.3-aarch64 --exec_prefix=/opt/FriendlyARM/toolchain/11.3-aarch64 --with-sysroot=/opt/FriendlyARM/toolchain/11.3-aarch64/aarch64-cortexa53-linux-gnu/sysroot --enable-languages=c,c++ --enable-fix-cortex-a53-843419 --with-arch=armv8-a+crypto+crc --with-cpu=cortex-a53 --with-pkgversion=ctng-1.25.0-119g-FA --with-bugurl=http://www.friendlyelec.com/ --enable-objc-gc --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --disable-libmpx --with-gmp=/home/cross/arm64/buildtools --with-mpfr=/home/cross/arm64/buildtools --with-mpc=/home/cross/arm64/buildtools --with-isl=/home/cross/arm64/buildtools --enable-lto --enable-threads=posix --disable-libstdcxx-pch --enable-clocale=gnu --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-indirect-function --enable-gnu-unique-object --enable-default-pie --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-gold --with-libintl-prefix=/home/cross/arm64/buildtools --disable-multilib --with-local-prefix=/opt/FriendlyARM/toolchain/11.3-aarch64/aarch64-cortexa53-linux-gnu/sysroot --enable-long-long --enable-checking=release --enable-link-serialization=2
 
Thread model: posix
 
Supported LTO compression algorithms: zlib
 
gcc version 11.3.0 (ctng-1.25.0-119g-FA)
 
</syntaxhighlight>
 

Revision as of 11:27, 25 March 2023

操作系统 内核版本 uboot版本 交叉编译器 内核代码分支 内核配置 uboot代码分支 uboot配置
lubuntu linux v4.4.y u-boot v2014.10 6.4-aarch64
nanopi4-linux-v4.4.y nanopi4_linux_defconfig nanopi4-v2014.10_oreo rk3399_defconfig
friendlycore-arm64 linux v4.4.y u-boot v2014.10 6.4-aarch64 nanopi4-linux-v4.4.y nanopi4_linux_defconfig nanopi4-v2014.10_oreo rk3399_defconfig
friendlydesktop-arm64 linux v4.4.y u-boot v2014.10 6.4-aarch64
nanopi4-linux-v4.4.y nanopi4_linux_defconfig nanopi4-v2014.10_oreo rk3399_defconfig
eflasher linux v4.4.y u-boot v2014.10 6.4-aarch64
nanopi4-linux-v4.4.y nanopi4_linux_defconfig nanopi4-v2014.10_oreo rk3399_defconfig
buildroot linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
debian-buster-desktop-arm64 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
debian-bullseye-core-arm64 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
debian-bullseye-desktop-arm64 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
debian-bullseye-minimal-arm64 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
friendlycore-focal-arm64 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
friendlycore-lite-focal-kernel4-arm64 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
friendlycore-lite-focal-kernel5-arm64 linux v5.15.y u-boot
v2017.09
11.3-aarch64 nanopi-r2-v5.15.y nanopi4_linux_defconfig nanopi4-v2017.09 rk3399_defconfig
friendlywrt21-kernel4 linux v4.19.y u-boot
v2017.09
11.3-aarch64 nanopi4-v4.19.y nanopi4_linux_defconfig+friendlywrt.config nanopi4-v2017.09 rk3399_defconfig
friendlywrt21 linux v5.15.y u-boot
v2017.09
11.3-aarch64 nanopi-r2-v5.15.y nanopi4_linux_defconfig+friendlywrt.config nanopi4-v2017.09 rk3399_defconfig
friendlywrt21-docker linux v5.15.y u-boot
v2017.09
11.3-aarch64 nanopi-r2-v5.15.y nanopi4_linux_defconfig+friendlywrt.config nanopi4-v2017.09 rk3399_defconfig
friendlywrt22 linux v5.15.y u-boot
v2017.09
11.3-aarch64 nanopi-r2-v5.15.y nanopi4_linux_defconfig+friendlywrt.config nanopi4-v2017.09 rk3399_defconfig
friendlywrt22-docker linux v5.15.y u-boot v2017.09 11.3-aarch64 nanopi-r2-v5.15.y nanopi4_linux_defconfig+friendlywrt.config nanopi4-v2017.09 rk3399_defconfig