1. 程式人生 > >PowerPC平臺 Linux移植三

PowerPC平臺 Linux移植三

繼PowerPC平臺 Linux移植二,實現單板掛載nfs網路檔案系統。

1.ubuntu安裝 配置 啟動nfs服務
詳細過程見 http://blog.csdn.net/u010216127/article/details/8825735
=> nfs 0x3000000 10.3.56.9:/home/freescale/work/nfs_root/hello
Speed: 100, full duplex
Using eTSEC2 device
File transfer via NFS from server 10.3.56.9; our IP address is 10.3.56.242
Filename '/home/freescale/work/nfs_root/hello'.
Load address: 0x3000000
Loading: ##T T *** ERROR: Cannot umount
解決方法:
要在主機的/etc/hosts檔案中加入
你的開發板ip     nfs目錄(Ubuntu),eg
10.3.56.242        /home/freescale/work/nfs_root
=> nfs 0x3000000 10.3.56.9:/home/freescale/work/nfs_root/hello
Speed: 100, full duplex
Using eTSEC2 device
File transfer via NFS from server 10.3.56.9; our IP address is 10.3.56.242
Filename '/home/freescale/work/nfs_root/hello'.
Load address: 0x3000000
Loading: ##
done
Bytes transferred = 7920 (1ef0 hex)
=>

2.燒寫uImage dtb
=> setenv ethact eTSEC2                                                                                                                                                    
=> tftp 0x1000000 uImage
Speed: 100, full duplex
Using eTSEC2 device
TFTP from server 192.168.2.242; our IP address is 192.168.2.21
Filename 'uImage'.
Load address: 0x1000000
Loading: #################################################################
         #################################################################
         #################################################################
         ####
done
Bytes transferred = 2907800 (2c5e98 hex)
=> erase 0xee080000 0xee37ffff

........................ done
Erased 24 sectors
=> cp.b 0x1000000 0xee080000 0x300000
Copy to Flash... 9....8....7....6....5....4....3....2....1....done
=> md 0xee080000
ee080000: 27051956 2899922f 55640aa4 002c5e58    '..V(../Ud...,^X
ee080010: 00000000 00000000 06436151 05070201    .........CaQ....
ee080020: 4c696e75 782d322e 362e3335 00000000    Linux-2.6.35....
燒寫 dtb
=> tftp 0xc00000 p1010rdb.dtb
Speed: 100, full duplex
Using eTSEC2 device
TFTP from server 192.168.2.242; our IP address is 192.168.2.21
Filename 'p1010rdb.dtb'.
Load address: 0xc00000
Loading: #
done
Bytes transferred = 11988 (2ed4 hex)
=> erase 0xee040000 0xee07ffff

