ubuntu-12.04嵌入式开发环境搭建

ubuntu12.04嵌入式开发环境搭建(各种问题、各种配置)

  • 先安装ubuntu-16.04  ***
  • 想使用root用户登陆的,操作如下

给root用户设定一个密码

[email protected]:~# sudo passwd root
  • 配置apt源(163的源要快一些)

[email protected]:~# gedit /etc/apt/sources.list

 将sources.list文件的内容替换为


#LUPA
deb http://mirror.lupaworld.com/ubuntu/ maverick main restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick main restricted

deb http://mirror.lupaworld.com/ubuntu/ maverick-updates main restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates main restricted

deb http://mirror.lupaworld.com/ubuntu/ maverick universe
deb-src http://mirror.lupaworld.com/ubuntu/ maverick universe
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates universe
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates universe

deb http://mirror.lupaworld.com/ubuntu/ maverick multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick multiverse
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates multiverse

deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://extras.ubuntu.com/ubuntu maverick main
deb http://mirror.lupaworld.com/ubuntu/ maverick-security main restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security main restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-security universe
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security universe
deb http://mirror.lupaworld.com/ubuntu/ maverick-security multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security multiverse更新源
[email protected]:~# apt-get update
  • 更新源

[email protected]:~# apt-get update
  •  更新系统所有软件***
[email protected]:~# apt-get upgrade
  •  解决root用户登陆没声音的问题

System->Preferences -> Startup Applications

单击Add,填写如下

Name: Pulseaudio daemon

Command: /usr/bin/pulseaudio

Comment: start the sound daemon

 

  • 使用中文输入法

System->Preferences->Keyboard Input Methods

Input Method->Chinese->拼pinyin,Add

默认情况下,ubuntu-10.10不会开机自启动ibus,解决如下

System ->Preferences->Startup Applications

Click the button: Add

Name: ibus daemon

Command: /usr/bin/ibus-daemon -d

Comment: start ibus daemon when gnome start

  •  安装VMware Tools***

VM->Install VMware Tools

[email protected]:~# cp /media/VMware\ Tools/VMwareTools-8.8.4-743747.tar.gz
[email protected]:chmod 777 VMwareTools-8.8.4-743747.tar.gz
chmod –R 777 FILES
[email protected]:~# tar -zxvf VMwareTools-8.8.4-743747.tar.gz
[email protected]:~# cd vmware-tools-distrib/
[email protected]:~/vmware-tools-distrib# ./vmware-install.pl
接下来一路yes和回车直到安装完毕。
  • 删除无用的文件
[email protected]:~# rm -rf VMwareTools-8.8.4-743747.tar.gz vmware-tools-distrib/
  • 重启系统

reboot
  •  设置windows与ubuntu共享目录**

Vmware Workstation菜单vm->settings

Options->shared folderss

Always enabled

Add->next

Browse选择你要共享的windows目录

Next->finsh

Ubuntu的/mnt/hgfs/目录就会出现windows共享的目录(若不成功重装VMTools)

  • 安装vim
[email protected]:~# apt-get install vim
  • 添加vim配置文件

[email protected]:~# vi /etc/vim/vimrc.local

在最后添加

set nu        "显示行号"

set tabstop=4  "制表符宽度"

set cindent       "C/C++语言的自动缩进方式"

set shiftwidth=4  "C/C++语言的自动缩进宽度"

  • 安装ia32-libs(在64位ubuntu上运行32位arm-linux需要安装ia32-libs)
[email protected]:~# apt-get install ia32-libs
  • 安装命令tree (list contents of directories in a tree-like format.)
[email protected]:~# apt-get install tree
  • 安装命令chkconfig (enable or disable system services)
[email protected]:~# apt-get install chkconfig
  • 查看系统服务

[email protected]:~# chkconfig --list

acpi-support              0:off  1:off  2:on   3:on   4:on   5:on   6:off

acpid                     0:off  1:off  2:off  3:off  4:off  5:off  6:off

alsa-mixer-save           0:off  1:off  2:off  3:off  4:off  5:off  6:off

anacron                   0:off  1:off  2:off  3:off  4:off  5:off  6:off

on表示在对应的启动级别开机自启动

  • 安装patch命令
[email protected]:~# apt-get install patch
  • 安装curl命令
[email protected]:~# apt-get install curl
  • 安装git
[email protected]:~# apt-get install git
  • 安装gettext
[email protected]:~# apt-get install gettext
  • 安装gtk
[email protected]:~# apt-get install libgtk2.0-dev
  • 安装GIMP
[email protected]:~# apt-get install gimp
  • 安装minicom
[email protected]:~# apt-get install minicom
  • 安装tftp**
[email protected]:~# apt-get install tftp-hpa tftpd-hpa xinetd

(tftpd为服务器端)

修改配置文件

[email protected]:~# vi /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"

TFTP_DIRECTORY="/home/tftpboot"

