vbox ubuntu NFS配置(基于QT210)

PC端(win7 64bit,不用关闭防火墙)


1. vbox网络选择 NAT方式(我上网用的是无线网卡),

sudo apt-get install nfs-kernel-server nfs-common

安装后把NAT链接关闭,创建另外一个网络(桥接到自己的物理网卡上,开发板与PC通过网线链接,上电开发板,PC网口指示灯点亮)

2. 在/etc/exprots中添加共享目录

root@lj:~# vi /etc/exports
root@lj:~# 

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/work *(rw,sync,no_root_squash)


测试如果出现

root@ubuntu:/# mount 192.168.56.102:/work/ /test
mount.nfs: access denied by server while mounting 192.168.56.102:/work/

//secure 选项要求mount客户端请求源端口小于1024(然而在使用 NAT 网络地址转换时端口一般总是大于1024的),默认情况下是开启这个选项的,如果要禁止这个选项,则使用 insecure 标识
修改配置文件/etc/exports,加入 insecure 选项
/work  *(insecure,rw,async,no_root_squash)


3. sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务


4.测试:

创建临时目录test

$ sudo mount 192.168.56.12:/work/   test

进入test目录,可以看到work中内容。


开发板:

1. 首先编译好busybox,制作的根文件系统。

2. 开发板设置好网络地址等:

ethact=smc911x-0
ethaddr=00:40:5c:26:0a:5b
gatewayip=192.168.56.0
ipaddr=192.168.56.17
netmask=255.255.255.0
serverip=192.168.56.12

3. 开发板在u-boot时能够ping通服务器,即192.168.56.12

4. 设置好bootargs:

bootargs=console=ttySAC0 root=/dev/nfs nfsroot=192.168.56.12:/work/busybox-1.20.2/rootfs ip=192.168.56.17:192.168.56.12:192.168.56.0:255.255.255.0:smdkv210:eth0:off

4. 内核配置:

前提是网卡驱动已经已经移植好,

内核一定选上网络支持,否则会显示如下:

smsc911x smsc911x.0: eth0: MAC Address: 42:f2:0c:30:19:bf
mousedev: PS/2 mouse device common for all mice
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
VFS: Cannot open root device "nfs" or unknown-block(0,255): error -6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)
[<80014c20>] (unwind_backtrace+0x0/0xfc) from [<80219ab0>] (panic+0x94/0x1d4)
[<80219ab0>] (panic+0x94/0x1d4) from [<802c6dfc>] (mount_block_root+0x220/0x2c8)
[<802c6dfc>] (mount_block_root+0x220/0x2c8) from [<802c7094>] (prepare_namespace+0x190/0x1cc)
[<802c7094>] (prepare_namespace+0x190/0x1cc) from [<802c63d0>] (kernel_init+0x1a4/0x1b8)
[<802c63d0>] (kernel_init+0x1a4/0x1b8) from [<8000fe28>] (kernel_thread_exit+0x0/0x8)

第一步:网络支持

Networking support --->Networkingoptions--->TCP/IP networking---> IP:kernel levelautoconfiguration/IP:BOOTUP support


第二步:驱动配置:

Device Drivers --->Network devicesupport--->Ethernet driver support --->SMSC LAN911x/LAN921x familiersembedded ethernet support



第三步:文件系统配置(没有第一步,第三步打不开)

File systems--->Network FileSystems--->NFS client support--->选择NFS client version3 或者 NFS client version 4

选择: Root filesystem on NFS



