Chinaunix首页 | 论坛 | 博客
  • 博客访问: 289611
  • 博文数量: 61
  • 博客积分: 1581
  • 博客等级: 上尉
  • 技术积分: 741
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-24 13:52
个人简介

幸运儿不是我,因为我选择的路很难走.如果够出色也不能出头,至少要做到没第二个我.

文章分类

全部博文(61)

文章存档

2013年(14)

2012年(47)

分类: LINUX

2012-10-24 14:46:02

 ubuntu 10.04 安装好后必须要做的事(嵌入式开发) 收藏
【1】开启超级用户

sudo passwd root 回车,输入密码。

登陆root用户:su 接着输入密码

【2】安装vim :
apt-get install vim

设置vim的自动缩进,tab四格和显示行号:
vim /etc/vimrc   或 vim /etc/vim/vimrc (10.04)
在最下面加入:

set number
set tabstop=4

如果在vimrc文件里已经有了 set ai 只是被用双引号注释掉了,那么就把双引号拿掉就好了如果没有set ai,那么加在最下面。


【3】开启TFTP服务器(10.04)

1.安装
sudo apt-get install tftpd-hpa tftp-hpa xinetd
在根目录下新建文件夹/tftpboot 并修改权限
sudo mkdir tftpboot
sudo chmod 777 tftpboot

2.配置
tftp-hpa 的配置文件為 /etc/default/tftpd-hpa

sudo gedit /etc/default/tftpd-hpa

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot" //这里是你的tftpd-hpa的服务目录
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"        //这里是选项

3.启动服务
sudo service tftpd-hpa restart
4.test测试
cd /tftpboot
vim test.txt //随便输入一些东西
cd ~/
tftp localhost
get test.txt
最后看看当前目录有test.txt的文件不?
同理!把当前目录下的一个文件put xxxx.???,在去看看/tftpboot目录有xxxx.??这个文件不?

【4】开启NFS服务

系统平台:virtualbox3.2.10+Ubuntu 10.10

  安装nfs:

  #sudo apt-get install nfs-kernel-server

  Ubuntu 10.10中的已经是最新版本了,无需安装

  打开/etc/exports文件,在末尾加入:

  /home/henlin *(rw,sync,no_root_squash)

  注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义, 各字段含义如下:

  /home/henlin:要共享的目录

  * :允许所有的网段访问

  rw :读写权限

  sync:资料同步写入内在和硬盘

  no_root_squash:nfs客户端共享目录使用者权限

  重启服务:

  #sudo /etc/init.d/portmap restart <---重启portmap,很重要

  #sudo /etc/init.d/nfs-kernel-server restart <---重启nfs服务

  #showmount -e <---显示共享出的目录

  注:nfs是一个RPC程序,使用它前,需要映射好端口,通过portmap设定

  命令执行情况如下:

  xgc@xgc-VirtualBox:~$ sudo /etc/init.d/portmap restart

  Rather than invoking init scripts through /etc/init.d, use the service(8)

  utility, e.g. service portmap restart

  Since the script you are attempting to invoke has been converted to an

  Upstart job, you may also use the restart(8) utility, e.g. restart portmap

  portmap start/running, process 474

  xgc@xgc-VirtualBox:~$ sudo /etc/init.d/nfs-kernel-server restart

  * Stopping NFS kernel daemon [ OK ]

  * Unexporting directories for NFS kernel daemon... [ OK ]

  * Exporting directories for NFS kernel daemon...

  exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/xgc".

  Assuming default behaviour ('no_subtree_check').

  NOTE: this default has changed since nfs-utils version 1.0.x

  [ OK ]

  * Starting NFS kernel daemon [ OK ]

  xgc@xgc-VirtualBox:~$ showmount -e

  Export list for xgc-VirtualBox:

  /home/xgc *

  现在可以在本机上试一下:

  #sudo mount -t nfs localhost:/home/xgc /mnt

  注:localhost为本机linux的IP地址

  这样就把共享目录挂到了/mnt目录,取消挂载用:

  #sudo umount /mnt

  如果用在嵌入式设备上挂载,要加上参数-o nolock

【5】安装串口调试终端

1、安装
sudo apt-get install ckermit

2、用户要目录下配置 .kermrc
内容如下:
set line /dev/ttyUSB0
set speed 115200
set carrier-watch off
set handshake none
set flow-control none

说明:若用串口第一行为set line /dev/ttyS0 若用了USB转串口线,用当前配置就好。
3、测试
连接串口:kermit -c
Ctrl+\+c进入ckermit命令模式,可以随时更改传输协议
退出:ctrl+\+c 再按q

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ly61baby/archive/2010/08/03/5786033.aspx

阅读(1514) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~