谷动谷力

 找回密码
 立即注册
查看: 2310|回复: 2
打印 上一主题 下一主题
收起左侧

【平头哥Sipeed LicheeRV 86开发板试用】Docker搭建D1 SDK开发环境

[复制链接]
跳转到指定楼层
楼主
发表于 2022-3-15 00:18:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
【平头哥Sipeed LicheeRV 86开发板试用】Docker搭建D1 BSP SDK Tina系统开发环境
【平头哥Sipeed LicheeRV 86开发板试用】Docker搭建 D1 BSP SDK Tina系统开发环境,用的是官方Docker+ubuntu20物理机

准备

  • LicheeRV 86 Panel
  • 数据线
  • 具有32GB以上剩余空间的Linux系统PC一台

docker安装
命令如下:
  1. sudo apt-get install docker.io
  2. sudo docker pull ubuntu
复制代码


安装完成后,使用docker images 或 docker image ls杳看是ubuntu的镜像。
  1. sun@sun-ubuntu:~/licheepiRV$ sudo docker image ls
  2. REPOSITORY            TAG       IMAGE ID       CREATED              SIZE
  3. ubuntu                latest    2b4cba85892a   7 days ago           72.8MB
复制代码


Docker镜像获取

为了方便用户自行开发,矽速整理发布了 LicheeRV 的bsp开发docker镜像,大家使用该镜像可以快速开始D1的系统级开发。
docker镜像可以从百度网盘下载:链接:https://pan.baidu.com/s/1QJTaDw6kkTM4c_GAlmG0hg提取码:wbef
在网盘中下载对应的docker文件后,下了一周,10G多,这个方法不可取,
解压到tar文件(我用开始在ubuntu里命令,全解压的,后面发现dockor没有导入目录的命令)在windows用7z半解压成tar包,docker才能导入,命令:
  1. docker importdocker import licheerv_d1_compile.tar licheerv_d1_compile:latest
复制代码


注不要用官方的docker importdocker import licheerv_d1_compile.tar licheerv_d1_compile:lastest,  不合规
查看镜像
  1. sun@sun-ubuntu:~/licheepiRV$ sudo docker image ls
  2. REPOSITORY            TAG       IMAGE ID       CREATED              SIZE
  3. licheerv_d1_compile   latest   536eae684749   About a minute ago   16.1GB
  4. ubuntu                latest    2b4cba85892a   7 days ago           72.8MB
复制代码


我这样运行,不用密码,是root
  1. sudo docker run -it ubuntu-docker /bin/bash
复制代码


传文件加-v 挂载本地目录 
官方都这样说:然后即可run该容器,用户名为nihao,密码为sipeed123, 不会用.也没说方法怎么运行的用这个用户密码
建议用这个方法,应该会快(可以开始不知道,开始就看md的文档,说下载,我就下载了)直接从dockerhub拉取:
  1. docker pull zepan/d1compile
复制代码



Tina SDK编译

Docker导入的镜像里有源码,编译器及依赖
编译前先把
SDK\target\allwinner\d1-nazhe\defconfig
(3590行)#CONFIG_PACKAGE_alsa-plugins=y 关闭