完成后,log如下:

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.4.2 (root@lj) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #10 PREEMPT Sat Mar 9 15:54:17 CST 2013
CPU: ARMv7 Processor [412fc082] revision 2 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: SMDKV210
Memory policy: ECC disabled, Data cache writeback
CPU S5PV210/S5PC110 (id 0x43110220)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
S5PV210: PLL settings, A=1000000000, M=667000000, E=80000000 V=54000000
S5PV210: ARMCLK=1000000000, HCLKM=200000000, HCLKD=166750000
HCLKP=133400000, PCLKM=100000000, PCLKD=83375000, PCLKP=66700000
sclk_dmc: source is sclk_a2m (0), rate is 200000000
sclk_onenand: source is hclk_dsys (1), rate is 166750000
sclk_fimc: source is ext_xtal (0), rate is 24000000
sclk_fimc: source is ext_xtal (0), rate is 24000000
sclk_fimc: source is ext_xtal (0), rate is 24000000
sclk_cam0: source is ext_xtal (0), rate is 24000000
sclk_cam1: source is ext_xtal (0), rate is 24000000
sclk_fimd: source is ext_xtal (0), rate is 24000000
sclk_mfc: source is sclk_a2m (0), rate is 200000000
sclk_g2d: source is sclk_a2m (0), rate is 200000000
sclk_g3d: source is sclk_a2m (0), rate is 200000000
sclk_csis: source is ext_xtal (0), rate is 24000000
sclk_pwi: source is ext_xtal (0), rate is 24000000
sclk_pwm: source is ext_xtal (0), rate is 24000000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttySAC0 root=/dev/nfs nfsroot=192.168.56.12:/work/busybox-1.20.2/rootfs ip=192.168.56.17:192.168.56.12:192.168.56.0:255.255.255.0:smdkv210:eth0:off
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 515536k/515536k available, 8752k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xa0800000 - 0xff000000   (1512 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x80008000 - 0x8038da50   (3607 kB)
      .init : 0x8038e000 - 0x803ad000   ( 124 kB)
      .data : 0x803ae000 - 0x803dbe40   ( 184 kB)
       .bss : 0x803dbe64 - 0x80411424   ( 214 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:208
VIC @f6000000: id 0x00041192, vendor 0x41
VIC @f6010000: id 0x00041192, vendor 0x41
VIC @f6020000: id 0x00041192, vendor 0x41
VIC @f6030000: id 0x00041192, vendor 0x41
sched_clock: 32 bits at 33MHz, resolution 29ns, wraps every 128784ms
Console: colour dummy device 80x30
Calibrating delay loop... 997.78 BogoMIPS (lpj=2494464)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x202bd718 - 0x202bd770
gpiochip_add: registered GPIOs 0 to 7 on device: GPA0
gpiochip_add: registered GPIOs 9 to 12 on device: GPA1
gpiochip_add: registered GPIOs 14 to 21 on device: GPB
gpiochip_add: registered GPIOs 23 to 27 on device: GPC0
gpiochip_add: registered GPIOs 29 to 33 on device: GPC1
gpiochip_add: registered GPIOs 35 to 38 on device: GPD0
gpiochip_add: registered GPIOs 40 to 45 on device: GPD1
gpiochip_add: registered GPIOs 47 to 54 on device: GPE0
gpiochip_add: registered GPIOs 56 to 60 on device: GPE1
gpiochip_add: registered GPIOs 62 to 69 on device: GPF0
gpiochip_add: registered GPIOs 71 to 78 on device: GPF1
gpiochip_add: registered GPIOs 80 to 87 on device: GPF2
gpiochip_add: registered GPIOs 89 to 94 on device: GPF3
gpiochip_add: registered GPIOs 96 to 102 on device: GPG0
gpiochip_add: registered GPIOs 104 to 110 on device: GPG1
gpiochip_add: registered GPIOs 112 to 118 on device: GPG2
gpiochip_add: registered GPIOs 120 to 126 on device: GPG3
gpiochip_add: registered GPIOs 164 to 170 on device: GPI
gpiochip_add: registered GPIOs 172 to 179 on device: GPJ0
gpiochip_add: registered GPIOs 181 to 186 on device: GPJ1
gpiochip_add: registered GPIOs 188 to 195 on device: GPJ2
gpiochip_add: registered GPIOs 197 to 204 on device: GPJ3
gpiochip_add: registered GPIOs 206 to 210 on device: GPJ4
gpiochip_add: registered GPIOs 212 to 219 on device: MP01
gpiochip_add: registered GPIOs 221 to 224 on device: MP02
gpiochip_add: registered GPIOs 226 to 233 on device: MP03
gpiochip_add: registered GPIOs 235 to 242 on device: MP04
gpiochip_add: registered GPIOs 244 to 251 on device: MP05
gpiochip_add: registered GPIOs 128 to 135 on device: GPH0
gpiochip_add: registered GPIOs 137 to 144 on device: GPH1
gpiochip_add: registered GPIOs 146 to 153 on device: GPH2
gpiochip_add: registered GPIOs 155 to 162 on device: GPH3
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S5PV210: Initializing architecture
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switching to clocksource s5p_clocksource_timer
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 6, 327680 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 12288 bytes)
UDP-Lite hash table entries: 256 (order: 1, 12288 bytes)
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NFS: Registering the id_resolver key type
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
start plist test
end plist test
dma-pl330 dma-pl330.0: Loaded driver for PL330 DMAC-267056
dma-pl330 dma-pl330.0:  DBUFF-8x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
dma-pl330 dma-pl330.1: Loaded driver for PL330 DMAC-267056
dma-pl330 dma-pl330.1:  DBUFF-8x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s5pv210-uart.0: ttySAC0 at MMIO 0xe2900000 (irq = 74) is a S3C6400/10
console [ttySAC0] enabled
s5pv210-uart.1: ttySAC1 at MMIO 0xe2900400 (irq = 75) is a S3C6400/10
s5pv210-uart.2: ttySAC2 at MMIO 0xe2900800 (irq = 76) is a S3C6400/10
s5pv210-uart.3: ttySAC3 at MMIO 0xe2900c00 (irq = 77) is a S3C6400/10
brd: module loaded
loop: module loaded
smsc911x: Driver version 2008-10-21
smsc911x-mdio: probed
smsc911x smsc911x.0: eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=smsc911x-0:01, irq=-1)
smsc911x smsc911x.0: eth0: MAC Address: 52:34:5e:da:09:0f
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
smsc911x smsc911x.0: eth0: SMSC911x/921x identified at 0xa0814000, IRQ: 41
IP-Config: Cannot add default route (-101)
VFS: Mounted root (nfs filesystem) on device 0:9.
Freeing init memory: 124K

Processing /etc/profile... Done

/ #


如果想在非nfs根文件系统在挂在nfs,做如下修改即可:

在etc/init.d/rcS

添加:

mount -t nfs -o nolock 192.168.56.12:/work /mnt

切记一定要加上  “-o nolock”,否则不能挂在成功。


这样,就可以在PC端编译代码,在arm端直接访问,安装,方便调试。




  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值