.. done
Erased 2 sectors
=> cp.b 0xc00000 0xee040000 0x40000
Copy to Flash... 9....8....7....6....5....4....3....2....1....done
=> md 0xee040000
ee040000: d00dfeed 00002ed4 00000038 00002778    ...........8..'x
ee040010: 00000028 00000011 00000010 00000000    ...(............
ee040020: 0000035c 00002740 00000000 00000000    ...\..'@........
ee040030: 00000000 00000000 00000001 00000000    ................
ee040040: 00000003 0000000a 00000000 66736c2c    ............fsl,
ee040050: 50313031 30000000 00000003 0000000d    P1010...........
ee040060: 00000006 66736c2c 50313031 30524442    ....fsl,P1010RDB

3.實現nfs掛載檔案系統
setenv nfsargs 'setenv bootargs root=/dev/nfs  rw nfsroot=10.3.56.9:/home/freescale/work/source/fs_mini nolock ip=10.3.56.242:10.3.56.9:10.3.57.255:255.255.0.0::eth1:off init=/linuxrc console=ttyS0,115200'
setenv bootcmd 'run nfsargs; bootm 1000000 - c00000'
=> setenv bootargs root=/dev/nfs nfsroot=10.3.56.9:/home/freescale/work/source/fs_mini nolock ip=10.3.56.242:10.3.56.9:10.3.57.255:255.255.0.0::eth1:off init=/linuxrc \
> console=ttyS0,115200

ALSA device list:
  No soundcards found.
IPv4 over IPv4 tunneling driver
GRE over IPv4 tunneling driver
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
turn off boot console udbg0

出現這個halt是因為$consoledev is not set,重新修改引數即可

=> setenv ethact eTSEC2
=> setenv nfsargs 'setenv bootargs root=/dev/nfs nfsroot=10.3.56.9:/home/freescale/work/source/fs_mini nolock ip=10.3.56.242:10.3.56.9:10.3.57.255:255.255.0.0::eth1:off \
> init=/linuxrc console=ttyS0,115200'
=> setenv bootcmd 'run nfsargs; bootm 1000000 - c00000'
=> tftp 0x1000000 uImage
Speed: 100, full duplex
Using eTSEC2 device
TFTP from server 192.168.2.242; our IP address is 192.168.2.21
Filename 'uImage'.
Load address: 0x1000000
Loading: #################################################################
         #################################################################
         #################################################################
         ########
done
Bytes transferred = 2969010 (2d4db2 hex)
=> tftp 0xc00000 p1010rdb.dtb
Speed: 100, full duplex
Using eTSEC2 device
TFTP from server 192.168.2.242; our IP address is 192.168.2.21
Filename 'p1010rdb.dtb'.
Load address: 0xc00000
Loading: #
done
Bytes transferred = 11988 (2ed4 hex)
=> setenv ipaddr 10.3.56.242
=> set serverip 10.3.56.9
Unknown command 'set' - try 'help'
=> setenv serverip 10.3.56.9
=> ping $serverip
Speed: 100, full duplex
Using eTSEC2 device
host 10.3.56.9 is alive
=> boot
........
NET: Registered protocol family 17
NET: Registered protocol family 15
eth1: attached PHY driver [Generic PHY] (mii_bus:

[email protected]:06, id=4dd074)
IP-Config: Complete:
     device=eth1, addr=10.3.56.242, mask=255.255.0.0, gw=10.3.57.255,
     host=10.3.56.242, domain=, nis-domain=(none),
     bootserver=10.3.56.9, rootserver=10.3.56.9, rootpath=
Looking up port of RPC 100003/2 on 10.3.56.9
Looking up port of RPC 100005/1 on 10.3.56.9
VFS: Mounted root (nfs filesystem) readonly on device 0:15.
devtmpfs: mounted
Freeing unused kernel memory: 212k init
nfs: server 10.3.56.9 not responding, still trying

4.繼續修改檔案系統
原因是掛載系統時改變了開發板的ip,修改Ip即可。

eth1: attached PHY driver [Generic PHY] (mii_bus:
[email protected]
:06, id=4dd074)
IP-Config: Complete:
     device=eth1, addr=10.3.56.242, mask=255.255.0.0, gw=10.3.57.255,
     host=10.3.56.242, domain=, nis-domain=(none),
     bootserver=10.3.56.9, rootserver=10.3.56.9, rootpath=
Looking up port of RPC 100003/2 on 10.3.56.9
Looking up port of RPC 100005/1 on 10.3.56.9
VFS: Mounted root (nfs filesystem) readonly on device 0:15.
devtmpfs: mounted
Freeing unused kernel memory: 212k init
can't open /dev/ttySAC0: No such file or directory
can't open /dev/ttySAC0: No such file or directory
can't open /dev/ttySAC0: No such file or directory
can't open /dev/ttySAC0: No such file or directory
can't open /dev/ttySAC0: No such file or directory
can't open /dev/ttySAC0: No such file or directory
5.繼續修改檔案系統
修改inittab檔案
ttyS0::askfirst:-/bin/sh
6.最終成功掛載
eth1: attached PHY driver [Generic PHY] (mii_bus:
[email protected]
:06, id=4dd074)
IP-Config: Complete:
     device=eth1, addr=10.3.56.242, mask=255.255.0.0, gw=10.3.57.255,
     host=10.3.56.242, domain=, nis-domain=(none),
     bootserver=10.3.56.9, rootserver=10.3.56.9, rootpath=
Looking up port of RPC 100003/2 on 10.3.56.9
Looking up port of RPC 100005/1 on 10.3.56.9
VFS: Mounted root (nfs filesystem) readonly on device 0:15.
devtmpfs: mounted
Freeing unused kernel memory: 212k init

Please press Enter to activate this console.
# ls
bin      etc      linuxrc  proc     sbin     tmp
dev      lib      mnt      root     sys      usr
#

7.解決只讀檔案系統
# mkdir test1
mkdir: cannot create directory 'test1': Read-only file system
# ls
bin      etc      linuxrc  proc     sbin     test     usr
dev      lib      mnt      root     sys      tmp
# mount                                                        
rootfs on / type rootfs (rw)
/dev/root on / type nfs (ro,relatime,vers=2,rsize=4096,wsize=4096,namlen=255,hard,nolock,proto=udp,port=65535,timeo=11,retrans=3,sec=sys,mountport=65535,mountproto=,addr=10.3.56.9)
devtmpfs on /dev type devtmpfs (rw,relatime,size=516660k,nr_inodes=129165,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
然後就是掛載nfs目錄後只讀不可寫問題了,折騰半天,
後面發現是要求UID,GID與伺服器一致
於是在伺服器上用id命令一查
# id
uid=0 gid=0
# id
uid=0 gid=0
#
修改/etc/exports 檔案
/home/freescale/work/source/fs_mini *(rw,sync,no_root_squash,anonuid=0,anongid=0)
sudo service nfs-kernel-server restart
setenv nfsargs 'setenv bootargs root=/dev/nfs  rw nfsroot=10.3.56.9:/home/freescale/work/source/fs_mini nolock ip=10.3.56.242:10.3.56.9:10.3.57.255:255.255.0.0::eth1:off init=/linuxrc console=ttyS0,115200'
setenv bootcmd 'run nfsargs; bootm 1000000 - c00000'
8.重新掛載nfs檔案系統,讀寫正常
# mkdir test1
# ls
bin      etc      linuxrc  proc     sbin     test     tmp
dev      lib      mnt      root     sys      test1    usr
# rmdir test1
# ls
bin      etc      linuxrc  proc     sbin     test     usr
dev      lib      mnt      root     sys      tmp
# ping 10.3.56.9
PING 10.3.56.9 (10.3.56.9): 56 data bytes
64 bytes from 10.3.56.9: seq=0 ttl=64 time=1.042 ms
64 bytes from 10.3.56.9: seq=1 ttl=64 time=0.429 ms
^C
--- 10.3.56.9 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.429/0.735/1.042 ms
#

相關推薦

PowerPC平臺 Linux移植

繼PowerPC平臺 Linux移植二,實現單板掛載nfs網路檔案系統。 1.ubuntu安裝 配置 啟動nfs服務 詳細過程見 http://blog.csdn.net/u010216127/article/details/8825735 => nfs 0x300

linux裝置樹dts之powerpc 平臺解析過程

一. 在linux中,對dtb檔案解析的整個過程式如下: 1)首先將從u-boot 傳遞過來的映像基地址和dtb 檔案映像基地址儲存通用暫存器r30,r31;2)通過呼叫machine_init()、early_init_devtree()函式來獲取核心前期初始化所需的bo

