petalinux离线编译Linux镜像

petalinux编译linux镜像默认会去 petalinux.xilinx.com下载编译过程中需要的资源包, 如果网络不好或者petalinux所在的那台服务器被限制上网的话, 就编译不了. 但其实xilinx官方提供了离线资源包下载, 只需要预先把集合了所有资源的压缩包下载解压到本地, 通过设置petalinux mirror路径选项就能使用离线资源编译Linux镜像(已测试可行的版本petalinux 2017.4/2018.2/2018.3/2019.1) , 下面以petalinux 2018.2为例实际操作一下.

xilinx自带的说明文档sstate_rel_2018.2_README


By default petalinux uses sstate-cache and download mirrors from petalinux.xilinx.com
This README is for the users who uses tool completely offline.

Setting sstate cache

1) Extract the downloaded tar contents of sstate-cache at any location
2) run petalinux-config
-> Yocto Settings
->Local sstate feeds settings
->local sstate feeds url
(press Enter)
3) Provide the path of sstate-cache from above
Ex: /<path>/aarch64 for ZynqMP projects
/<path>/arm for Zynq projects
/<path>/mb-full for MB AXI full projects

4) Save the configurations to use the sstate-cache

Setting download mirror

1) Extract the downloaded tar contents of sstate-cache at any location
2) run petalinux-config
-> Yocto Settings
-> Add pre-mirror url
-> (press Enter)
Clear default value

3) Provide the path of sstate-cache from above
file://<path>/downloads for all projects

4) Save the configurations to use the download mirrors

5) Verify the changes in build/conf/plnxtool.conf
6) petalinux-build

上面是官方的使用说明, 只需要按照步骤操作就可以。

a. 下载离线资源包sstate-rel-v2018.2.tar.gz并解压.

b. 创建好project后, 运行petalinux-config

我是xilinx zcu104开发板属于ZynqMP系列, 所以选择aarch64

c. 保存好配置后继续下一步petalinux-build即可.