开发环境搭建
获取TinaSDK源码
Tina-SDKV2.0源码网盘链接:https://pan.baidu.com/s/13uKlqDXImmMl9cgKc41tZg?pwd=qcw7
上传到ubuntu,创建文件夹用来保存源码:
ubuntu@ubuntu1804:~$ mkdir Tina_SDK
ubuntu@ubuntu1804:~$ cd Tina_SDK/
ubuntu@ubuntu1804:~/Tina_SDK$ tree -L 1
.
├── tina-d1-h.tar.bz2.00
├── tina-d1-h.tar.bz2.01
├── tina-d1-h.tar.bz2.02
├── tina-d1-h.tar.bz2.03
├── tina-d1-h.tar.bz2.04
├── tina-d1-h.tar.bz2.05
├── tina-d1-h.tar.bz2.06
├── tina-d1-h.tar.bz2.07
└── tina-d1-h.tar.bz2.08
0 directories, 9 files
查看所有文件MD5校验值:
ubuntu@ubuntu1804:~/Tina_SDK$ md5sum tina-d1-h.tar.bz2.*
e755bae00cd76afc3fb276b4e3fd86ba tina-d1-h.tar.bz2.00
cb60ecfdb51c624ff3cbd7b24552866f tina-d1-h.tar.bz2.01
54e56a4cf1cef46ca0a94b85ea1d33a1 tina-d1-h.tar.bz2.02
4988fa08827c0f7af2dc170145e24b26 tina-d1-h.tar.bz2.03
a0463bcf8e73db27b5ecafaac593a919 tina-d1-h.tar.bz2.04
a87382ca16a8c12b3a94f1cad99ce77e tina-d1-h.tar.bz2.05
5973530baa3b282108351818641c27fd tina-d1-h.tar.bz2.06
ccd63e1d16534b364a101d2d44416261 tina-d1-h.tar.bz2.07
e0d72713565f4424ea43c07e15a38139 tina-d1-h.tar.bz2.08
确保校验值对上。否则需要重新上传。
解压源码:
ubuntu@ubuntu1804:~/Tina_SDK$ cat tina-d1-h.tar.bz2.* | tar -jxv
等待一段时间,即可解压完成。
ubuntu@ubuntu1804:~/Tina_SDK$ tree -L 1
.
├── tina-d1-h
├── tina-d1-h.tar.bz2.00
├── tina-d1-h.tar.bz2.01
├── tina-d1-h.tar.bz2.02
├── tina-d1-h.tar.bz2.03
├── tina-d1-h.tar.bz2.04
├── tina-d1-h.tar.bz2.05
├── tina-d1-h.tar.bz2.06
├── tina-d1-h.tar.bz2.07
└── tina-d1-h.tar.bz2.08
1 directory, 9 files
ubuntu@ubuntu1804:~/Tina_SDK$ mv tina-d1-h ../
编译固件之前,先安装一些依赖,否则编译会报错:
sudo apt-get install build-essential subversion git 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 libc6:i386 libstdc++6:i386 lib32ncurses5 lib32z1 -y
编译出固件
进入源码目录,执行source build/envsetup.sh
、lunch
之后,选择2
:
ubuntu@ubuntu1804:~/tina-d1-h$ source build/envsetup.sh
Setup env done! Please run lunch next.
ubuntu@ubuntu1804:~/tina-d1-h$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. d1-h_nezha_min-tina
2. d1-h_nezha-tina
3. d1s_cvbs-tina
4. d1s_nezha-tina
5. t113_100ask_devkit-tina
6. t113_100ask-tina
Which would you like? [Default d1s_nezha]: 2
============================================
TINA_BUILD_TOP=/home/ubuntu/tina-d1-h
TINA_TARGET_ARCH=riscv
TARGET_PRODUCT=d1-h_nezha
TARGET_PLATFORM=d1-h
TARGET_BOARD=d1-h-nezha
TARGET_PLAN=nezha
TARGET_BUILD_VARIANT=tina
TARGET_BUILD_TYPE=release
TARGET_KERNEL_VERSION=5.4
TARGET_UBOOT=u-boot-2018
TARGET_CHIP=sun20iw1p1
============================================
no buildserver to clean
[1] 66670
ubuntu@ubuntu1804:~/tina-d1-h$
接着make
编译、pack
打包:
ubuntu@ubuntu1804:~/tina-d1-h$ make
...
make[5]: Leaving directory '/home/ubuntu/tina-d1-h/target/allwinner/generic/image'
make[4]: Leaving directory '/home/ubuntu/tina-d1-h/target/allwinner/d1-h-nezha'
make[3]: Leaving directory '/home/ubuntu/tina-d1-h/target/allwinner'
make[2]: Leaving directory '/home/ubuntu/tina-d1-h'
export MAKEFLAGS= ;make -w -r package/index
make[2]: Entering directory '/home/ubuntu/tina-d1-h'
Generating package index...
Signing key has not been configured
make[2]: Leaving directory '/home/ubuntu/tina-d1-h'
make[1]: Leaving directory '/home/ubuntu/tina-d1-h'
[2]+ Done $T/tools/build/buildserver --path $T 2> /dev/null 1>&2
#### make completed successfully (15:50 (mm:ss)) ####
ubuntu@ubuntu1804:~/tina-d1-h$
ubuntu@ubuntu1804:~/tina-d1-h$ ls
build Config.in dl logs out prebuilt rules.mk target toolchain
config device lichee Makefile package README.md scripts tmp tools
ubuntu@ubuntu1804:~/tina-d1-h$ pack
--==========--
PACK_CHIP sun20iw1p1
PACK_PLATFORM tina
PACK_BOARD d1-h-nezha
PACK_KERN
PACK_DEBUG uart0
PACK_SIG none
PACK_SECURE none
PACK_MODE normal
PACK_FUNC android
PACK_PROGRAMMER none
PACK_TAR_IMAGE none
PACK_TOPDIR /home/ubuntu/tina-d1-h
--==========--
No kernel param, parse it from d1-h
copying tools file
copying configs file
storage_type value is 5
rm /home/ubuntu/tina-d1-h/out/d1-h-nezha/image/sys_partition_nor.fex
rm /home/ubuntu/tina-d1-h/out/d1-h-nezha/image/image_nor.cfg
copying boot resource
LZMA 4.65 : Igor Pavlov : Public domain : 2009-02-03
copying boot file
make user resource for : /home/ubuntu/tina-d1-h/out/d1-h-nezha/image/sys_partition.fex
handle partition user-res
no user resource partitions
APP_PART_DOWNLOAD_FILE = /home/ubuntu/tina-d1-h/out/d1-h-nezha/image/app.fex
Need size of filesystem
no data resource partitions
don't build dtbo ...
update_chip
pack boot package
GetPrivateProfileSection read to end
content_count=3
LICHEE_REDUNDANT_ENV_SIZE config in BoardConfig.mk
--mkenvimage create redundant env data!--
---redundant env data size 0x20000---
packing for tina linux
normal
mbr count = 4
partitation file Path=/home/ubuntu/tina-d1-h/out/d1-h-nezha/image/sys_partition.bin
mbr_name file Path=/home/ubuntu/tina-d1-h/out/d1-h-nezha/image/sunxi_mbr.fex
download_name file Path=/home/ubuntu/tina-d1-h/out/d1-h-nezha/image/dlinfo.fex
mbr size = 252
mbr magic softw411
disk name=boot-resource
disk name=env
disk name=env-redund
disk name=boot
disk name=rootfs
disk name=dsp0
disk name=recovery
this is not a partition key
update_for_part_info 0
crc 0 = 4c7bc2df
crc 1 = d9c69382
crc 2 = bc706624
crc 3 = 29cd3779
gpt_head->header_crc32 = 0x892c53ba
GPT----part num 8---
gpt_entry: 128
gpt_header: 92
GPT:boot-resource: a1f8 c177
GPT:env : c178 c36f
GPT:env-redund : c370 c567
GPT:boot : c568 1161f
GPT:rootfs : 11620 1b597
GPT:dsp0 : 1b598 1b987
GPT:recovery : 1b988 227c7
GPT:UDISK : 227c8 ffffffde
update gpt file ok
update mbr file ok
temp = 20
mbr count = 4 total_sectors = 15269888 logic_offset = 40960
partitation file Path=/home/ubuntu/tina-d1-h/out/d1-h-nezha/image/sys_partition.bin
mbr_name file Path=/home/ubuntu/tina-d1-h/out/d1-h-nezha/image/sunxi_mbr.fex
download_name file Path=/home/ubuntu/tina-d1-h/out/d1-h-nezha/image/dlinfo.fex
mbr size = 252
mbr magic softw411
disk name=boot-resource
disk name=env
disk name=env-redund
disk name=boot
disk name=rootfs
disk name=dsp0
disk name=recovery
this is not a partition key
update_for_part_info 0
crc 0 = 4c7bc2df
crc 1 = d9c69382
crc 2 = bc706624
crc 3 = 29cd3779
gpt_head->header_crc32 = 0x1328fa28
GPT----part num 8---
gpt_entry: 128