然后依次运行

  1. cd ~/sdk/tina-d1-open_new/
  2. source build/envsetup.sh
  3. lunch   #选1
  4. make -j4(#按实际核数编译,我第1次未通过,后加参数)
复制代码
出错信息:
  1. ........
  2. docker tag ubuntu:15.10 runoob/ubuntu:v3
  3. * [Makefile:31: /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/compile_dir/host/tar-1.28/.configured] Error 1
  4. checking whether mknod can create fifo without root privileges... configure: error: in `/home/nihao/sdk/tina-d1-open_new/out/d1-nezha/compile_dir/host/tar-1.28':
  5. configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
  6. See `config.log' for more details
  7. make[3]: *** [Makefile:31: /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/compile_dir/host/tar-1.28/.configured] Error 1
  8. make[3]: Leaving directory '/home/nihao/sdk/tina-d1-open_new/tools/tar'
  9. make[2]: *** [tools/Makefile:135: tools/tar/compile] Error 2
  10. make[2]: Leaving directory '/home/nihao/sdk/tina-d1-open_new'
  11. make[1]: *** [tools/Makefile:133: /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/staging_dir/target/stamp/.tools_install_yyyynyyynyyyyyyynnnyyyyyyyyyyynnyyyyyyyynyyynyyyyy] Error 2
  12. make[1]: Leaving directory '/home/nihao/sdk/tina-d1-open_new'
  13. make: *** [/home/nihao/sdk/tina-d1-open_new/build/toplevel.mk:306: world] Error 2
  14. [2]+  Done                    $T/tools/build/buildserver --path $T
  15. .....
复制代码



用下面命令才编译通过的,依据提示:
  1. make j4 FORCE_UNSAFE_CONFIGURE=1
复制代码
编译花费了,很长时间,我的还是物理机,具体多久,不知道,编译后,我不没管它,很久才看它有没编译。


打包

编译完会,打包pack:

  1. root@fe6633ddc2b8:/home/nihao/sdk/tina-d1-open_new# pack
  2. --==========--
  3. PACK_CHIP         sun20iw1p1
  4. PACK_PLATFORM     tina
  5. PACK_BOARD        d1-nezha
  6. PACK_KERN        
  7. PACK_DEBUG        uart0
  8. PACK_SIG          none
  9. PACK_SECURE       none
  10. PACK_MODE         normal
  11. PACK_FUNC         android
  12. PACK_PROGRAMMER   none
  13. PACK_TAR_IMAGE    none
  14. PACK_TOPDIR       /home/nihao/sdk/tina-d1-open_new
  15. --==========--
  16. No kernel param, parse it from d1
  17. copying tools file
  18. copying configs file
  19. storage_type value is 5
  20. rm /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/image/sys_partition_nor.fex
  21. rm /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/image/image_nor.cfg
  22. copying boot resource

  23. LZMA 4.65 : Igor Pavlov : Public domain : 2009-02-03
  24. copying boot file
  25. make user resource for : /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/image/sys_partition.fex
  26. handle partition user-res
  27. no user resource partitions
  28. APP_PART_DOWNLOAD_FILE = /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/image/app.fex
  29. Need size of filesystem
  30. no data resource partitions
  31. don't build dtbo ...
  32. update_chip
  33. pack boot package
  34. GetPrivateProfileSection read to end
  35. content_count=3
  36. LICHEE_REDUNDANT_ENV_SIZE config in BoardConfig.mk
  37. --mkenvimage create redundant env data!--
  38. ---redundant env data size 0x20000---
  39. packing for tina linux
  40. normal
  41. this is not a partition key
  42. gpt_head->header_crc32 = 0xf45be3b4
  43. GPT----part num 8---
  44. gpt_entry: 128
  45. gpt_header: 92
  46. GPT:boot-resource: 1f8           2177        
  47. GPT:env         : 2178          236f        
  48. GPT:env-redund  : 2370          2567        
  49. GPT:boot        : 2568          761f        
  50. GPT:dsp0        : 7620          7a0f        
  51. GPT:recovery    : 7a10          e84f        
  52. GPT:rootfs      : e850          100e84f     
  53. GPT:UDISK       : 100e850       100e85f     
  54. update gpt file ok
  55. update mbr file ok
  56. ====================================
  57. show "sys_partition_for_dragon.fex" message
  58. ------------------------------------
  59.   [mbr]
  60.   mbr_size  : 252 Kbyte
  61. ------------------------------------
  62.   partition_name  : boot-resource
  63.   partition_size  : 8064
  64.   downloadfile  : boot-resource.fex
  65.   boot-resource.fex size : 718K byte
  66. ------------------------------------
  67.   partition_name  : env
  68.   partition_size  : 504
  69.   downloadfile  : env.fex
  70.   env.fex size : 128K byte
  71. ------------------------------------
  72.   partition_name  : env-redund
  73.   partition_size  : 504
  74.   downloadfile  : env.fex
  75.   env.fex size : 128K byte
  76. ------------------------------------
  77.   partition_name  : boot
  78.   partition_size  : 20664
  79.   downloadfile  : boot.fex
  80.   boot.fex -> /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/boot.img
  81.   boot.img size : 9.3M byte
  82. ------------------------------------
  83.   partition_name  : dsp0
  84.   partition_size  : 1008
  85.   downloadfile  : dsp0.fex
  86.   dsp0.fex size : 258K byte
  87. ------------------------------------
  88.   partition_name  : recovery
  89.   partition_size  : 28224
  90. ------------------------------------
  91.   partition_name  : rootfs
  92.   partition_size  : 0x1000000
  93.   downloadfile  : rootfs.fex
  94.   rootfs.fex -> /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/rootfs.img
  95.   rootfs.img size : 100M byte
  96. ------------------------------------
  97.   partition_name  : UDISK
  98. ------------------------------------
  99. /home/nihao/sdk/tina-d1-open_new/out/host/bin/
  100. /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/image
  101. Begin Parse sys_partion.fex
  102. Add partion boot-resource.fex BOOT-RESOURCE_FEX
  103. Add partion very boot-resource.fex BOOT-RESOURCE_FEX
  104. FilePath: boot-resource.fex
  105. FileLength=b3800Add partion env.fex ENV_FEX000000000
  106. Add partion very env.fex ENV_FEX000000000
  107. FilePath: env.fex
  108. FileLength=20000Add partion env.fex ENV_FEX000000000
  109. Add partion very env.fex ENV_FEX000000000
  110. FilePath: env.fex
  111. FileLength=20000Add partion boot.fex BOOT_FEX00000000
  112. Add partion very boot.fex BOOT_FEX00000000
  113. FilePath: boot.fex
  114. FileLength=94c800Add partion dsp0.fex DSP0_FEX00000000
  115. Add partion very dsp0.fex DSP0_FEX00000000
  116. FilePath: dsp0.fex
  117. FileLength=4059cAdd partion rootfs.fex ROOTFS_FEX000000
  118. Add partion very rootfs.fex ROOTFS_FEX000000
  119. FilePath: rootfs.fex
  120. FileLength=6400000sys_config.fex Len: 0x4ec3
  121. config.fex Len: 0x6c00
  122. board.fex Len: 0x400
  123. split_xxxx.fex Len: 0x200
  124. sys_partition.fex Len: 0xc2b
  125. sunxi.fex Len: 0xd600
  126. boot0_nand.fex Len: 0x10000
  127. boot0_sdcard.fex Len: 0x10000
  128. u-boot.fex Len: 0xa0000
  129. u-boot-crash.fex Len: 0x25
  130. toc1.fex Len: 0x8
  131. toc0.fex Len: 0x8
  132. fes1.fex Len: 0xa560
  133. boot_package.fex Len: 0xc0000
  134. usbtool.fex Len: 0x24e00
  135. usbtool_crash.fex Len: 0x1ec00
  136. aultools.fex Len: 0x28a73
  137. aultls32.fex Len: 0x25205
  138. cardtool.fex Len: 0x11e00
  139. cardscript.fex Len: 0x6de
  140. sunxi_gpt.fex Len: 0x2000
  141. sunxi_mbr.fex Len: 0x10000
  142. dlinfo.fex Len: 0x4000
  143. arisc.fex Len: 0xf
  144. vmlinux.fex Len: 0x8
  145. tinaconf.fex Len: 0xe18e
  146. boot-resource.fex Len: 0xb3800
  147. Vboot-resource.fex Len: 0x4
  148. env.fex Len: 0x20000
  149. Venv.fex Len: 0x4
  150. env.fex Len: 0x20000
  151. Venv.fex Len: 0x4
  152. boot.fex Len: 0x94c800
  153. Vboot.fex Len: 0x4
  154. dsp0.fex Len: 0x4059c
  155. Vdsp0.fex Len: 0x4
  156. rootfs.fex Len: 0x6400000
  157. Vrootfs.fex Len: 0x4
  158. BuildImg 0
  159. Dragon execute image.cfg SUCCESS !
  160. ----------image is for nand/emmc----------
  161. ----------image is at----------

  162. /home/nihao/sdk/tina-d1-open_new/out/d1-nezha/tina_d1-nezha_uart0.img

  163. pack finish
复制代码

拿出文件

开始文档拿不出来,第二次用-v
  1. sudo docker run -itv /home/tina:/home/tina licheerv-d1_compile /bin/bash
复制代码


查看是否挂载成功:
  1. root@4ba9051a0ab9:/# ls /home/tina/camera  tinyhttpd-0.1.0  wav2c
复制代码


yeah,成功了,
进SDK目录发现,原来编译的东西没的了,(请教大神,可以有方法让编译文件,保存下来吗?)
  1. root@4ba9051a0ab9:/home/nihao/sdk/tina-d1-open_new# ls
  2. 1.txt          Makefile  device  myfiles          package   scripts  tmpConfig.in      build     dl      myfiles_default  prebuilt  target   toolchainLicheeRV_data  config    lichee  myfiles_waft     rules.mk  test.sh  tools
复制代码

所以在docker 编译后,马上拿出来

再次编译一下吧

这样就能把编译出来的文件, 烧录到开发板。

烧录请持续关注我们,下回分解 
【平头哥Sipeed LicheeRV 86开发板试用】系统镜像烧录运


回复

使用道具 举报

沙发
 楼主| 发表于 2022-3-17 22:47:21 | 只看该作者
全志D1_SDK编译出tina系统不适配话, 解决方法请参考:【平头哥Sipeed LicheeRV 86开发板试用】SDK编译的系统 ...





回复 支持 反对

使用道具 举报

板凳
 楼主| 发表于 2022-4-2 21:06:03 | 只看该作者
官方都这样说:然后即可run该容器,用户名为nihao,密码为sipeed123, 不会用.也没说方法怎么运行的用这个用户密码
sipeed回复,下面命令可以指定用户名启动:
  1. docker run -it -u nihao zepan/d1compile /bin/bash
复制代码


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-4-24 10:47 , Processed in 0.084186 second(s), 40 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表