patelinux 安装

参考文档:https://china.xilinx.com/support/documentation/sw_manuals/xilinx2017_2/ug1144-petalinux-tools-reference-guide.pdf

参考文章:http://www.cnblogs.com/vacajk/p/6146146.html

参考链接:https://askubuntu.com/questions/201505/how-do-i-install-and-run-a-tftp-server

主机环境:ubuntu16.04.03 LTS

petalinux verison :2017.2

楼主开始并没有按照ug1144安装,而是按照参考文章中说的安装的,包括更改更新源什么的(apt-get的源),安装petalinux工具没问题,但是用petalinux-build的时候出现错误,具体的错误没有拷贝下来,大概是ld.so:object "libpseudo.so" form LD_PRELOAD can't be preload(wrong elf class64),楼主因为这个错误重新安装操作系统好几次,手动安装 32位和64位的 libpseudo,设置LD_PRELOAD,都没有起作用,楼主各种怀疑petalinux2017.2不稳定啊,ubuntu版本不稳定啊,楼主人品不行啊,反正怀疑人生了,当时已经崩溃。

山重水复疑无路,柳暗花明又一村

楼主还是老老实实的看ug1144,可以确定是肯定是依赖库的问题,也没有换更新源。ug1144中这样说

PetaLinux requires a number of standard development tools and libraries to be installed
on your Linux host workstation. Install the libraries and tools listed in the following
table on the host Linux. All of the listed Linux Workstation Environments below have
the 32-bit libraries needed by the PetaLinux tool. If any addition tool chains are
packages needing 32-bit libs on host are needed, install the same before issuing
petalinux-build. Table 1-3 below describes the required packages, and how to install
them on different Linux workstation environments

楼主理解的是表中所有库都要安装32位的,其实不是的,这可能与楼主不熟悉ubuntu有关系

使用apt-get install 安装表中所有的tool/library,Python3.4.0是不用安装的,unbuntu16.04.03中有python3.5,这个版本不一致没关系。下面举个荔枝,主要给小白看,注意apt-get可以一次把所有需要的库都安上,例如 sudo apt-get install tofrodos iproute2 .....但是为了稳妥还是一个一个安装吧

sudo apt-get install tofrodos

表中的所有tool/libraty都这样安装,有个需要注意的是zlib1g-dev,这个同时要安装32位的

sudo apt-get install zlib1g-dev:i386

基本上按上述安装就ok了,这篇博客是后补的,所以有些步骤我想起来就补充一下,一旦有用呢(捂脸)。

比如:安装tool/library时会出现某某包需要手动安装,这时要cd /var/cache/apt/archives,找到前面提到的包sudo dpkg -i xx.deb就好了。

最后是TFTP,这个也要安装的,参考链接https://askubuntu.com/questions/201505/how-do-i-install-and-run-a-tftp-server

接下来就可以放心安装petalinux了,ug1144给的例子是安装在/opt/pkg/petalinux中的,还必须使用普通用户,可是/opt需要root权限,楼主没费劲用什么chmod之类的,也用不明白,直接安在~/目录下。

另外一个问题是bash,这个按照参考文章中的说的更改就好了。

最后就是petalinux working environment,使用下面命令

gedit ~/.bashrc

最后一行加入source XXX/settings.sh

XXX是petalinx安装的路径

接下来就愉快的使用petalinux吧

原文地址:https://www.cnblogs.com/feiyibuluo/p/7389916.html