TFTP_ADDRESS="0.0.0.0:69"

TFTP_OPTIONS="-l -c -s"

TFTP_DIRECTORY指定tftp-server的根目录,参数-c指定了可以创建文件

 

  • 设置创建/tftpboot并设置权限

[email protected]:~# chmod 777 /tftpboot/

[email protected]:~# service tftpd-hpa start       #启动tftp服务

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
  • 安装vsftpd让Windows下的cuteftp访问linux
[email protected]:~# apt-get install vsftpd
  • 安装nfs**
[email protected]:~# apt-get install nfs-kernel-server
  • 修改配置文件

[email protected]:~# vi /etc/exports


/home/work/rootfs       *(rw,sync,no_root_squash)

/root/stb/app/V4.0/buildsys *(rw,sync,no_root_squash)

说明:

rw:allow both read and write requests on this NFS volume. The default is to disallow any request which changes the filesystem. This can also be made explicit by using the ro option.

sync:reply to requests only after the changes have been committed to stable storage (see async above).

no_root_squash:turn off root squashing. This option is mainly useful for diskless clients.

  • 安装samba
[email protected]:~# apt-get install samba
  • 配置samba

[email protected]:~# vi /etc/samba/smb.conf


在最后添加

 [home]

    path = /home

    browseable = yes

    writeable = yes

    valid user = root

 

  • 添加samba用户并设置密码

[email protected]:~# smbpasswd -a root

Windows访问ubuntu的/home

Win键+r打开运行对话框

输入\\192.168.80.128,回车

192.168.80.128为ubuntu的IP地址,然后输入用户名和密码

 

ubuntu12.04嵌入式开发环境搭建(各种问题、各种配置)

  • 使用SecureCRT通过ssh登陆ubuntu   ****

首先在ubuntu上安装ssh

[email protected]:~# apt-get install openssh-server

安装完毕后,ssh已配置为开机自启动

重启ubuntu,就能使用SecureCRT通过ssh登陆ubuntu了。

打开SecureCRT,选择Quick Connect,Hostname输入ubuntu的IP地址,Username  输入root,点击connect,等一下提示输入密码,输入密码点击OK

ubuntu12.04嵌入式开发环境搭建(各种问题、各种配置)

  • 安装基本的开发环境
[email protected]:~# apt-get install build-essential
  • 安装语法、词法分析器
[email protected]:~# apt-get install bison flex
  • 安装安装pthread函数手册
[email protected]:~# apt-get install manpages-posix manpages-posix-dev
  • 安装图片处理库
[email protected]:~# apt-get install libjpeg8 libjpeg8-dev
  • 安装eclipse开发java和C/C++

所需包及下载地址

jdk-7u5-linux-i586.tar.gz

eclipse-java-helios-SR2-linux-gtk.tar.gz

cdt-master-7.0.2.zip (用于开发C/C++的插件)

1、安装jdk

解压jdk包

[email protected]:/mnt/hgfs/F/software/jdk# tar -zxvf jdk-7u5-linux-i586.tar.gz -C /opt/

配置环境变量

[email protected]:/mnt/hgfs/F/software/jdk# vi /etc/profile


在最后添加

export PATH=/opt/jdk1.7.0_05/bin:$PATH

使配置生效

[email protected]:/mnt/hgfs/F/software/jdk# . /etc/profile

查看jdk版本

[email protected]:/mnt/hgfs/F/software/jdk# java -version

java version "1.7.0_05"

Java(TM) SE Runtime Environment (build 1.7.0_05-b06)

Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode)

2、安装eclipse

解压eclipse包

[email protected]:/home/workspace# tar zxvf eclipse-java-helios-SR2-linux-gtk.tar.gz -C /opt/

创建桌面快捷方式

[email protected]:/home/workspace# ln -s /opt/eclipse/eclipse /root/Desktop/eclipse

重启ubuntu,此时可以用eclipse开发java了。

3、安装cdt插件

将cdt-master-7.0.2.zip复制到一个空目录,进入该目录

[email protected]:/home/cdt# unzip cdt-master-7.0.2.zip

解压后将看到features  plugins两个目录,将这两个目录里的所有内容复制到/opt/eclipse目录下对应的目录里

[email protected]:/home/cdt# cp features/* /opt/eclipse/features/

[email protected]:/home/cdt# cp plugins/* /opt/eclipse/plugins/

此时就可以用eclipse开发C/C++了。

  • 解决配置内核make menuconfig出现的问题

'make menuconfig' requires the ncurses libraries

[email protected]:/home/workspace/linux-2.6.35.13# apt-get install libncurses5-dev
  • 安装wireshark
[email protected]:~# apt-get install wireshark
  • 安装数据库sqlite
[email protected]:~# apt-get install sqlite3
  • 安装制作jffs2根文件系统的工具
[email protected]:~# apt-get install mtd-utils

 

相关文章: