) Build an embedded development environment in Ubuntu

Source: Internet
Author: User

Conversion from http://www.yuanma.org/data/2007/0614/article_2677.htm)

Ubuntu Installation

Start and install Ubuntu

1. download the following two projects:
Boot package:Http://ftp.ubuntu.org.cn/gnix_oag/boot_livecd_from_hd/edgy/6.10/bhd_i386_2.6.17-10g.tar.gz
Corresponding CD:Http://releases.ubuntu.com/edgy/ubuntu-6.10-desktop-i386.iso

 

1. Build a common environment

See quick Setup Guide (edgy 6.10)

1. Modify the source
Sudo CP/etc/APT/sources. LIST/etc/APT/sources. list_backup
Sudo gedit/etc/APT/sources. List
# Replace the file content:
DebHttp://ubuntu.cn99.com/ubuntu/Edgy main restricted universe multiverse
DebHttp://ubuntu.cn99.com/ubuntu/Edgy-security main restricted universe multiverse
DebHttp://ubuntu.cn99.com/ubuntu/Edgy-Updates main restricted universe multiverse
DebHttp://ubuntu.cn99.com/ubuntu/Edgy-proposed main restricted universe multiverse
DebHttp://ubuntu.cn99.com/ubuntu/Edgy-backports main restricted universe multiverse
Deb-SrcHttp://ubuntu.cn99.com/ubuntu/Edgy main restricted universe multiverse
Deb-SrcHttp://ubuntu.cn99.com/ubuntu/Edgy-security main restricted universe multiverse
Deb-SrcHttp://ubuntu.cn99.com/ubuntu/Edgy-Updates main restricted universe multiverse
Deb-SrcHttp://ubuntu.cn99.com/ubuntu/Edgy-proposed main restricted universe multiverse
Deb-SrcHttp://ubuntu.cn99.com/ubuntu/Edgy-backports main restricted universe multiverse
DebHttp://ubuntu.cn99.com/ubuntu-cn/Edgy main restricted universe multiverse

# Save the edited file and run the following command to update the file.
Sudo apt-Get update
Sudo apt-Get dist-Upgrade

2. Set the Chinese support environment
Choose system> System Management> language support from the top menu. [for the English menu, check the Chinese entries in the system> Administration> language support] list. At the same time, change the default language to Chinese, and close the setup program as per your needs.

Configure the font
Sudo fontconfig-voodoo-F-s zh_cn

3. Install the fcitx Input Method
Sudo apt-Get install im-switch libapt-PKG-perl fcitx
Sudo im-switch-s fcitx

4. Install the latest wenquanyi font
Sudo apt-Get install xfonts-wqy

5. Install the Java environment
Sudo apt-Get install sun-java5-jdk

Set the current default Java interpreter
Sudo Update-alternatives -- config Java
The following figure is displayed after execution:
There are 4 alternatives which provide 'java '.
Selection alternative
-----------------------------------------------
* + 1/usr/lib/JVM/Java-gcj/JRE/bin/Java
2/usr/bin/gij-wrapper-4.1
3/usr/bin/gij-wrapper-4.0
4/usr/lib/JVM/Java-1.5.0-sun/JRE/bin/Java
Press enter to keep the default [*], or type selection Number:
Enter the number before the row containing "Sun. As shown above, enter 4 and press enter to confirm.

6. Install the English-Chinese dictionary
If [Y/n] or [Y/n] is required, enter y and press Enter.
Sudo apt-Get install stardict-common stardict-cdict-GB stardict-cedict-GB stardict-hanzim stardict-langdao-Ce-GB stardict-langdao-EC-GB stardict-Oxford- GB stardict-xdict-Ce-GB stardict-xdict-EC-GB

7. Install Flash Support for browsers
Sudo apt-Get install flashplugin-nonfree

8 Tib Browser
Sudo apt-Get install multicast read

 

2. Build a development environment in Ubuntu

1. Install the man manual of C/C ++. In this way, you can view the prototype of the function that you are not familiar with at some time, such as the detailed data description; you can also see some specific descriptions of the include statement case.
Sudo apt-Get install manpages-Dev

2. Install GCC, G ++, make, etc.
Sudo apt-Get install build-essential

3. Server guard header files and libraries
Sudo apt-Get install libc6-dev libstdc ++ 6-4.0-dev

4 install libncurses5-dev
Sudo apt-Get install libncurses5-dev

5. Install the gdb debugger.
Sudo apt-Get install GDB

6 install and install the graphical interface DDD Debugger
Sudo apt-Get install ddd

7. Install the automake Tool
Sudo apt-Get install automake
Sudo apt-Get install Autoconf
Sudo apt-Get install autogen