Zynq-Linux移植學習筆記之-ramdisk

下面用一張圖簡單介紹一下ramfs的產生過程: 如上圖所示,收集到的一些嵌入式相關的原始碼以及package經過PC上的GCC,binutis等工具編譯後得到gcc編譯器,ld,obj,庫等,注意這裡編譯得到的就是嵌入linux的相應編譯工具,它們共同組成嵌入式編譯環

windows到linux——移植新浪微博開放平臺客戶端(c++)到linux

    看微博這麼火,也試試這新浪微博開放平臺,發現給了C++版客戶端,還給了測試例子,可是沒有區分出Linux平臺和Mac平臺,就這麼嘗試下把這個客戶端程式移植到linux下執行看看。不過也不是完全盲目,還是看到人家給的SDK資源下有著Linux目錄和Mac目錄,說明應該

arm-linux移植手記(Linux核心移植

    其實已經弄完了,可以把linux核心以及基於busybox1.16.0製作的檔案系統結合。從總的來看是可以用自己的工具鏈編譯生成的u-boot作為Boot Loader,Linux2.6.32.2核心和基於busybox1.16.0的根檔案系統,只是還缺少很多相關的

物聯網平臺構架系列:Amazon, Microsoft, IBM IoT 平臺導論 之 連接

物聯網; iot; aws; 亞馬遜; greengrass;microsoft; azure;ibm; watson; bluemix 最近研究了一些物聯網平臺技術資料,以做選型參考。腦子裏積累大量信息,便想寫出來做一些普及。作為科普文章,力爭通俗易懂,不確保概念嚴謹性。我會給考據癖者提供相關英文

c語言中fflush的運用為什麽沒有效果呢,測試平臺linux

*** file 語言 stdlib.h clu author 年齡 blog name 1 /************************************************************************* 2 > F

虛擬機裝Linux種網絡模式

linux p地址 ges com 子網掩碼 host 橋接 主機 src   在通過VMWare裝Linux時,Linux系統需要進行上網或通過SSH進行遠程操作,所以需要進行網絡配置,這裏有三種模式:如下圖      1.橋接模式   此種方式共享宿主機的真實網卡,需要

linux

com 運行級別 zip2 bsp 工作 進行 插入模式 grub 部分 一 正文處理命令及tar命令 使用cat命令進行文件的縱向合並 兩種文件的縱向合並方法 : tar命令:將多個文件(也可能包括目錄,因為目錄本身也是文件)放在一起存放到一個磁帶或磁盤歸檔文件中。並

Linux基礎

結合 firefox 配置 一個 bz2 行數 查看 exec reat cat:查看全部(缺點:內容較多時不方便查看) 格式:cat [選項] 文件名 常用命令選項 -n:在每一行前加上行號 [[email protected]/* */ 桌面]# cat -

