2.11.1、移植前的准备工作
2.11.1.1、三星移植过的uboot源代码准备
2.11.1.2、SourceInsight准备
2.11.1.3、便捷的文件传输工具sshsecureshell
2.11.2、ubuntu14.04上网及安装openssh
2.11.2.1、ubuntu14.04上网问题
第一:选择NAT方式
第二:配置/etc/network/inerfaces文件中使用dhcp方式
root@xfj-virtual-machine:/etc/network# pwd
/etc/network
root@xfj-virtual-machine:/etc/network# ls
if-down.d if-post-down.d if-pre-up.d if-up.d interfaces interfaces.d
//内容
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo //开机自动激lo接口
iface lo inet loopback //配置lo接口为环回口
auto ens32 //开机自动激活ens32接口
iface ens32 inet dhcp //配置eth0接口为动态设置IP地址
address 192.168.1.141
netmask 255.255.255.0
第三:
然后重启网卡,确认ip地址得到后即可上网。
ifconfig ens32 down关闭网卡
ifconfig ens32 up开启网卡
//重启网卡
root@xfj-virtual-machine:/etc/network# ifconfig ens32 down
root@xfj-virtual-machine:/etc/network# ifconfig ens32 up;
//确认是否能够上网
root@xfj-virtual-machine:/etc/network# ping ww.baidu.com
PING ps_other.a.shifen.com (110.242.68.66) 56(84) bytes of data.
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=1 ttl=128 time=50.6 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=2 ttl=128 time=51.0 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=3 ttl=128 time=50.8 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=4 ttl=128 time=51.0 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=6 ttl=128 time=50.7 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=7 ttl=128 time=51.2 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=8 ttl=128 time=50.9 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=9 ttl=128 time=51.2 ms
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=10 ttl=128 time=50.9 ms
//能够上网
第五:查看NAT时候的动态IP地址
root@xfj-virtual-machine:/etc/network# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.193.128 netmask 255.255.255.0 broadcast 192.168.193.255
ether 00:0c:29:cf:47:ba txqueuelen 1000 (以太网)
RX packets 18139 bytes 17972689 (17.9 MB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 5399 bytes 436515 (436.5 KB)
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 (本地环回)
RX packets 597 bytes 44208 (44.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 597 bytes 44208 (44.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
第一:选择桥接方式
第二:配置桥接到无线网卡(如果主机windows是通过有线上网的,则桥接到有线网卡);
第三:配置/etc/network/inerfaces文件中使用dhcp方式;
root@xfj-virtual-machine:/etc/network# pwd
/etc/network
root@xfj-virtual-machine:/etc/network# ls
if-down.d if-post-down.d if-pre-up.d if-up.d interfaces interfaces.d
//内容
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo //开机自动激lo接口
iface lo inet loopback //配置lo接口为环回口
auto ens32 //开机自动激活ens32接口
iface ens32 inet dhcp //配置eth0接口为动态设置IP地址
address 192.168.1.141
netmask 255.255.255.0
第四:
然后重启网卡,确认ip地址得到后即可上网。
ifconfig ens32 down关闭网卡
ifconfig ens32 up开启网卡
//重启网卡
root@xfj-virtual-machine:/etc/network# ifconfig ens32 down
root@xfj-virtual-machine:/etc/network# ifconfig ens32 up;
//确认是否能够上网
root@xfj-virtual-machine:/etc/network# ping www.baidu.com
PING www.a.shifen.com (182.61.200.7) 56(84) bytes of data.
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=1 ttl=48 time=27.6 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=2 ttl=48 time=27.7 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=3 ttl=48 time=27.7 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=4 ttl=48 time=29.1 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=5 ttl=48 time=27.6 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=6 ttl=48 time=27.7 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=7 ttl=48 time=27.6 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=8 ttl=48 time=27.8 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=9 ttl=48 time=27.6 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=10 ttl=48 time=27.8 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=11 ttl=48 time=27.5 ms
//能够上网
第五:查看桥接时候的动态IP地址
root@xfj-virtual-machine:/etc/network# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.196 netmask 255.255.255.0 broadcast 192.168.3.255
ether 00:0c:29:cf:47:ba txqueuelen 1000 (以太网)
RX packets 17987 bytes 17945881 (17.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5320 bytes 426753 (426.7 KB)
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 (本地环回)
RX packets 546 bytes 40771 (40.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 546 bytes 40771 (40.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
前提: 开发板和电脑之间通过网线连接好
第一:选择桥接方式
第二:配置桥接到有线网卡(如果配置为自动或者配置桥接到无线网卡则肯定无法ping通开发板);
第三:配置/etc/network/inerfaces文件中使用static方式,ip地址配置保证和主机windows、开发板三者处于同一网段;
//设置虚拟机IP地址为192.168.1.141(静态IP地址),网络掩码255.255.255.0
root@xfj-virtual-machine:/etc/network# pwd
/etc/network
root@xfj-virtual-machine:/etc/network# ls
if-down.d if-post-down.d if-pre-up.d if-up.d interfaces interfaces.d
root@xfj-virtual-machine:/etc/network# vim interfaces
//内容
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens32
iface ens32 inet static
address 192.168.1.141
netmask 255.255.255.0
//重新启动ubuntu
root@xfj-virtual-machine:/etc/network# reboot
//查看静态IP地址
root@xfj-virtual-machine:/etc/network# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.141 netmask 255.255.255.0 broadcast 192.168.1.255 //由此可以看出,已经设置好
inet6 fe80::20c:29ff:fecf:47ba prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:cf:47:ba txqueuelen 1000 (以太网)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 61 bytes 7013 (7.0 KB)
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 (本地环回)
RX packets 393 bytes 25281 (25.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 393 bytes 25281 (25.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
//设置电脑IP地址:192.168.1.10,网络掩码:255.255.255.0
//设置开发板IP地址:192.168.1.20,网络掩码:255.255.255.0
x210 # print
mtdpart=80000 400000 3000000
baudrate=115200
ethaddr=00:40:5c:26:0a:5b
bootargs=console=ttySAC2,115200 root=/dev/mmcblk0p2 rw init=/linuxrc rootfstype=ext3
bootcmd=movi read kernel 30008000; bootm 30008000
filesize=37B800
fileaddr=30000000
gatewayip=192.168.1.1 //网关
netmask=255.255.255.0 //网络掩码
ipaddr=192.168.1.20 //IP地址
serverip=192.168.1.141 //服务器地址
bootdelay=10
此处bug要特别注意,不然有可能不会成功。
2.11.2.2、搭建openssh环境
(1)安装ssh-server。(sudo apt-get install openssh-server)如果报错提示依赖错误。可以参考http://www.cnblogs.com/mliudong/p/4094519.html
xfj@xfj-virtual-machine:~$ sudo apt-get install openssh-server
//.确认sshserver是否安装好,如果看到sshd那说明ssh-server已经启动了
xfj@xfj-virtual-machine:~$ ps -e | grep sshd
3486 ? 00:00:00 sshd
//安装ssh-client
xfj@xfj-virtual-machine:~$ sudo apt-get install openssh-client
(2)securecrt登录
连接
New Session(SSH2)
下一步: