由于近期需要对ZYNQ ARM端做Linux开发测试,需要用到Petalinux工具进行定制,所以本文对Petalinux安装过程进行简要总结,并对安装过程中遇到的一些问题进行解释并解决。
Petalinux是Xilinx公司开发的嵌入式Linux定制软件,通过与Vivado协同工作从而简化Linux系统的开发工作。开发人员可以通过Petalinux定制u-boot、Linux内核和Linux应用,并且可以通过网络或JTAG在全系统仿真器或物理硬件上添加新的内核、器件驱动程序、应用和库,以及启动并测试软件协议栈,完成从系统启动到执行的所有操作。
Xilinx官网提供了Petalinux的下载地址Petalinux Download和安装指南Petalinux Reference Guide,具体安装过程可以参考安装指南。

sudo chmod +x petalinux-v2017.4-final-installer.run


Ubuntu系统:
sudo apt-get install -y tofrodos gawk xvfb git make net-tools libncurses5-dev tftpd \
zlib1g-dev zlib1g:i386 libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath \
socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential \
screen pax gzip
Redhat/CentOS系统
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch diffutils \
diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat perl-Data-Dumper \
perl-Text-ParseWords perl-Thread-Queue python34-pip xz which SDL-devel xterm autoconf \
libtool zlib-devel automake glib2-devel zlib ncurses-devel openssl-devel dos2unix flex \
bison glibc.i686 screen pax glibc-devel.i686 compat-libstdc+-33.i686 libstdc+.i686
等待安装完成:

sudo apt-get install -y python tftpd-hpa

sudo mkdir -p /opt/petalinux/2017.4/

sudo chown carson /opt/petalinux/2017.4/

./petalinux-v2017.4-final-installer.run /opt/petalinux/2017.4/

Enter阅读协议:

‘q’键退出协议:

‘y’同意协议内容:

‘q’键退出协议:

‘y’同意协议内容:

‘q’键退出协议:

‘y’同意协议内容,等待安装完成:

1. 安装过程报错 “ERROR: You are PetaLinux installation guide - required tools and libraries package section for detailed information”

问题原因: 依赖包未完全安装,缺少相关的依赖包,例如这里缺少python库:
解决方法: 按照提示安装相应的安装包:
sudo apt-get install -y python
2. 安装过程警告 “WARNING: No tftp server found - please refer to “PetaLinux SDK Installation Guide” for its impact and solution”

问题原因: 没有安装tftp server,tftp提供比JTAG更快的boot启动,官方文档解释如下:

解决方法: 安装tftp server并提供相应的读写权限:
sudo apt-get install tftpd-hpa ##安装tftp server

sudo mkdir -p /var/lib/tftpboot/ ##创建tftpboot启动目录
sudo chmod 777 /var/lib/tftpboot/ ##为启动目录添加权限
sudo vim /etc/default/tftpd-hpa ##更改tftpboot启动配置内容

tftpd-hpa默认配置如下:

将其配置到新建目录下:

重启tftp server服务:
sudo service tftpd-hpa restart

3. 安装过程报错 “ERROR: You have tools don’t meet the version requirements: -Detected python version is less than the expected 2.7.3”

问题原因: python版本过低或安装成python3,由于python3更新内容较多,这里采用的仍然是python2.7(python2.7.3以上版本)
解决方法: 若python版本为python3,安装python2.7.17并设置为默认:
##查看python版本
python --version
##安装python2.7
sudo apt-get install -y python
##更改python软链接为python2.7
cd /usr/bin #进入python所在目录
sudo rm python #将原有python文件删除
sudo ln -s python2.7 python #将python链接到python2.7
若问题仍未解决,则需要更改/var/lib/dpkg下的status文件:
cd /var/lib/dpkg #进入/var/lib/dpkg目录
sudo vi status #用vim修改status文件,若未安装vim需提前安装
搜索到python package部分并在之前添加如下内容(vi/vim搜索编辑方法):
Package: python
Status: install ok installed
Maintainer: Fake Entry <fake@example.com>
Architecture: all
Version: 2.7.17
Description: fake package for petalinux

保存退出后再次运行即可成功完成安装。
4. 运行过程报错 “libncursesw.so.5: cannot open shared object file: No such file or directory”
问题原因: 缺少libncursesw.so.5文件,在/lib/x86_64-linux-gnu和/lib32下无法找到libncursesw.so.5


解决方法: 搜索libnursesw.so.5,查找是否存在该文件:
sudo apt install apt-file
sudo apt-file update
sudo apt-file find libncursesw.so.5
若无法找到该文件,则需重新安装libncursesw库:
sudo apt-get install libncursesw5
ncursesw(libncursesw.so.5)在ncurses(libncurses.so.5)的基础上增加对支持utf8字符集的支持,即可支持中文,因此如果软件中存在中文的话,在运行过程中可能还会报错: utf8不支持。
我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
尝试通过RVM将RubyGems升级到版本1.8.10并出现此错误:$rvmrubygemslatestRemovingoldRubygemsfiles...Installingrubygems-1.8.10forruby-1.9.2-p180...ERROR:Errorrunning'GEM_PATH="/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/ruby-1.9.2-p180@global:/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/rub
我打算为ruby脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn
我有一个奇怪的问题:我在rvm上安装了rubyonrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(
我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121
由于fast-stemmer的问题,我很难安装我想要的任何rubygem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub