zynq之嵌入式linux系列(一)——Ubuntu16.04 LTS系统的升级以及petalinux安装问题

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


一、Ubuntu 16.04 升级到 Ubuntu 18.04

1.更新资源:

sudo apt-get update
sudo apt-get upgrade
sudo apt dist-upgrade

2.安装update-manager-core:

sudo apt-get install update-manager-core

3.运行命令检查可升级的版本

sudo do-release-upgrade -c

4.按照提示更新16.04到18.04

do-release-upgrade

但是此时出现问题:
lg@lg-virtual-machine:~$ sudo do-release-upgrade
正在检查新版 Ubuntu
Please install all available updates for your release before upgrading.

5.问题出现在哪呢?

其实仔细翻看前面的指令运行记录就可以看出:
lg@lg-virtual-machine:~$ sudo apt-get upgrade
正在读取软件包列表… 完成
正在分析软件包的依赖关系树
正在读取状态信息… 完成
正在计算更新… 完成
下列软件包的版本将保持不变:
code
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 1 个软件包未被升级。

问题就出现在这,在我16.04系统中,某些特定的软件包可能需要单独更新。code (Visual Studio Code)这个软件包它被标记为未升级,所以我手动更新或卸载此软件包,然后再次尝试升级,就没有问题了~

二、petalinux安装问题

1.下载

软件下载地址不再细说,但值得说的是软件包的选择,不管那个版本的petalinux 安装包,记得下载petalinux 20xx.x install (TAR/GZIP - XXXX),如图:

2.安装依赖库以及软件

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

3.安装 Petalinux

创建安装文件夹:

mkdir -p /petalinux/2019.1

在petalinux 安装包所在文件夹下运行:

/petalinux-v2019.1-final-installer.run /petalinux/2019.1

此时可能会出现一个告警:
WARNING: No tftp server found - please refer to "UG1144 PetaLinux Tools Documentation Reference Gui
此时有两种解决路线
(1)可以先取消安装,执行下面操作:
进入root账户

sudo -u

依次执行:

apt-get install tftpd tftp openbsd-inetd
gedit /etc/inetd.conf

在打开的文件最底部加入:

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

然后保存并退出 ,之后再进行一些简单操作:

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


看到打印出:打印出udp 0 0 0.0.0.0:69 0.0.0.0:*,则问题已经成功解决~

回到在petalinux 安装包所在文件夹下重新运行指令就可以,经过漫长的等待,安装到一半的时候,提醒查看许可,出现“Press Enter to display the license agreements”字样,按回车查看,按q退出,退出后输入y,回车,如此重复三次,才开始正式安装(这个步骤要很小心,如果没有输入y,就回车,就要重新了)。

(2)你也可以选择继续安装,先不管这个警告。等安装结束后再执行前面的:进入root账户——打印出udp 0 0 0.0.0.0:69 0.0.0.0:*这几个步骤也没问题~

注:此外还要插一句题外话,在你安装2019之后的petalinux时(拿20.1举例,指定安装路径是petalinux/2020.1),安装命令就不能是:/petalinux-v2020.1-final-installer.run /petalinux/2020.1 了,否则会报错:
ERROR: Invalid options: /petalinux/2020.1
PetaLinux installer.

Usage:
petalinux-v2020.1-final-installer.run [–log ] [-d|–dir <INSTALL_DIR>] [options]

Options:
–log specify where the logfile should be created.
it will be petalinux_installation_log
in your working directory by default.
-d|–dir [INSTALL_DIR] specify the directory where you want to
install the tool kit. If not specified,
it will install to your working directory.
-p|–platform <arch_name> specify the architecture name.
aarch64 : sources for zynqMP and versal
arm : sources for zynq
microblaze_lite : sources for microblaze_lite
microblaze_full : sources for microblaze_full

EXAMPLES:

Install the tool in specified location:
$ ./petalinux-v2020.1-final-installer.run -d/–dir <INSTALL_DIR>

To get only desired sources:
$ ./petalinux-v2020.1-final-installer.run --dir <INSTALL_DIR>
This will install the sources for all(zynq,zynqMP,versal,microblaze_lite,microblaze_full).

$ ./petalinux-v2020.1-final-installer.run --dir <INSTALL_DIR> --platform “arm”
This will install the sources for zynq only.

$ ./petalinux-v2020.1-final-installer.run --dir <INSTALL_DIR> --platform “arm aarch64”
This will install the sources for zynq,zynqMP and versal.

$ ./petalinux-v2020.1-final-installer.run --dir <INSTALL_DIR> --platform “microblaze_lite microblaze_full”
This will install the sources for microblaze_lite

Please refer to the PetaLinux Tools Installation Guide.

Check the troubleshooting guide at the end of that manual, and if you are
unable to resolve the issue please contact customer support with file:
/mnt/hgfs/share/petalinux_installation_log

解决办法:把运行命令修改为:/petalinux-v2020.1-final-installer.run -d /petalinux/2020.1,问题就解决了~

4.修改bash

安装完成之后,我们还需要进行最后一个设置,petalinux 工具需要主机系统的/bin/sh是 bash, 而 Ubuntu 默认 的/bin/sh 是 dash, 所以 这里需要进行更改,运行命令如下:

sudo dpkg-reconfigure dash

选择“No”按下回车即可。

总结

在这篇文章中记录了几个升级ubuntu系统与petalinux安装的问题,希望能对刚入门的自己与后来者有所帮助~

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

星空lg

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值