$ mkdir /opt/pkg
$ ./petalinux-v2015.4-final-installer-dec.run /opt/pkg
可以关闭,此用于xilinx统计信息
$ petalinux-util --webtalk off
更改权限所有者
gsc@gsc-250:/opt/pkg$ sudo chown -R gsc:gsc petalinux-v2015.4-final/
可选(前置条件安装git),这样在修改文件源码时,可以记录跟踪信息
gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git init
gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git add .
gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git commit -m "init add"
gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git log
commit 0efa3e70d0ba244ff4143f3e024e2bc6c27bb4b9Author: shichaoge Date: Wed Apr 6 14:47:57 2016 +0800 init add
设置环境变量,并echo值如下
gsc@gsc-250:~/zynzq7000/peta_zed$ source /opt/pkg/petalinux-v2015.4-final/settings.sh
gsc@gsc-250:~/zynzq7000/peta_zed$ echo $PETALINUX/opt/pkg/petalinux-v2015.4-final
接下来就是创建工程,工程模板下载地址http://pan.baidu.com/s/1dF7BAA9,基于zedboard
gsc@gsc-250:~/zynzq7000/peta_zed$ petalinux-create -t project -s Avnet-Digilent-ZedBoard-v2015.4-final.bsp
INFO: Create project:
INFO: Projects:
INFO: * Avnet-Digilent-ZedBoard-2015.4
INFO: has been successfully installed to /home/gsc/zynzq7000/peta_zed/
INFO: New project successfully created in /home/gsc/zynzq7000/peta_zed/
配置工程
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$ petalinux-config
INFO: Checking component...
INFO: Config linux
****** hsi v2015.4 (64-bit)
**** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015
** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.
source /home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/build/linux/hw-description/hw-description.tcl -notrace
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:16 2016...
[INFO ] config linux
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
[INFO ] generate DTS to /home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/subsystems/linux/configs/device-tree
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
WARNING: ps7_ethernet_0: No reset found
WARNING: ps7_usb_0: No reset found
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:31 2016...
[INFO ] generate BSP for zynq_fsbl
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:47 2016...
INFO: Config linux/kernel
[INFO ] oldconfig linux/kernel
INFO: Config linux/rootfs
[INFO ] oldconfig linux/rootfs
INFO: Config linux/u-boot
[INFO ] generate linux/u-boot configuration files
[INFO ] generate linux/u-boot board header files
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:59 2016...
[INFO ] oldconfig linux/u-boot
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$
编译这个工程
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$ petalinux-build
编译的最后几行如下
[INFO ] package rootfs.cpio to /home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux
[INFO ] Update and install vmlinux image
[INFO ] vmlinux linux/kernel
[INFO ] install linux/kernel
[INFO ] package zImage
[INFO ] zImage linux/kernel
[INFO ] install linux/kernel
[INFO ] Package HDF bitstream
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$
生成BOOT.BIN
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$ petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/download.bit --u-boot --force
INFO: File in BOOT BIN: "/home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux/zynq_fsbl.elf"
INFO: File in BOOT BIN: "/home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux/download.bit"
INFO: File in BOOT BIN: "/home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux/u-boot.elf"
INFO: Generating zynq binary package BOOT.BIN...
INFO: Binary is ready.
镜像目录文件如下
将BOOT.BIN和image.ub拷贝到SD,并从SD卡启动,则有如下信息输出:
到这里基本验证完毕了安装是否正确。
如果修改了board design,则通过如下命令导入新的hdf文件
gsc@gsc-250:~/zynzq7000/Project_based_petalinux/Avnet-Digilent-ZedBoard-2015.4$ petalinux-config --get-hw-description=/home/gsc/zynzq7000/Project_based_petalinux/Avnet-Digilent-ZedBoard-2015.4/hardware/Avnet-Digilent-ZedBoard-2015.4/Avnet-Digilent-ZedBoard-2015.4.sdk/
petalinux2016.4有bug,需要安装在/home目录下