分类: LINUX
2008-11-28 15:36:49
[root@vm-dev root]# vi /etc/exports
/opt/lyj 192.168.1.*(rw,insecure,sync,no_root_squash)
/opt/develop/lyj/common/porting/rootfs/root_stand/reset/rootfs 192.168.1.*(rw,insecure,sync,no_root_squash)
[root@vm-dev root]# service nfs restart
2、在Bootloader中传递以下参数给Kernel:
root=/dev/nfs rw nfsroot=192.168.1.152:/opt/develop/lyj/common/porting/rootfs/root_stand/reset/rootfs ip=192.168.1.155:192.168.1.152:192.168.1.254:255.255.255.0:Jacky:eth0:off console=ttySAC0,115200 init=/linuxrc noinitrd
3、启动目标板,串口输出显示根文件系统已经加载成功:
U-Boot
DRAM: 64 MB
Flash: 512 kB
NAND: 64 MiB
In: serial
Out: serial
Err: serial
Found DM9000 ID:
DM9000 work in 16 bus width
bd->bi_entaddr: 08:00:3e:26:
[eth_init]MAC:8:0:3e:26:a:5b:
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x80000, size 0x1b0000
1769472 bytes read: OK
## Booting image at 30008000 ...
Image Name: Linux-
Created: 2016-11-27 7:24:11 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1697964 Bytes = 1.6 MB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum ... OK
test:hdr->ih_type:2
test:hdr->ih_comp:0
XIP Kernel Image ... OK
test:hdr->ih_type:2
test:hdr->ih_os:5
Starting kernel ...
test:machid:805306624
test: bi_boot_params:0x
test:starting 1
Uncompressing Linux............................................................................................................ done, booting the kernel.
Linux version
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177
Machine: SMDK2410
Memory policy: ECC disabled, Data cache writeback
CPU S
S
S
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.152:/opt/develop/lyj/common/porting/rootfs/root_stand/reset/rootfs ip=192.168.1.155:192.168.1.152:192.168.1.254:255.255.255.0:Jacky:eth0:off console=ttySAC0,115200 init=/linuxrc noinitrd
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61324KB available (3088K code, 316K data, 132K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 64 bytes
NET: Registered protocol family 16
S
S
S
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
yaffs Nov 27 2008 09:58:27 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 80x30
fb0: s
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s
s
s
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
DM9000: dm9k_init_module
Board init for dm
eth0: at 0xc480e000 IRQ 18
eth0: Ethernet addr: 08:00:3e:26:
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
Driver 'sd' needs updating - please use bus_type methods
S
s
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00080000 : "Boot Agent"
0x00080000-0x00280000 : "S
0x00280000-0x00680000 : "S
0x00680000-0x04000000 : "user"
usbmon: debugfs is not available
116x: driver isp116x-hcd, 03 Nov 2005
s
s
s
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
s
input: s
S
s
s
i
s
s
s
S
s
TCP cubic registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
s
IP-Config: Complete:
device=eth0, addr=192.168.1.155, mask=255.255.255.0, gw=192.168.1.254,
host=Jacky, domain=, nis-domain=(none),
bootserver=192.168.1.152, rootserver=192.168.1.152, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.152
Looking up port of RPC 100005/1 on 192.168.1.152
VFS: Mounted root (nfs filesystem).
Freeing init memory: 132K
init started: BusyBox v
starting pid 785, tty '': '/etc/init.d/rcS'
Processing etc/init.d/rc.S
Mount all
Start mdev....
****************************************************
rootfs by NFS, s
Created by lyj_uptech @ 2008.11.28
Good Luck
****************************************************
Please press Enter to activate this console.
starting pid 790, tty '': '-/bin/sh'
Processing /etc/profile... Done
Processing /etc/profile
Set search library path
Set user path
Set PS1
All done!
[root@up-tech /]# ls
bin dev home linuxrc proc sbin tmp var
boot etc lib mnt root sys usr
[root@up-tech /]#
已经直接进入了nfs文件系统!
MSN:
注1:busybox的最新版本中添加了许多新的功能,诸如sendmail之类,本人还要经过测试!
这篇文章只是构建最简单的根文件系统,并没有什么特殊的功能,如果要制作一个完整的根文件系统,可以参考LSS工程。另外我也在着手制作一个相对完善的根文件系统,见后续的文章。