riscv yocto 仓库构建说明.md 1.4 KB

Riscv Yocto 仓库构建说明

仓库下载

  1. 为了加速软件下载,所有用到的软件仓库都放在 https://gitee.com/thead-yocto 下。

  2. 因为要使用 repo 管理,下载软件仓库,需要在 PC 上预先安装好 git,repo 等工具。

repo 建议使用清华源加速,安装设置参考:https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/

  1. 软件仓库下载:
   mkdir riscv_yocto
   cd riscv_yocto
   repo init -u git@gitee.com:thead-yocto/meta-riscv.git  -b master -m tools/manifests/riscv-yocto.xml
   repo sync -c -d -j16

工具链安装

  1. 下载工具链 + sysroot 软件:host.gcc-8.1.0.tar.gz

  2. 安装工具链

   mkdir ~/.thead
   
   # 将下载的 host.gcc-8.1.0.tar.gz 解压到 ~/.thead
   tar zxf host.gcc-8.1.0.tar.gz -C ~/.thead
   
   # 也可以将工具链放到其他位置,同时修改 meta_riscv/conf/machine/include/thead-base.inc 即可

编译

  1. 编译
   source meta-riscv/setup.sh
   
   # 确认 downloads 文件夹:设置一个存放 yocto 下载文件的共享目录 SHARE_YOCTO_DOWNLOAD_FILE_FOLDER
   ln -s SHARE_YOCTO_DOWNLOAD_FILE_FOLDER/ downloads
   
   # 编译:MACHINE 也可以在配置文件中设置为默认 ice
   MACHINE=ice bitbake core-image-minimal
  1. 输出
   # 镜像文件
   ./build/tmp-glibc/deploy/images/ice