ubuntu12.04下 linux 開發環境的搭建 1

原創作品:http://write.blog.csdn.net/postedit/7956383    

歡迎大家一起交流學習,知識在與分享。

希望結交一些志同道和之士 

QQ: 474530676

[email protected]

    

linux 開發環境的搭建

   

平臺:虛擬機 和 ubuntu12.04 和 up6410開發板

          

//pc機下操作:
1.硬件條件: " windowsXP/7 " 和 " ubuntu10.04 " 和 " up6410 "開發板
    2.除了" 本地連接 ",將其他的連接全部禁用掉


//虛擬機下操作: 虛擬機 pc機 開發板 要在同一個網段 
1.硬件條件: 虛擬機VMware_Workstation_8.0.2 和 ubuntu10.04 和 up6410開發板
    2.除了" 本地連接 ",將其他的連接全部禁用掉,虛擬網絡選選擇第一項" 橋接 " 把下面也選上
3.在" windowsXP/7 "安裝好串口驅動

老師資料存放在根目錄下 " /home/up6410 " 文件夾下




//==================================================
第一步:
       設置SD卡啓動,將開發板上右上角的開關撥到上面(ON)
  如果設置NAND啓動,將開發板上右上角的開關撥到下面(1 2)




//============================================================
第二步: 用usb轉串口線把arm開發板和電腦連接起來,usb口接電腦,串口接開發板


      
//=============================================================================
第三步: 燒錄SD啓動卡
     
1.  SD卡插入到電腦時,是默認掛載的,這樣進到的是SD卡的文件系統,在文件系統下,
燒寫SD卡是寫到SD卡的已有文件的後面,而ARM的啓動程序bios只檢測SD卡的前512個字節的區域。
    所以要先將SD卡卸載掉.
  
2. 一定在/dev目錄下 查看設備 " ls /dev/tty " 按 " tab "
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@longguopeng:/#] ls /dev/tty
tty      tty16    tty24    tty32    tty40    tty49    tty57    tty8
tty0     tty17    tty25    tty33    tty41    tty5     tty58    tty9
tty1     tty18    tty26    tty34    tty42    tty50    tty59    ttyS0
tty10    tty19    tty27    tty35    tty43    tty51    tty6     ttyS1
tty11    tty2     tty28    tty36    tty44    tty52    tty60    ttyS2
tty12    tty20    tty29    tty37    tty45    tty53    tty61    ttyS3
tty13    tty21    tty3     tty38    tty46    tty54    tty62    ttyUSB0
tty14    tty22    tty30    tty39    tty47    tty55    tty63    
tty15    tty23    tty31    tty4     tty48    tty56    tty7                  
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/




3. 然後用 "df -l" 命令找到SD卡設備
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@longguopeng:/#] df -l
文件系統               1K-塊        已用     可用 已用% 掛載點
/dev/sda3             20315844  16044668   3222536  84% /
/dev/sda5             19288596    395036  17897936   3% /home
/dev/sda1              1019208     39980    926620   5% /boot
/dev/sdc1              1920256     26548   1893708   2% /media/longguopeng
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/