linux三線ip

服務器三線三ip的配置四步驟(實現的要求是電信的出電信,聯通的出聯通,移動的出移動。現在的要求是默認網關走電信,eth1是電信的)1、刪除eth0和eth2的網關2、添加明細路由表3、保存至根目錄4、驗證是否正確(驗證方法 安裝yum instill mtr 然後mtr電信地址)本文出自 “13058301”

路由器配置實踐 教你如何在Linux臺主機兩個網段互相通信

網絡配置 虛擬機大家好我是你們的齊天大聖又到了齊天大聖給大家講解的時間了今天我帶你們做一個 大大項目 你們信不信如果把你不小心打開這個文檔 希望你能看完 這個博文花費了我兩天的時間所以請尊重我的勞動 假裝看完好嗎 齊天大聖在此謝過各位看官首先歡迎大家觀看操作步驟 我們正式開始題目:路由配置實踐:01. 需要按

2017-9-13-Linux移植:u-boot的移植

ble spa order makefile make 周立功 itl add tar命令 1、u-boot下載地址:http://ftp.denx.de/pub/u-boot/ 2、Linux環境下使用tar命令解壓壓縮包:tar -xzvf file.tar.gz

2017-9-15-Linux移植:WinSCP軟件

back init start exit 開放 cut 下載 文章 但是 在Linux電腦上面安裝了TFTP server,但是各種不給力,決定尋找其他辦法在Windows和Linux之間傳輸文件。 WinSCP 是一個 Windows 環境下使用 SSH 的開源圖形化 S

2017-9-24-Linux移植:ubuntu server 16.04無法聯網&無法apt-get update解決

配置 ack src clas ron con span 技術 修改 無法上網!!!不能忍。。 現象:ifconfig 毛都沒有,想找一下ip都找不到。 ifconfig –a 可以列出所有網卡設備,確認VM VirtualBox網卡開對了,已經給到了虛擬機。 編輯/e

Linux周學習筆記(1)

命令 hiho 並且 ron 增加 如果 mkdir strong lin Linux第三周學習筆記(1)2.20 特殊權限stick_bit特殊權限stick_bit:意為防刪除位。文件是否可以被某一個用戶刪除,主要取決於該文件所在目錄是否對該用戶具有寫的權限。如果沒有寫

學習Linux次上課筆記

筆記linux**1.9 使用PuTTY遠程連接Linux 1.下載PuTTY. 2.在虛擬機上查看IP地址,使用ifconfig命令。 3.如果在虛擬機上,敲ifconfig命令,沒反應。那麽使用 4.配置Putty,配置完成後,點擊open按鈕。最後一張是設置成功圖。 5.如果沒有成功,

Linux實驗: shell 編程(1)

linu 輸入 which pass 解釋 文件的時間 幫助 用戶信息 普通用戶 hell 命令應用練習 ① /etc/passwd ‘ etc/passwd 為每個用戶賬戶包含一行,包含使用冒號 (“:”)分隔的七個字段,分別是:登錄名,選的加密後的密碼,字用

跟阿銘學linux使用putty、xshell遠程連接Linux及密鑰認證

putty使用方法 xshell使用方法 密鑰登陸 一、本節課要用到的兩款軟件分別是putty、xshellputty下載地址:https://the.earth.li/~sgtatham/putty/latest/w64/putty.zipxshell下載地址:https://www.netsa

微軟收購在線學習平臺Flipgrid,英逐鹿教育市場殺紅眼

優勢 撤回 來看 理念 sha image 進行 效果 res 毋庸置疑的是,“活到老,學到老”是永恒的箴言。每個人在不斷的人生階段,總是要去不斷提升自己。為此,教育也就成為一件具有“終生性質”的大事。而隨著互聯網及、智能、科技元素的全面滲入,教育早已發生翻天覆地的變化。隨