虛擬機搭建LINUX的ARM軟件編譯環境

       經過利用近五天加班後回家的時間,在自己的筆記本上完成LINUX的ARM小系統開發環境的搭建。過程十分悲催,這裏簡單描述一下,加深自己印象同時也希望其他學習者少走點彎路。

主要完成的工作:1.安裝虛擬機,並在其上安裝ubuntu11.10。

                             2.在LINUX上安裝並配置SAMBA。

                             3.安裝交叉編譯器,更新源和LIB庫

 

                              

         鄙人在此過程中遇到許多問題,好在都一一克服。

     安裝虛擬機基本比較順利,就是先用虛擬光驅載入ubuntu的.ISO文件,然後用VM打開開始安裝,安裝完後發現停在命令行下,重啓後進入ubuntu的圖形界面。(這個地方裝了幾次,開始裝的9.10版本,考慮到BSP內核是3.0的,所以重新裝11.10,裝完發現整個屏幕是終端,哥要用圖形界面好不,比較傻,其實已經裝好,只要重啓,裝了幾次後。。)

   另外11.10版本的ubuntu終端好難找,在左上的黑色按鈕DASH HOME,在裏面輸入term會聯想到終端的應用程序。

 接下來是安裝SAMBA(芳鄰,中文名有些曖昧),開始在網上找安裝及配置方法,五花八門,自己隨便下了一個壓縮包,放到目錄下,要用到rpm命令,真是悲劇,系統居然沒這個命令,自己也不熟,後來乾脆直接用了sudo act get samba install,居然有就直接下載安裝了。在etc/samba目錄下有個sam.conf,進去後在結尾加上:

[global]
workgroup = LinuxSir
netbios name = LinuxSir05
server string = Linux Samba Server TestServer
security = share

[linuxsir]
        path = /opt/linuxsir
        writeable = yes
        browseable = yes
        guest ok = yes

返回命令行,建立目錄並授權

[root@localhost ~]# mkdir -p /opt/linuxsir
[root@localhost ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)

[root@localhost ~]# chown -R nobody:nobody /opt/linuxsir

 

啓動smbd和nmbd服務器:

[root@localhost ~]# smbd
[root@localhost ~]# nmbd
 

查看smbd進程,確認Samba 服務器是否運行起來了:

[root@localhost ~]# pgrep smbd
13564
13568

OK,配置好以後reboot吧,LINUX起來後,在WINDOWS運行中輸入\\192.168.0.101(我的小網IP),就成功進入我的LINUX所在區域了,這樣,我就可以用Source insight直接編寫這個路徑下的代碼了!

 

最後是交叉編譯這部分,按照手冊一路都比較好理解,問題是在完成內核配置找不到libncurses5-dev,更新源依然不行。於是,我就

 

1 sudo gedit /etc/apt/sources.list

(打開Ubuntu 11.10源列表文件)
3、將下面的代碼粘貼進去(“#”開頭的那一行爲註釋,可以直接複製進文件中)

4、通知ubuntu啓用新的更新源

1 sudo apt-get update

#臺灣源

deb http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted

#網易 Ubuntu 11.10 源(速度很快)
deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted

#骨頭源,骨頭源是bones7456架設的一個Ubuntu源 ,提供ubuntu,deepin
deb http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted

#mirror.lupaworld.com的源,速度很快

deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ oneiric main restricted universe multiverse

#這裏你也可以直接使用更快速的ubuntu.cn99.com的源(推薦):

deb http://ubuntu.cn99.com/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ oneiric main restricted universe multiverse

 

然後sudo apt-get install libncurses5-dev,make menuconfig,BSP內核配置完畢,UBOOT簡單就不說了

gcc:
1.解壓:arm-linux-gcc-4.4.6.tgz

2.chmod 777 arm

3./etc/bash.bashrc修改gcc版本

4.source /root/.bashrc

5.logout一下再進系統就好了

寫於2012-02-29

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章