4. 爲了防止出錯,確認卸載了SD卡("umount /media/longguopeng/"),且在/dev下找不到SD卡設備,
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@longguopeng:/#]umount /media/longguopeng/
文件系統               1K-塊        已用     可用 已用% 掛載點
/dev/sda3             20315844  16044668   3222536  84% /
/dev/sda5             19288596    395036  17897936   3% /home
/dev/sda1              1019208     39980    926620   5% /boot
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
           
 
5. 切換到老師發的資料" /home/up6410/tools/ "文件下的目錄下的sd_write工具燒寫程序 
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@longguopeng:/#] cd /home/up6410/tools 
[root@longguopeng:/home/up6410/tools#] ./sd_write /dev/sdb /home/up6410/tftpboot/u-boot-sd.bin
Done.
[root@longguopeng:/home/up6410/tools#] sync
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//顯示 Done. (表示下載成功)               
      " dev/sdc "        就是SD卡設備路徑,不需要寫端口號
      "u-boot-movi.bin " 就是要燒寫到SD卡的啓動程序
                           不是寫在文件系統裏,所以在SD卡里看不見文件

   燒寫完之後,輸入 "sync" 命令同步一下,就可以拔出SD卡插到ARM開發板上實驗了!


啓動進不了說明-->" 沒燒寫成功 "顯示如下:
/*+++++++++++++++++++++++++++++++++++++++
Welcome to minicom 2.4


OPTIONS: I18n                                                                
Compiled on Jan 25 2010, 06:49:09.                                           
Port /dev/ttyUSB1                                                            
                                                                             
Press CTRL-A Z for help on special keys                                      
+++++++++++++++++++++++++++++++++++++++++*/                                           



6. 關閉防火牆關掉
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@longguopeng:/#] chkconfig --level 2345 iptables off   #關閉方法
[root@longguopeng:/#] chkconfig --list | grep iptables      #檢查方法
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/








//=====================================================================
第四步:
      確認SD卡燒寫成功,啓動minicom
     1,輸入 "minicom -s" 指令開啓串口通信程序,並且配置minicom


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
[root@longguopeng:/#] apt-get install minicom
[root@longguopeng:/#] minicom -s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


/*___________________________________________________ 
 minicom 主菜單 


    [configuration]        //配置
│ Filenames and paths      //文件名和路徑
│ File transfer protocols //文件傳輸協議
│ Serial port setup       //串行端口設置
│ Modem and dialing       //調制解調器和撥號
│ Screen and keyboard     //屏幕和鍵盤
│ Save setup as dfl      //設置保存到
│ Save setup as..       //儲存設定爲
│ Exit                  //退出
│ Exit from Minicom    //退出minicom
________________________________________________  


 用方向上下鍵選擇 Serial port setup //串行端口設置


│A-Serial Device(串口設備): /dev/ttyS0
│B-Lockfile Location(鎖文件位置): /var/lock
│C-Callin Program(調入程序):
│D-Callout Program(調出程序):
│E-Bps/Par/Bits(波特率): 115200 8N1
│F-Hardware Flow Control(硬件數據流控制): No
│G-Software Flow Control(軟件數據流控制): No
_________________________________________________  
*/
 需要配置:
1:修改第三項 --> serial port setup (方向鍵上下移動,回車確定)
               按A修改service Device   :/dev/ttyUSB0   
          ttyUSB0是在/dev 目錄下找到的SD卡設備,連接不通時,重新查看設備
                    
2:按B修改Lockfile Location :/var/lock
                                    大小  格式
        3:按E,再按Q 修改Bps/Par/Bits : 115200 8N1    
                              115200是波特率8N1是數據傳輸方式,8代表8bit的數據,
                                                 N代表無校驗位,1代表停止位


        4:按F設置Hardware Flow Control :NO
        5:按G設置Software Flow Control :NO
        6:按回車退出
     2.保存
                    選擇"Save setup as dfl"保存配置
     3. 選Exit 退出並進入minicom 界面
          
4.按下ARM開發板左下角的重啓鍵(RESTR按鍵),
                     minicom 界面就會有u-boot數據輸出了








/**********************************************************************
設置方法 二


打開終端輸入minicom後,初始化進入minicom的歡迎界面,
這裏提示按”Ctrl+A”,再按”Z”鍵進入主配置目錄
Ctrl+A”,再按”w”鍵進入自動換行
按下”O”鍵,並選擇串口配置選項進行配置。接下來的配置是一樣的。
-------------------------------------
      Minicom Command Summary                       │                                                                   
│          Commands can be called by CTRL-A <key>                   ││                                                                   
│               Main Functions                  Other Functions     ││                                                                   
│ Dialing directory..D  run script (Go)....G | Clear Screen.......C 
│ Send files.........S  Receive files......R | cOnfigure Minicom..O 
│ comm Parameters....P  Add linefeed.......A | Suspend minicom....J 
│Capture on/off.....L  Hangup.............H | eXit and reset.....X 
│send break.........F  initialize Modem...M | Quit with no reset.Q 
│ Terminal settings..T  run Kermit.........K | Cursor key mode....I 
│ lineWrap on/off....W  local Echo on/off..E | Help screen........Z       
│                                            | scroll Back........B      │                                                                         
│      Select function or press Enter for none.                          │                                                                        
│             Written by Miquel van Smoorenburg 1991-1995                
│             Some additions by Jukka Lahtinen 1997-2000                 
     │             i18n by Arnaldo Carvalho de Melo 1998         
----------------------------- --------


minicom命令摘要,按下Ctrl+D命令將被執行 , Key是對應的“字母”鍵。
“D”鍵:撥號目錄
“S”鍵:發送文件,上傳文件有幾種方式:zmodem、ymodem、xmodem、kermit、ascii
“P”鍵:通信參數。對波特率進行設置。
“L”鍵:捕捉開關。
“F”鍵:發送中斷。
“T”鍵:終端設置。A-終端仿真:VT102終端B-Backspace鍵發送:DEL鍵 C-狀態一致:啓動D-換行延遲(毫秒):0
“W”鍵:換行開關
“G”鍵:運行腳本
“R”鍵:接收文件
“A”鍵:添加一個換行符
“H”鍵:掛斷
“M”鍵:初始化調制解調器
“K”鍵:運行kermit進行刷屏
“E”鍵:切換本地回顯開關
“C”鍵:清除屏幕
“O”鍵:配置minicom
“J”鍵:暫停minicom
“X”鍵:退出和復位
“Q”鍵:退出沒有復位
“I”鍵:光標模式
“Z”鍵:幫助屏幕
“B”鍵:滾動返回


查看兩邊互ping檢測網絡是否通暢,
(minicom超級終端下)ping +IP(Linux),(Linux下)ping +IP(超級終端的IP)
**********************************************************************/






//===============================================================================
第五步:
將內核下載到開發板上


  // 搭建 tftp
  
   1.[root@longguopeng:/#] sudo apt-get install tftpd tftp openbsd-inetd //下載安裝
  


   2.[root@longguopeng:/#] sudo vim /etc/inetd.conf
 
找到如下配置:
      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #:BOOT: TFTP service is provided primarily for booting. Most sites
    # run this only on machines acting as "boot servers."
    #tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp  
                                                      (/srv/tftp 爲默認tftp目錄)
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
        配置自己的tftp目錄:
       // tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/up6410/tftpboot/


    3. 創建目錄:mkdir /home/up6410/tftpboot/ ; 修改文件權限爲777
           [root@longguopeng:/#]mkdir /home/up6410/tftpboot/
[root@longguopeng:/#] chmod 777 /home/up6410/tftpboot/
    4. 查看69端口是否有打開 :netstat -an | more | grep udp
    5. 本機測試:


      a.在/home/up6410/tftpboot目下新建一個文件,並寫入數據:


           #gedit 123.txt        


      b. 到/home目錄下


            #tftp 221.204.110.99[注:這是本機的IP地址]
              tftp> get 123.txt
            Received 12 bytes in 0.0 seconds
            tftp> quit
            #ls /home
             行了,本地測試成功!
      c.在開發板上使用tftp
        只需要將開發板和主機設在同一網段即可。


    6. 重啓tftp服務(tftp服務包括在xinetd裏)


      [root@longguopeng:/#]sudo /etc/init.d/openbsd-inetd restart
         * Restarting internet superserver inetd                                 [ OK ]
 
   
=======================================================================================================


   // 搭建 nfs
1.   [root@longguopeng:/#]sudo apt-get install nfs-kernel-server 


2.    在主機上配置配置文件。安裝好上面的軟件後,會在/etc下出現一個名叫exports的文件


3.   [root@longguopeng:/#]sudo exportfs -rv //來使配置文件生效


4. 進入/nfsroot目錄 添加共享目錄
            [root@longguopeng:/#] vim /etc/exports
           添加一行    
              /home/up6410/nfsroot *(rw,sync,no_root_squash)


5.   重新啓動nfs服務:
root@longguopeng:/#] 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/up6410/nfsroot".
  Assuming default behaviour ('no_subtree_check').
  NOTE: this default has changed since nfs-utils version 1.0.x


                                                                         [ OK ]
 * Starting NFS kernel daemon                                            [ OK ]




//===================================================================================
//  U-boot 配置顯示如下:


/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
U-Boot 1.1.6 (Jun 12 2011 - 16:55:02) for SMDK6410                              
                                                                                
****************************************                                        
**    UT-S3C6410 Nand boot v0.18      **                                        
**    ShenZhen Urbetter Technology    **                                        
**    Http://www.urbetter.com         **                                        
****************************************                                        
                                                                                
CPU:     S3C6410@532MHz                                                         
         Fclk = 532MHz, Hclk = 133MHz, Pclk = 66MHz, Serial = CLKUART (SYNC Mod 
Board:   SMDK6410                                                               
DRAM:    128 MB                                                                 
Flash:   0 kB                                                                   
NAND:    256 MB                                                                 
SD/MMC:  1880 MB                                                                
*** Warning - bad CRC or moviNAND, using default environment                    
                                                                                
In:      serial                                                                 
Out:     serial                                                                 
Err:     serial                                                                 
dm9000 i/o: 0x18000300, id: 0x90000a46                                          
MAC: 00:40:5c:26:0a:5b                                                          
operating at unknown: 15 mode                                                   
Hit any key to stop autoboot:  0     
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/      

// 在minicom 界面設置環境變量
          
       1 先查看 電腦本地連接ip (可以自己設置本地連接ip,一定要把其它連接禁用!!!!)
 點擊左下角電腦 " 開始 " " 運行 "
 打開   cmd 
        C:\Documents and Settings\Administrator> ipconfig 
         
 顯示如下:
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++
windowXP顯示:
Ethernet adapter 本地連接:


        Connection-specific DNS Suffix  
        Autoconfiguration IP Address. . . :192.168.1.177
        Subnet Mask . . . . . . . . . . . :255.255.255.0
        Default Gateway . . . . . . . . . :168.192.1.1




window7顯示:
C:\Users\Administrator>ipconfig


Windows IP 配置




以太網適配器 本地連接:


   連接特定的 DNS 後綴 . . . . . . . :
   本地鏈接 IPv6 地址. . . . . . . . : fe80::9d0f:98a0:55f6:966c%12
   IPv4 地址 . . . . . . . . . . . . : 192.168.1.177
   子網掩碼  . . . . . . . . . . . . : 255.255.255.0
   默認網關. . . . . . . . . . . . . : 192.168.1.1


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/




2.修改虛擬機ip地址的配置文件:


root@longguopeng:~/桌面# ifconfig //查看
 /*=======================================================================
eth1      Link encap:以太網  硬件地址 00:0c:29:79:30:85  
          inet 地址:192.168.1.254  廣播:192.168.1.255  掩碼:255.255.255.0
          inet6 地址: fe80::20c:29ff:fe79:3085/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  躍點數:1
          接收數據包:40658 錯誤:0 丟棄:0 過載:0 幀數:0
          發送數據包:48822 錯誤:0 丟棄:0 過載:0 載波:0
          碰撞:0 發送隊列長度:1000 
          接收字節:3773525 (3.7 MB)  發送字節:38629419 (38.6 MB)
          中斷:19 基本地址:0x2000 


lo        Link encap:本地環回  
          inet 地址:127.0.0.1  掩碼:255.0.0.0
          inet6 地址: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  躍點數:1
          接收數據包:454 錯誤:0 丟棄:0 過載:0 幀數:0
          發送數據包:454 錯誤:0 丟棄:0 過載:0 載波:0
          碰撞:0 發送隊列長度:0 
          接收字節:35884 (35.8 KB)  發送字節:35884 (35.8 KB)
=====================================================================*/


//臨時修改
    [root@longguopeng:/#] ifconfig eth1 192.168.1.254 netmask 255.255.255.0 


//永久修改
[root@longguopeng:/#] sudo pico /etc/network/interfaces   // 一定要用" pico " 
/*++++++++++++++++++++++++++
   auto lo


iface lo inet loopback


auto eth1


iface eth1 inet static


address 192.168.1.254


netmask 255.255.255.0


gateway 192.168.1.1


//ctrl+O 保存 ctrl+X退出
+++++++++++++++++++++++++++*/


[root@longguopeng:/#] sudo /etc/init.d/networking restart   //重啓網絡          
         
  
3. 在minicom界面數入
 
help       命令幫助
printenv     查看環境變量,並修改IP地址
  
           延時10秒           [uboot-longguopeng #] setenv  bootdelay 10    (可不用)
           10秒後打印環境變量 [uboot-longguopeng #] setenv  bootcmd printenv(可不用)
       
設置開發板的ip     [uboot-longguopeng #] setenv ipaddr 192.168.1.167 //注意:開發板和虛擬機,電腦PC 的網段要一樣     
            設置虛擬機的ip [uboot-longguopeng #] set serverip  192.168.1.168//在虛擬機上用ifconfig指令查看ip地址       
            設置網關         [uboot-longguopeng #] setenv gatewayip 192.168.1.1
            設置子網掩碼     [uboot-longguopeng #] setenv netmask 255.255.255.0
            開啓標準輸入     [uboot-longguopeng #] setenv stdin serial
            開啓標準輸出     [uboot-longguopeng #] setenv stdout serial
            開啓標準錯誤輸出   [uboot-longguopeng #] setenv stderr serial


            設置完成保存設置   [uboot-longguopeng #] saveenv
 
           如果命令敲錯了如:    [uboot-longguopeng #] setenv getewayip 192.168.1.1 
           直接該爲就可以去掉   [uboot-longguopeng #] setenv getewayip
保存舊的變量       [uboot-longguopeng #] set bootargs_old $bootargs  
            
      看是否可以和虛擬機ip連接,
/*++++++++++++++++++++++++++++++++++++++          
[uboot-longguopeng #] ping 192.168.1.254 
                                                                                                                          
dm9000 i/o: 0x18000300, id: 0x90000a46 
                                                                                                               
MAC: 00:40:5c:26:0a:5b  
                                                                                                                                  
operating at 100M full duplex mode 
                                                                                                                       
host 192.168.1.254 is alive   //就證明開發板已和pc連接上了
+++++++++++++++++++++++++++++++++++++++++*/
           
            
如果不能 ping 通,檢查網絡
/*+++++++++++++++++++++++++++++++++++++++++++  
[uboot-longguopeng #] ping 192.168.1.254                                                                                      
dm9000 i/o: 0x18000300, id: 0x90000a46                                                                               
MAC: 00:40:5c:26:0a:5b                                                                                               
operating at 100M full duplex mode                                                                                   
                                                                                                                     
Abort                                                                                                                
ping failed; host 192.168.1.254 is not alive
+++++++++++++++++++++++++++++++++++++++++++++*/




首先查看:
      
root@longguopeng:~/桌面# ping 192.168.1.177 //PC機
PING 192.168.1.177 (192.168.1.177) 56(84) bytes of data.
64 bytes from 192.168.1.177: icmp_seq=1 ttl=64 time=4.36 ms //ping 通
64 bytes from 192.168.1.177: icmp_seq=2 ttl=64 time=0.315 ms
64 bytes from 192.168.1.177: icmp_seq=3 ttl=64 time=0.485 ms
64 bytes from 192.168.1.177: icmp_seq=4 ttl=64 time=0.413 ms
^C
--- 192.168.1.177 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.315/1.395/4.367/1.716 ms




PING 192.168.1.177 (192.168.1.177) 56(84) bytes of data.
From 192.168.1.254 icmp_seq=1 Destination Host Unreachable //ping 不通
From 192.168.1.254 icmp_seq=2 Destination Host Unreachable
From 192.168.1.254 icmp_seq=3 Destination Host Unreachable




root@longguopeng:~/桌面# ping 192.168.1.254 //自己
PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.
64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from 192.168.1.254: icmp_seq=2 ttl=64 time=0.037 ms
64 bytes from 192.168.1.254: icmp_seq=3 ttl=64 time=0.031 ms
^C
--- 192.168.1.254 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2012ms
rtt min/avg/max/mdev = 0.031/0.033/0.037/0.007 ms




原始顯示配置:
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[uboot-longguopeng #] pri                                      
bootargs=root=/dev/nfs rw nfsroot=192.168.1.254:/nfs_root ip=192.168.1.253 cons0
bootcmd=nand read 0x50008000 0x40000 0x220000;bootm 0x50008000                  
bootdelay=3                                                                     
baudrate=115200                                                                 
ethaddr=11:22:33:44:55:66                                                                                                        
ipaddr=192.168.1.253                                                            
serverip=192.168.1.254                                                          
gatewayip=192.168.1.1                                                           
netmask=255.255.255.0                                                         
stdin=serial                                                                    
stdout=serial                                                                   
stderr=serial                                                                   
                                                                                
Environment size: 343/16380 bytes  
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
     
  4. 將內核複製到tftp指定的服務文件夾下 /home/up6410/tftpboot/
         [root@longguopeng:/#] cd /home/up6410/images/
[root@longguopeng:/home/up6410/images#] cp zImage /home/up6410/tftpboot/
            
            確認文件已複製到/tftpboot下就可以下載內核zImage了
            
            在minicom界面輸入  
[uboot-longguopeng #] tftp 0x50000000 zImage (這只是測試是否可以下載而已,下載成功可以看到進度條)
        [uboot-longguopeng #] md 0x50000000           (查看地址)
            
            就可以下載了 0x50000000  
            就是要下載到開發板的地址,也是內存的起始地址,這個地址不是內核要存放的地址,
            內核存放的地址是0x50008000只有把內核下載到這個地址,內核纔可以啓動! 




**************************************************************************************************************************************
第六步:  SD卡啓動內核,通過nfs掛載文件系統
    
        1,啓動nfs服務
//           [root@longguopeng:/#] sudo /etc/init.d/nfs-kernel-server restart
        
        2,創建nfs服務目錄
//           [root@longguopeng:/#] mkdir /home/up6410/nfsroot/   
                                      // 這個目錄是用來存放文件系統的
        
        3,將文件系統解壓到nfs服務目錄下
//           [root@longguopeng:/#] tar -xvf /home/up6410/src/qt_rootfs.tar -C /home/up6410/nfsroot
                                         //存放路徑                             //解壓到的路徑
        
        4,進入/nfsroot目錄 添加共享目錄
//           [root@longguopeng:/#] vim /etc/exports
           添加一行    
               /home/up6410/nfsroot *(rw,sync,no_root_squash)


        5,重啓NFS服務
//           [root@longguopeng:/#] sudo /etc/init.d/nfs-kernel-server restart


        6,進入minicom 界面修改環境變量
                
                
                                                                                                                                                                                                                  
              //下面三行寫成一行 換行時空一格  (ctrl+a W 打開換行)             虛擬機ip   /nfs共享目錄
//           [uboot-longguopeng #] setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.168:/home/up6410/nfsroot
                                  // 開發板ip       虛擬機ip      網關        子防掩碼       名稱      、       網卡默認
                                  ip=192.168.1.167:192.168.1.168:192.168.1.1:255.255.255.0:www.longguopeng.com:eth0:off 
                                  console=ttySAC0,115200 men=128M init=/init


//         7. [uboot-longguopeng #] setenv bootcmd tftp 0x50008000 zImage\; bootm 0x50008000   //  自動啓動下載


8.增加run命令  
//  [uboot-longguopeng #] setenv run wnf nand erase 0 0x20000\; tftp 0x50000000 test.bin\;nand write 0x50000000 0 0x20000
 
         9. 保存環境變量 
//  [uboot-longguopeng #] savenv
        
             
10. 文件系統下操作:觸屏校對 
//  [qt@longguopeng /]# rm -rf /etc/pointercal

    11,重新下載內核
//             [uboot-longguopeng #] tftp 0x50008000 zImage
           
               啓動內核
             [uboot-longguopeng #] bootm
                
              啓動正常的話,開發板上就會看到圖形界面




//顯示正確配置如下:
[uboot-longguopeng #] pri 
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                                                                                                        
bootdelay=3                                                                                                                                               
baudrate=115200                                                                                                                                           
ethaddr=00:40:5c:26:0a:5b                                                                                                                                 
ipaddr=192.168.1.253                                                                                                                                      
serverip=192.168.1.254                                                                                                                                    
gatewayip=192.168.1.1                                                                                                                                     
netmask=255.255.255.0                                                                                                                                     
bootcmd=tftp 0x50008000 zImage; bootm 0x50008000
                                                                                                           
bootargs=root=/dev/nfs rw nfsroot=192.168.1.254:/home/up6410/nfsroot ip=192.168.1.253:192.168.1.254:192.168.1.255:255.255.255.0:www.longguopeng.com:eth0:off console=ttySAC0,115200 men=128M
                                                                                                                  
stdin=serial                                                                                                                                              
stdout=serial                                                                                                                                             
stderr=serial                                                                                                                                             
                                                                                                                                                          
Environment size: 421/16380 bytes  
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/




過程遇到的問題:
**********************************************************************************************************************
minicom 
------------------------------------------------------------
1   USB設備寫錯了,因該寫USB0
Device /dev/ttyUSB1 access failed: 沒有那個文件或目錄.


2       重啓minicom出現的情況
----------------------------------
出現   Device /dev/ttyUSB0 lock failed: 不允許的操作.
輸入minicom -s 重新設置一下並保存退出。


------------------------------------------------------------
[root@localhost tftpboot]# pstree -p | grep minicom
        |-minicom(14189)
[root@localhost tftpboot]# kill -9 14189
------------------------------------------------------------






再出現   minicom: cannot open /dev/ttyUSB0: 無效的參數
輸入minicom -s 重新設置一下並保存退出,再按下復位鍵


再不行的話:
就關閉電源,把usb重新插一下,啓動minicom ,按復位鍵,有可能不成功,在關閉電源,按復位建。




如果出現下面的:再按一下復位鍵
————————————————————————————————————————
Welcome to minicom 2.1


OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n           
Compiled on Jul 26 2006, 06:38:09.                                           
                                                                             
Press CTRL-A Z for help on special keys                                     
—————————————————————————————————————————                                                                             
**********************************************************************************************************************
IP 寫錯了


IP-Config: Complete:                                                            
     device=eth0, addr=192.168.1.253, mask=255.255.255.0, gw=192.168.1.1,       
     host=www, domain=, nis-domain=longguopeng.com,                             
     bootserver=192.168.1.254, rootserver=168.192.1.254, rootpath=              
Looking up port of RPC 100003/2 on 168.192.1.254                                
rpcbind: server 168.192.1.254 not responding, timed out                         
Root-NFS: Unable to get nfsd port number from server, using default             
Looking up port of RPC 100005/1 on 168.192.1.254                                
K                                                              






nfs 服務沒開啓 出現的問題
-----------------------------------------
VFS: Unable to mount root fs via NFS, trying floppy.                                                                              
VFS: Cannot open root device "nfs" or unknown-block(2,0)                                                                          
Please append a correct "root=" boot option; here are the available partitions:                                                   
1f00             256 mtdblock0 (driver?)                                                                                          
1f01            3840 mtdblock1 (driver?)                                                                                          
1f02           81920 mtdblock2 (driver?)                                                                                          
1f03          176128 mtdblock3 (driver?)                                                                                          
b300         1924096 mmcblk0 driver: mmcblk                                                                                       
  b301         1924027 mmcblk0p1                                                                                                  
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block




***************************************************************************************************************************************
 文件系統壞了,重新解壓過


Root-NFS: Server returned error -2 while mounting /home/up6410/nfsroot          
VFS: Unable to mount root fs via NFS, trying floppy.                            
VFS: Cannot open root device "nfs" or unknown-block(2,0)                        
Please append a correct "root=" boot option; here are the available partitions: 
1f00             256 mtdblock0 (driver?)                                        
1f01            3840 mtdblock1 (driver?)                                        
1f02           81920 mtdblock2 (driver?)                                        
1f03          176128 mtdblock3 (driver?)                                        
b300         1924096 mmcblk0 driver: mmcblk                                     
  b301         1924027 mmcblk0p1                                                
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) 

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