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

#

时间: 2024-08-05 18:22:54

PowerPC平台 Linux移植三的相关文章

PowerPC平台 Linux移植二

继PowerPC平台 Linux移植一,制作busybox文件系统,目的实现单板挂载nfs文件系统. 1.制作busybox文件系统 (1)交叉编译busybox a.make menuconfig 配置Cross Compile prefix 位powerpc-linux-gnu- Installation Options 路径指定为/home/freescale/work/source/fs_mini b.make DOC     busybox.pod DOC     BusyBox.tx

PowerPC平台 linux移植一

在PowerPC平台 u-boot移植基础上,移植Linux内核,具体移植过程如下: 1.修改顶层Makefile ARCH        ?= powerpc CROSS_COMPILE    ?= powerpc-linux-gnu- 2.配置 [email protected]:~/work/source/linux-2.6.35-r2$  make p1010rdb_defconfig drivers/net/Kconfig:109:warning: choice value used

PowerPC平台 u-boot 移植

PowerPC功能很强的通信处理器,支持1000M以太网接口,以Freescale的P1010处理器为开发平台,讲述移植linux的整个过程,与大家分享. 1.配置交叉编译链 网上下载交叉编译工具,配置环境变量 sudo gedit /etc/environment 在末尾添加交叉编译链路径 :/home/freescale/work/tools/freescale/bin log out(不需要重启),输入如下,验证交叉编译是否安装成功: [email protected]:~/work/u-

Linux移植随笔:终于解决Tslib的问题了【转】

转自:http://www.latelee.org/embedded-linux/porting-linux-tslib.html 前段时间让Tslib搞晕头了,原来一切都是版本惹的祸.本文只是一个随笔,随笔者,随意用笔写下心得而已,因此不必较真.正如我所欣赏的“乘兴而来,兴尽而返”一样.——估计当年王子猷是赏完了夜景,兴致也完了,就回家了. 闲话少提. 搞tslib时,出现了许多错误,像 No raw modules loaded.ts_config: Success selected dev

linux移植u-boot(一)——U-Boot详解+自定义命令实战

linux移植u-boot(一)--U-Boot详解+自定义命令实战 2015-02-07 一.Bootloader ????简单地说:Bootloader主要功能就是 在系统上电时开始执行,初始化硬件和设备,准备好软件环境,最后调用操作系统. ????具体的包含:关闭你看门狗WATCHDOG,改变系统时钟,初始化存储控制器 ,将操作系统内核代码复制到内存中去运行. ????为了开发方便,可以增加网络功能,从PC上通过串口或者网络下载文件,烧写文件,将flash上的内核代码解压后运行等. Boo

pcDuino的linux移植四简单驱动开发

开发环境系统:ubuntu 10.04.4单板:pcDuino(全志A10)编译器:arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 搭建开发环境详见ubuntu 10.04.4开发环境配置. 目标1.配置 编译linux-3.0.62内核,串口正常输出2.配置内核,支持nfs挂载,启动文件系统3.最简单内核驱动开发 这个是在pcDuino linux移植一.二.三的基础上写的,重点介绍内核驱动开发,其它具体移植过程不再

基于335X平台Linux交换芯片驱动开发

基于335X平台Linux交换芯片驱动开发   一.软硬件平台资料 1.开发板:创龙AM3359核心板,网口采用RMII形式. 2.Kernel版本:4.4.12,采用FDT 3.交换芯片MARVELL的88E6321. 二.移植准备工作 1.熟悉88E6321的datasheet及Functional_Specification_Rev.0.05 2.熟悉设备树相关理论和用法 3.熟悉Linux网络驱动MDIO.PHY部分的软件流程 三.DTS文件修改 本工程的DTS文件以am335x-ice

攻城狮在路上(叁)Linux(三十)--- 光盘写入工具

一.基本步骤: 1.用mkisofs命令将所需备份的数据构建成镜像文件. 2.用cdrecord命令将镜像文件刻录至光盘或者DVD中. 二.mkisofs:新建镜像文件 mkisofs [-0 镜像文件] [-rv] [-m file] 待备份文件... [-V vol] graft -point isodir=Systemdir... 参数说明: -o:后面指定镜像文件 -r:通过RockRidge产生支持UNIX/Linux的文件数据,可以记录较多信息. -v:显示构建过程 -m file:

freescale-sdk linux移植一搭建编译环境脚本host-prepare.sh分析

接下来使用自己的课外休息时间,对基于PowerPC架构freescale-sdk,进行linux移植和分析.主要参考官方文档freescale linux sdk START_HERE.html,首先对搭建编译环境脚本host-prepare.sh分析.在移植系统之前,需要搭建编译环境,安装必要的包,为后期编译系统做准备.很多人看到脚本就头疼,下面是我的分析过程,分析不好的地方可以在下面留言,一起讨论. 一.搭建编译环境脚本分析./scripts/host-prepare.sh [email p