Chinaunix首页 | 论坛 | 博客
  • 博客访问: 90032
  • 博文数量: 27
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-15 10:29
个人简介

博客有点慢

文章分类

全部博文(27)

文章存档

2020年(2)

2018年(1)

2017年(15)

2016年(9)

分类: 嵌入式

2016-12-20 13:26:37

一、中文环境设置
1. 设置 ubuntu 中文现实
点击最上面菜单 的 系统 -> 系统管理 -> 语言支持(英文菜单则是 System -> Administration ->
Language Support),在列表中选择 Chinese 条目。同时将默认语言修改为 Chinese(中国) ,按确定
关闭设置程序。
2. 配置字体
    sudo fontconfig-voodoo -f -s zh_CN
3. 安装 fcitx 输入法
    sudo apt-get install im-switch libapt-pkg-perl fcitx
    sudo im-switch -s fcitx
4. PDF 浏览器
    sudo apt-get install acroread
二、ubuntu 开发环境设置
      ubuntu
1. 安裝 C/C++的 Man 手冊,。
    sudo apt-get install manpages-dev
2. 安裝 gcc,g++,make
    sudo apt-get install build-essential
3. 安裝头文件和库
    sudo apt-get install libc6-dev libstdc++6-4.0-dev
4. 安装 libncurses5-dev
    sudo apt-get install libncurses5-dev
5. 安装 gdb 调试器
    sudo apt-get install gdb
6. 安装安装图形界面 ddd 调试器
    sudo apt-get install ddd
7. 安装 automake 工具
    sudo apt-get install automake
    sudo apt-get install autoconf
    sudo apt-get install autogen
*autoconf 是一个用于生成可以自动地配置软件源代码包以适应多种 UNIX 类系统的 shell 脚本的工
具。
*automake 是一个从文件 Makefile.am 自动生成 Makefile.in 的工具。
8. 安装 indent
    sudo apt-get install indent
    调整 C 原始代码文件的格式。
    sudo apt-get install libtool
    GNU libtool 是一个通用库支持脚本,将使用动态库的复杂性隐藏在统一、可移植的接口中。
9. 安装文档
    sudo apt-get install binutils-doc cpp-doc gcc-4.0-doc gcc-doc glibc-doc libstdc++6-4.0-doc stl-manual
cpp-4.0-doc
10. 安装编辑器
    sudo apt-get install emacs21
三、ubuntu 文件共享、传输设置
      ubuntu
1. 配置 tftp
(1)安装程序
    sudo apt-get install tftp tftpd
       前者是客户端,后者是服务程序。
tftp 是要 inetd 来控制的, ubuntu 或 debian 类的系统,默认是没有安装 inetd 的,安装如下:
    sudo apt-get install netkit-inetd
(2)在/目录下建一个 tftpboot, 把属性改成 777。
    cd /
    sudo mkdir tftpboot
    sudo chmod 777 tftpboot
(3)修改/etc/inetd.conf
    tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
(4)重新加载 inetd 进程
    sudo /etc/init.d/inetd reload
(5)测试
    在/tftpboot 文件夹下新建立一个文件
    touch aaa
    进入用户文件夹
    cd /home/user1/
    tftp localhost
    tftp> get aaa
2. 配置 Samba
(1)安装 samba
   sudo apt-get install samba
(2)创建和配置共享文件夹
   mkdir /home/user1/share
   chmod 777 /home/ user1/share
(3)备份并编辑 smb.conf 允许网络用户访问
   sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
   sudo gedit /etc/samba/smb.conf
找到
   ; security = user
替换为
   # security = user
   security = user
   username map = /etc/samba/smbusers
找到
   workgroup = MSHOME
替换为
   workgroup = WORKGROUP
   display charset = UTF-8
   unix charset = UTF-8
   dos charset = cp936
