1屯碴、將當(dāng)前用戶加入sudo
使用root用戶茅逮,輸入visudo命令打開sudo配置文件,找到下面這一行薯蝎,并在下面新增黑色部分遥倦,其中username是要添加的用戶名。
root ALL=(ALL) ALL
username ALL=(ALL) ALL
2、開機(jī)自動(dòng)加載共享文件夾
使用sudo vim /etc/fstab袒哥,在fstab最后添加如下一行缩筛,將所有共享文件夾mount進(jìn)hgfs目錄下面:(使用vmware-hgfsclient命令可以查看到所有的共享文件夾名稱)
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0
注意:要在主機(jī)與虛擬機(jī)中設(shè)置共享文件夾,需要安裝VMware Tools工具堡称,自動(dòng)掛載點(diǎn)是“/mnt/hgfs”瞎抛。(1)進(jìn)入VMware菜單欄中的虛擬機(jī)設(shè)置選項(xiàng)——共享文件夾設(shè)置中添加主機(jī)中用來(lái)給客戶機(jī)共享的目錄。(2)啟動(dòng)虛擬機(jī)却紧,啟動(dòng)終端桐臊,執(zhí)行“vmware-hgfsclient”命令可以顯示所有啟用的共享文件夾名稱(顯示的是添加共享目錄時(shí)設(shè)置的共享名稱)。如果沒有結(jié)果晓殊,則虛擬機(jī)設(shè)置中添加的共享文件夾沒有啟用断凶。重新進(jìn)入設(shè)置啟用即可,不用重啟虛擬機(jī)巫俺。(3)用root權(quán)限執(zhí)行如下命令將共享文件夾掛載到Linux中:
a. 4.0之前的Linux內(nèi)核:
sudo mount -t vmhgfs .host:/ /mnt/hgfs#將所有共享文件夾掛載到/mnt/hgfs
sudo mount -t vmhgfs .host:/share /mnt/hgfs/share#將名稱為share的共享掛載到/mnt/hgfs/share下
b. 4.0及更高版本的Linux內(nèi)核:
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other #將所有共享文件夾掛載到/mnt/hgfs
sudo vmhgfs-fuse .host:/share /mnt/hgfs/share -o subtype=vmhgfs-fuse,allow_other #將名稱為share的共享掛載到/mnt/hgfs/share下
可以用“vmhgfs-fuse -h”查看命令幫助认烁。掛載點(diǎn)可以自己設(shè)置,不一定要放在默認(rèn)目錄介汹。
3.安裝petalinux
安裝依賴包
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
安裝tftp server
sudo yum install xinetd tftp tftp-server
配置tftp server
[root@localhost ~]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot -c # 注意這行却嗡,如果允許上傳,一定要加上參數(shù) -c
disable = no # 這行默認(rèn)為yes嘹承,改成no窗价,允許
per_source = 11
cps = 100 2
flags = IPv4
}
重啟服務(wù):
systemctl restart xinetd
創(chuàng)建安裝目錄并安裝
sudo mkdir -p /opt/pkg/petalinux/2018.3
sudo chmod 755 /opt/pkg/petalinux
sudo chown -R synopsys:synopsys 2018.3
./petalinux-v2018.3-final-installer.run /opt/pkg/petalinux/2018.3
4. 添加petalinux初始化腳本
使用vim /.bashrc命令,在/.bashrc中添加如下一行:
source /opt/pkg/petalinux/2018.3/settings.sh