【全志T113-S3_100ask】编译Tina系统初体验
-
背景
7月28日,百问网官方发布适配Tina系统的SDK。因为使用Tina系统开发还是比较方便的,有全志的SDK支持,可以参考的内容比较多。
https://forums.100ask.net/t/topic/399(一)SDK准备
通过上面的百度网盘下载SDK,拷贝到linux下。
解压缩命令:cat Tina-t113-pro.tar.bz2.* | tar jx
(二)环境准备
全志Tina官方推荐下载:
sudo apt-get update sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip lib32z1 lib32z1-dev lib32stdc++6 libstdc++6 -y
对于Ubuntu 16.04以上版本,部分软件包已不再提供或者采用了其他的包,执行上述命令时, 安装失败的包可先忽略,进一步执行以下命令:
sudo apt-get install libc6:i386 libstdc++6:i386 lib32ncurses5 lib32z1
(三)编译系统
1、初次编译系统
root@znh-ubuntu:~# cd Tina-t113-pro root@znh-ubuntu:~/Tina-t113-pro# ls build Config.in dl linux package rules.mk target toolchain config device lichee Makefile prebuilt scripts tmp tools
步骤:
source build/envsetup.sh lunch make pack
- source build/envsetup.sh :获取环境变量(一个shell生效一次)
- lunch 会提供方案选项以供选。
- make -j8 :编译,其中-j后面的数字参数为编译用的线程数,可根据开发者编译用的PC实际情况选择。
- pack : 打包,将编译好的固件打包成一个.img格式的固件,固件路径 /out
实例:
root@znh-ubuntu:~/Tina-t113-pro# source build/envsetup.sh Setup env done! Please run lunch next. root@znh-ubuntu:~/Tina-t113-pro# lunch You're building on Linux Lunch menu... pick a combo: 1. t113_pro-tina Which would you like? [Default t113_mq]: 1 ============================================ TINA_BUILD_TOP=/disk/Tina_T113_100ask/Tina-t113-pro TINA_TARGET_ARCH=arm TARGET_PRODUCT=t113_pro TARGET_PLATFORM=t113 TARGET_BOARD=t113-pro TARGET_PLAN=pro TARGET_BUILD_VARIANT=tina TARGET_BUILD_TYPE=release TARGET_KERNEL_VERSION=5.4 TARGET_UBOOT=u-boot-2018 TARGET_CHIP=sun8iw20p1 ============================================ no buildserver to clean [1] 4054 root@znh-ubuntu:~/Tina-t113-pro# [1]+ 已完成 $T/tools/build/buildserver --path $T 2> /dev/null 1>&2 root@znh-ubuntu:~/Tina-t113-pro# root@znh-ubuntu:~/Tina-t113-pro# ls build Config.in dl linux package rules.mk target tools config device lichee Makefile prebuilt scripts toolchain root@znh-ubuntu:~/Tina-t113-pro# make -j8 ... make[1]: Leaving directory '/disk/Tina_T113_100ask/Tina-t113-pro' [2]+ 已完成 $T/tools/build/buildserver --path $T 2> /dev/null 1>&2 #### make completed successfully (02:49:28 (hh:mm:ss)) #### root@znh-ubuntu:~/Tina-t113-pro#
当然我的编译过程没有那么顺利
错误1:
you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment
解决(大概意思就是root用户需要设置这个):
export FORCE_UNSAFE_CONFIGURE=1
错误2:缺失 gmp.h
enwrt-linux-muslgnueabi/6.4.1/plugin/include/system.h:681:10: fatal error: gmp.h: No such file or directory
解决:
sudo apt-get install libgmp-dev
错误3:缺失 mpc.h
enwrt-linux-muslgnueabi/6.4.1/plugin/include/builtins.h:23:10: fatal error: mpc.h: No such file or directory
解决:
sudo apt-get install libmpc-dev
错误4 致命:不安全的存储库由其他人拥有
`atal: detected dubious ownership in repository at '/disk/Tina_T113_100ask/Tina-t113-pro' To add an exception for this directory, call: git config --global --add safe.directory /disk/Tina_T113_100ask/Tina-t113-pro Makefile:646: recipe for target '/disk/Tina_T113_100ask/Tina-t113-pro/out/t113-pro/packages/base/libgcc_-1_sunxi.ipk' failed make[3]: *** [/disk/Tina_T113_100ask/Tina-t113-pro/out/t113-pro/packages/base/libgcc_-1_sunxi.ipk] Error 128 make[3]: Leaving directory '/disk/Tina_T113_100ask/Tina-t113-pro/package/libs/toolchain' package/Makefile:192: recipe for target 'package/libs/toolchain/compile' failed make[2]: *** [package/libs/toolchain/compile] Error 2 make[2]: Leaving directory '/disk/Tina_T113_100ask/Tina-t113-pro' package/Makefile:189: recipe for target '/disk/Tina_T113_100ask/Tina-t113-pro/out/t113-pro/staging_dir/target/stamp/.package_compile' failed make[1]: *** [/disk/Tina_T113_100ask/Tina-t113-pro/out/t113-pro/staging_dir/target/stamp/.package_compile] Error 2 make[1]: Leaving directory '/disk/Tina_T113_100ask/Tina-t113-pro' /disk/Tina_T113_100ask/Tina-t113-pro/build/toplevel.mk:304: recipe for target 'world' failed make: *** [world] Error 2 #### make failed to build some targets (01:18 (mm:ss)) #### root@znh-ubuntu:~/Tina-t113-pro#
解决(该目录每个人都不一样):
git config --global --add safe.directory /disk/Tina_T113_100ask/Tina-t113-pro
2、进阶编译操作
如果不需要完整编译整个系统,也可以对部分模块进行编译,如单独编译boot0、单独编译uboot、单独编译内核和单独编译某个包等,Tina环境都提供了相应的快捷命令:
mboot - 单独编译boot0和uboot,可在Tina任意目录下使用. mboot0 - 单独编译boot0,可在Tina任意目录下使用 - muboot - 单独编译uboot,可在Tina任意目录下使用 mkernel - 单独编译内核,可在Tina任意目录下使用 mm - 单独编译某个包,只能在编译的包路径下操作,如包路径为 tina/package/utils/rwcheck,则需要进入到 tina/package/utils/rwcheck路径下再输入 mm 命令,编译出来对应的安装包的路径在 tina/out/d1-nezha/packages/base下 - 在根目录下编译某个软件包:make <应用包的路径>/install,需要在根目录下操作 如 make package/utils/rwcheck/install - 在根目录下清空应用包临时文件:make <应用包的路径>/clean,需要在根目录下操作 如 make package/utils/rwcheck/clean0.img。
(四)烧录系统
编译出来的镜像可以通过sd卡启动。通过全志工具PhoenixCard烧写。
启动系统
原文链接:https://blog.csdn.net/qq_46079439/article/details/126053220
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号