Autoconf is a tool used to generate shell scripts that can automatically configure software source code packages to adapt to a variety of UNIX systems.
Automake is a tool that automatically generates makefile. In from the makefile. Am file.

8. Install indent
Sudo apt-Get install indent: Adjust the format of the original C code file.

Sudo apt-Get install libtool
GNU libtool is a common library supporting scripts that hides the complexity of dynamic libraries in a unified and portable interface.

9 installation document
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 install the editor
Sudo apt-Get install emacs21

11 reinstall make
A. Modify the update source.
Change the source version to breezy (5.10 ).
Apt-Get update
B apt-Get remove make
Apt-Get install make

12. Install the TFTP Server
Apt-Get install tftpd-hpa tftp-HPA
Gedit/etc/default/tftpd-hap
/*************************************** ************
Install tftpd-HPA and tftpd-HPA
Configure/etc/default/tftpd-hPa.
# Defaults for tftpd-HPA
Run_daemon = "yes"
Options = "-l-S/home/ttk/tftpboot"
**************************************** ***********/

13 install the gvim Editor
Apt-Get install vim-GTK
Under the colon command line:
Set encoding = UTF-8; set the editing font to UTF-8.
Gvim/etc/Vim/. vimrc
/*************************************** **********************
The following is a. vimrc file with basic configuration. Note the behavior comments starting.
"Display the row number before the row. Use" set Nonu "to disable the display"
Set nu
"Enable syntax highlighting
Syntax on

"Enable indent based on file type
Filetype indent on
Set autoindent

"Some sizes are ignored during search.
Set IC

"Search for text highlighting
Set HLS

"Wrap text instead of being on one line
Set LBR

"Change the default color scheme to Delek
Colorscheme Delek
**************************************** *************/

 

 

3. Configure NFS sharing (sharing between Linux instances)

1. Install NFS
By default, the NFS server is not installed on Debian/ubuntu. First, install the NFS service program:
$ Sudo apt-Get install nfs-kernel-Server
(When nfs-kernel-server is installed, APT will automatically install nfs-common and Portmap)

2 Configure/etc/exports
The NFS mount directory and permissions are defined by the/etc/exports file.
Share the IP address of 192.168.2. * In the/home/ZP/share directory in my home directory, add the following statement at the end of the file:
/Home/ZP/share 192.168.2. * (RW, sync, no_root_squash)
Or:/home/ZP/share 192.168.2.0/24 (RW, sync, no_root_squash)
Run $ sudo exportfs-r update

3. run $ sudo/etc/init. d/nfs-kernel-server restart to restart the NFS service.

4. Test NFS
Try mounting the local disk (assuming the IP address of the local host is 192.128.2.1, Mount/home/ZP/share to/mnt)
$ Sudo Mount-t nfs 192.168.2.1:/home/ZP/share/mnt
Run $ DF to check the result
$ Sudo umount/mnt
Some parameters can be used:
Mount-O nolock, rsize = 1024, wsize = 1024, timeo = 15 192.168.2.130:/tmp/

5. Remote sharing is mounted on the client.
Mount-t nfs 192.168.0. ***:/home/***/share/mnt/share

 

Sharing between Windows and Linux-samba

1. Install samba
Sudo apt-Get install samba

2. Create and configure Shared Folders
Mkdir/home/***/share
Chmod 777/home/***/share

Back up and edit smb. conf to allow network users to access
Sudo CP/etc/samba/smb. conf/etc/samba/smb. conf_backup
Sudo gedit/etc/samba/smb. conf

Find
; Security = user
Replace
# SECURITY = user
Security = user
Username map =/etc/samba/smbusers
 
Find
Workgroup = mshome
Replace
Workgroup = workgroup
Displays charset = UTF-8
UNIX charset = UTF-8
DOS charset = cp936

Add at the end:

[Winshare]
Comment = shared folder with username and password
Path =/home/Shijian/winshare
Public = Yes
Writable = Yes
Valid users = Network
Create mask = 0700
Directory mask = 0700
Force user = nobody
Force Group = nogroup
Available = Yes
Browseable = Yes

4. Add the network access account
Code:
Sudo useradd Network
Sudo smbpasswd-a network
Sudo gedit/etc/samba/smbusers
Add:
System_username = "Shijian"
Network = "network"

5 restart samba
Sudo/etc/init. d/samba restart

In this way, you can access the local Ubuntu sharing in other Windows PCs.

6. access other windows through Ubuntu
Use the shortcut key Alt + F2.
Enter "SMB: // ip address", and press ENTER
Windows Access successful

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.