开发环境:
ubuntu-14.04.1-desktop-i386
VMware-workstation-full-10.0.2-1744117.1398244508.exe
lsb_release -a 查看ubuntu版本
ctrl+alt+a 打开控制台
du -sh 文件/文件夹 查看文件或文件夹的大小
su 或 su root 都是切换到root账户
su 普通用户 切换到普通用户
sudo passwd root 普通用户给root用户设置密码
ln -s /mnt/hgfs/shareDir/ /root/shareDir 建立超链接符号,对root下的shareDir操作就是对/mnt/hgfs/shareDir/操作
apt-get install vim 安装vim
sudo apt-get install tftp-hpa tftpd-hpa 安装tftp,tftp-hpa是客户端,tftpd-hpa是服务程序
安装客户端时,或许会报unable to fetch some archives, maybe run apt-get update or try with --fix-mi
解决办法
sudo vim /etc/resolv.conf 添加nameserver 8.8.8.8
vi /etc/apt/sources.list 将
http://us.archive.ubuntu.com/ubuntu/
替换成
http://mirrors.aliyun.com/ubuntu
再执行一下 sudo apt-get update
这时候再安装tftp客户端sudo apt-get install tftp-hpa
注意:tftp客户端机器只执行sudo apt-get install tftp-hpa就行
然后客户端机子上 tftp 服务器所在机子的ip 进入tftp命令行
输入 get 文件名 就可以从服务器拉取资源
1 chmod 777 /tftpboot 为tftpboot目录赋予最高权限
2 vi /etc/xinetd.conf 这个配置文件基本不用动
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info
}
includedir /etc/xinetd.d
~
3 vim /etc/default/tftpd-hpa 配置服务
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="-l -c -s"
4 重启一下服务
sudo service tftpd-hpa restart
5 vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
wait = yes
disable = no
user = root
protocol = udp
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
#log_on_success += PID HOST DURATION
#log_on_failure += HOST
per_source = 11
cps =100 2
flags =IPv4
}
6 执行下面操作
sudo /etc/init.d/xinetd reload
sudo /etc/init.d/xinetd restart
经过上面的步骤,已经安装好了tftp,下面就可以测试一下:
在客户端随便进入一个文件夹 , 输入 tftp serverIP
然后敲 ? 查看tftp命令
get 文件名 就可以将tftp服务器上的文件拉取下来
安装nfs
mount -t nfs -o nolock localhost:/root/rootfs /mnt/
如果出现下面的错误,则执行chmod 777 /root
mount.nfs: access denied by server while mounting localhost:/root/rootfs
到此,nfs搭建完毕
SSH
sudo apt-get install ssh
安装报如下错误:
root@ubuntu:/home/xuhaitao# sudo apt-get install ssh
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ssh : Depends: openssh-server (>= 1:6.6p1-2ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
如果openssh-server没有启动,可以使用下面命令去启动:
sudo apt-get install openssh-client=1:6.6p1-2ubuntu1
sudo apt-get install openssh-server
如果openssh-server没有启动,可以使用下面命令去启动:
sudo /etc/init.d/ssh start
ps -ef|grep ssh查看ssh
root@ubuntu:/home/xuhaitao# ps -ef|grep ssh
root 1070 1 0 20:01 ? 00:00:00 /usr/sbin/sshd -D
xuhaitao 2203 2135 0 20:03 ? 00:00:00 ssh-agent
root 2815 1070 0 20:07 ? 00:00:00 sshd: xuhaitao [priv]
xuhaitao 2852 2815 0 20:08 ? 00:00:00 sshd: xuhaitao@pts/0
root 2934 2903 0 20:17 pts/0 00:00:00 grep --color=auto ssh
ubuntu中配置静态IP
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
重启网络:
sudo ifconfig eth0 down
sudo ifconfig eth0 up
交叉编译链:
1 将交叉编译链的压缩包拷贝到 和虚拟机共享的windows目录,然后再使用cp命令拷贝到/usr/local下解压
2 配置环境变量
vi ~/.bashrc
在尾部添加
export PATH=/usr/local/arm-2009q3/bin:$PATH
然后执行如下命令,立即生效
source ~/.bashrc