petalinux安装过程记录

ubuntu160402, vmware12.0
主机是win7x64专业版

1 更换apt-get更新源

系统设置->软件与更新,修改服务器站点
sudo su
cd /etc/apt
cp sources.list sources.list1
gedit sources.list

删除文件里的所有内容,复制下面的所有文本到里面。
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-see
urity multiverse

保存并退出,运行
sudo apt-get update
(sudo apt-get upgrade)

提示:upgrade表示真正升级,如果磁盘空间不是很大,不必执行此条命令,仅进update即可。
至此,ubuntu的整体环境已经搭建完成了,下面开始去官网下载软件吧~

在Xilinx 官网下载petalinux 2015.4,网址如下

下载PetaLinux 2015.4 Installer和 Avnet-Digilent-ZedBoard BSP
下载完成后,将petalinux-v2015.4-final-installer-dec.run和Avnet-Digilent-ZedBoard-v2015.4-final.bsp拷贝到共享文件夹space中
这样根据1.2的方法,即可通过linux访问到安装包。

ubuntu安装Ubuntu Software Center控件:
sudo apt-get install software-center
启动 它:
sudo software-center

2 按照ug1144要求的依赖库进行安装,例如
sudo apt-get install tofrodos
sudo apt-get install iproute2


sudo apt-get install tofrodos
sudo apt-get install iproute
sudo apt-get install gawk
sudo apt-get install xvfb
sudo apt-get install git
sudo apt-get install make
sudo apt-get install net-tools
sudo apt-get install libncurses5-dev
sudo apt-get install tftpd
sudo apt-get install zlib1g:i386
sudo apt-get install libssl-dev
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install libselinux1
sudo apt-get install gnupg
sudo apt-get install wget
sudo apt-get install diffstat
sudo apt-get install chrpath
sudo apt-get install socat
sudo apt-get install xterm
sudo apt-get install autoconf
sudo apt-get install libtool
sudo apt-get install tar
sudo apt-get install unzip
sudo apt-get install texinfo
sudo apt-get install zlib1g-dev
sudo apt-get install gcc-multilib
sudo apt-get install build-essential
sudo apt-get install libsdl1.2-dev
sudo apt-get install libglib2.0-dev
sudo apt-get install screen
sudo apt-get install pax
sudo apt-get install gzip


至于列表中的python3.4,其实ubtunu16.04中同时安装了python2和python3(两者不兼容),ubuntu默认的是python2,暂时不用管。

装完了列表里要求的库,再装一些网友补充的库。
libncurses5
libncurses5-dev
libc6
libstdc++6
zlib1g
libssl-dev
tftpd tftp openbsd-inetd
lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6

3 建立tftp
在安装petalinux可能会警告:No tftp server found - please refer to “PetaLinux SDK Installation Guide” for its impact and solution
操作如下
sudo apt-get install tftpd tftp
sudo apt-get install openbsd-inetd
sudo gedit /etc/inetd.conf

用gedit 添加内容:

在文件中增加以下内容

tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

保存并退出

mkdir /tftpboot
chmod 777 /tftpboot
/etc/init.d/openbsd-inetd restart
netstat -an | more | grep udp

看到有如下输出,即表示tftp安装成功

udp 0 0 0.0.0.0:69 0.0.0.0:*

4 将dash修改为bash
sudo dpkg-reconfigure bash

5 修改/opt的权限。
opt是系统文件夹 权限被保护起来了
打开终端 输入如下命令

sudo chmod 777 /opt 然后回车 输入自己的密码 再回车
这样opt就可以创建文件了

ls -ld /opt
查一下权限

6 建个目录
mkdir -p /opt/pkg/petalinux
注意是用p方式进行make directory。
为了确保权限是755,最好chmod
chmod 755 /opt/pkg/petalinux
然后再检查一下权限
ls -ld /opt/pkg/petalinux

终于可以开始装petalinux了。
把安装包*.run拖到vmware的shared folder里面去。

7 执行安装包程序
先进入存放安装包的目录,通常是shared folder
&cd /mnt/hgfs
&ls
这里会显示虚拟机设置的shared folder。
&cd vmsf
就进入了我们虚拟机设置好的shared folder。
&ls
会显示我们刚拖进来的*.run执行文件。
& ./*.run /opt/pkg/petalinux
执行安装包文件,进入安装过程。
按ENTER,阅读文本协议。
按下q,读完文本,退回terminal。
按下y,确认接受,进行下一步的安装。

9 验证是否安装成功。
退出之前的终端,重新打开一个终端。
&cd /opt/pkg/petalinux
&ls
可以看到有一个settings.sh文件。
&source ./settings.sh
利用脚本导入环境变量。
验证一下,环境变量是否已经 成功导入。
&echo $PETALINUX
可以看到显示出环境变量的值为
“/opt/pkg/petalinux”

10 关闭webtalk。
之前已经导入了环境变量,这里直接不带路径的执行程序文件。
&petalinux-util –webtalk off

11 为了避免每次启动一个终端,都要在终端里导入一次环境变量,需要在启动终端时,初始化阶段就导入环境变量。
修改~/.bashrc。
$gedit ~/.bashrc

猜你喜欢

转载自blog.csdn.net/weixin_42418557/article/details/80628365