在最后添加:
   [winshare]
   comment = Shared Folder with username and password
   path = /home/user1/share
   public = yes
   writable = yes
   valid users = network
   create mask = 0700
   directory mask = 0700
   force user = nobody
   force group = nogroup
   available = yes
   browseable = yes
(4)添加 network 这个网络访问帐户
代码:
   sudo useradd network
   sudo smbpasswd -a network
   sudo gedit /etc/samba/smbusers
添加:
   system_username = “shijian”
   network = "network"
(5)重启 samba
   sudo /etc/init.d/samba restart
这样就可以在其他 windows PC 下访问本机 ubuntu 的共享
(6)ubuntu 访问其他 windows 的方法
使用快捷键 ALT+F2.
输入"smb://IP 地址",回车
3. 配置 NFS
(1)安装 NFS
Debian/Ubuntu 上默认是没有安装 NFS 服务器的,首先要安装 NFS 服务程序:
   sudo apt-get install nfs-kernel-server
(安装 nfs-kernel-server 时,apt 会自动安装 nfs-common 和 portmap)
(2)配置/etc/exports
NFS 挂载目录及权限由/etc/exports 文件定义
将/armsys2440/root 目录让 192.168.0.*的 IP 共享, 则在该文件末尾添加下列语句:
   /armsys2440/root 192.168.2.*(rw,sync,no_root_squash)
或者:
   /armsys2440/root 192.168.0.0/24(rw,sync,no_root_squash)
运行
   sudo exportfs -r
更新
运行
   sudo /etc/init.d/nfs-kernel-server restart
重启 nfs 服务
(3)测试 NFS
可以尝试一下挂载本地磁盘(假设本地主机 IP 地址为:192.168.0.1,将/home/zp/share 挂载到/mnt)
   sudo mount -t nfs 192.168.0.1: /armsys2440/root /mnt
运行 $ df 看看结果
   sudo umount /mnt
可以使用一定的参数:
   mount -o nolock,rsize=1024,wsize=1024,timeo=15 192.168.2.130:/tmp/ /tmp/
(4)客户端挂载远程共享
   mount -t nfs 192.168.0.***:/home/***/share /mnt/share
4. 配置 minicom
安装 minicom
   sudo apt-get install minicom
四、交叉编译环境设置
安装交叉编译器
   sudo mkdir /us r/local/arm
   cd /user/local/arm
   sudo tar zxvf /home/usr/arm-linux-toolchains.tgz
请在执行完成后查看是否存在/usr/local/arm 文件夹。
把交叉编译器的路径加入到 PATH,以方便使用:
   sudo vi /etc/bash_bashrc
加入如下代码:
   if [ -d /usr/local/arm ] ; then
   PATH=/usr/local/arm/2.95.3/bin:"${PATH}"
   fi
五、uboot
      uboot
      uboot,内核,文件系统
   1. uboot 编译
建立 armsys2440 目录,将光盘中的 Linux / u-boot / uboot.tar.gz 拷贝到 armsys2440 下,并解压缩:
   cd /armsys2440
   tar xvzf uboot.tar.gz
得到 uboot 目录,如果你需要编译它,按照以下步骤:
   cd uboot
   make distclean
   make smdk2440_config
   make
    2. 内核编译
(1)解压
   cd armsys2440
   tar xzvf /mnt/cdrom/linux/kernel/kernel-armsys2440-xxxxxx.tgz
(2)配置
命令行如下:
   cd /armsys2440/kernel2440
   make menuconfig
(3)编译
命令行如下:
   make clean
   make dep
   make zImage
编译结束后将在 kernel/arch/arm/boot 和/tftpboot 目录下得到 linux 内核压缩映像文件:zImage。
 3.文件系统
新建/armsys2440/root 目录,将光盘中 Linux/rootfilesystem/ root_armsys2440_0.1_yaffs.tgz 压缩文件拷
贝到这个目录下,然后再解压缩,得到根文件系统所需要目录。将 root_armsys2440_0.1.tgz 压缩文件
更名为 root_armsys.tgz。

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