一、配置网络
安装一下net-tool,好使用ifconfig命令:
sudo apt install net-tools
1、编辑网络配置文件
sudo gedit /etc/netplan/00-installer-config.yaml
添加内容:
network:
ethernets:
ens32:
addresses:
- 192.168.1.105/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
version: 2
2、加载刚刚修改的配置文件信息
sudo netplan apply
没有提示报错信息,说明配置成功
ping一下百度:
iefyuan@ubuntu:~$ ping www.baidu.com
PING www.baidu.com (14.215.177.38) 56(84) bytes of data.
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=128 time=7.62 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=128 time=10.3 ms
^C
--- www.baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 7.624/8.957/10.291/1.333 ms
ping一下主机
liefyuan@ubuntu:~$ ping 192.168.1.102
PING 192.168.1.102 (192.168.1.102) 56(84) bytes of data.
64 bytes from 192.168.1.102: icmp_seq=1 ttl=128 time=0.859 ms
64 bytes from 192.168.1.102: icmp_seq=2 ttl=128 time=1.57 ms
64 bytes from 192.168.1.102: icmp_seq=3 ttl=128 time=1.55 ms
^C
--- 192.168.1.102 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2021ms
rtt min/avg/max/mdev = 0.859/1.327/1.571/0.331 ms
二、修改源
安装vim
sudo apt-get install vim
备份源
cp /etc/apt/source.list /etc/apt/source.list.bak
编辑文件:
sudo vim /etc/apt/source.list
内容添加为:
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
保存好
版本 英文代号 14.04 trusty 16.04 xenial 18.04 bionic 20.04 focal
更新源:
sudo apt-get update
三、安装Samba
参考:https://blog.csdn.net/qq_44078824/article/details/119847027
3.1 ubuntu上新建一个共享文件夹
mkdir /home/liefyuan/samba-share
sudo chmod 777 /home/liefyuan/samba-share
3.2 安装samba
sudo apt-get install samba
3.3 新建账号
sudo smbpasswd -a liefyuan
然后再根据提示输入两个一样密码:
liefyuan@ubuntu:~$ sudo smbpasswd -a liefyuan
New SMB password:
Retype new SMB password:
Added user liefyuan.
这个账号密码,在windows下的主机操作有用。
3.4 编辑配置文件
打开samba配置文件
sudo vim /etc/samba/smb.conf
编辑修改
; write list = root, @lpadmin
[share]
path = /home/liefyuan/samba-share
public = yes
writable = yes
available = yes
comment = share folder
browseable = yes
create mask = 0700
directory mask = 0700
force user = liefyuan
valid users = liefyuan
force group = liefyuan
重启Samba
sudo service smbd restart
3.5 主机操作:Windows下配置共享
Ubuntu下查看IP地址:
liefyuan@ubuntu:~/t113$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.61.135 netmask 255.255.255.0 broadcast 192.168.61.255
inet6 fe80::591b:61d3:7c45:1bdb prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:71:3c:ee txqueuelen 1000 (Ethernet)
RX packets 516911 bytes 767938872 (767.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33013 bytes 2242512 (2.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 5492 bytes 446274 (446.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5492 bytes 446274 (446.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
inet 192.168.61.135
主机Windows下,点击win图标+R俩个按键,输入\+ubuntu的ip地址 如图:我的是192.168.61.135 用户名和密码就是上面创建的!! OK,Windows下就有了共享目录了!!
四、交叉环境–软件
4.1 安装vsftpd
sudo apt-get install vsftpd
配置
sudo vim /etc/vsftpd.conf
注销掉,关闭匿名访问
去掉注销,#让本地账号可以访问,比如root,等系统登录账号
local_enable=YES
write_enable=YES
如果你需要让root可以访问需要执行第三步
sudo vi /etc/ftpusers
把root去掉 重启vsftpd
service vsftpd restart
查看运行状态
ps -aux | grep vsftpd
4.2 安装Git
sudo apt-get install git
4.3 安装GParted
安装TF卡分区工具软件:
sudo apt-get install gparted
4.4 安装设备树编译工具
sudo apt-get install device-tree-compiler
五、交叉编译环境
sudo tar -xvf gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz -C /usr/local/arm/
sudo vim /etc/profile
/etc/profile文件最后添加:
export PATH=$PATH:/usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin
测试一下交叉编译器:
liefyuan@ubuntu:~/t113$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/7.5.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release_1/snapshots/gcc.git~linaro-7.5-2019.12/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/sysroots/arm-linux-gnueabihf --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 7.5.0 (Linaro GCC 7.5-2019.12)
OK没有问题!
安装交叉编译相关的软件包
sudo apt-get install build-essential git-core libncurses5-dev \
flex bison texinfo zip unzip zlib1g-dev gettext u-boot-tools \
g++ xz-utils mtd-utils gawk diffstat gcc-multilib python git \
make gcc g++ diffstat bzip2 gawk chrpath wget cpio texinfo lzop
sudo apt-get install python3-distutils
sudo apt install swig
sudo apt install python-dev
sudo apt install python3-dev
sudo apt-get install libssl-dev
安装完上面那些软件包后就可以编译uboot和kernel了!!
|