继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.txt
DOC BusyBox.1
DOC BusyBox.html
[email protected]:~/work/source/busybox-1.1
c.安装
[email protected]:~/work/source/busybox-1.13.3$ make install
..........
/home/freescale/work/source/fs_mini/usr/sbin/telnetd -> ../../bin/busybox
/home/freescale/work/source/fs_mini/usr/sbin/udhcpd -> ../../bin/busybox
--------------------------------------------------
You will probably need to make your busybox binary
setuid root to ensure all configured applets will
work properly.
--------------------------------------------------
[email protected]:~/work/source/busybox-1.13.3$
(2)安装glibc库
[email protected]:~/work/source/busybox-1.13.3$ cd ..
[email protected]:~/work/source$ mkdir fs_mini/lib
[email protected]:~/work/source$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/freescale/work/tools/freescale-2010.09/bin
[email protected]:~/work/source$ cp /home/freescale/work/tools/freescale-2010.09/powerpc-linux-gnu/libc/te500v2/lib/*so* /home/freescale/work/source/fs_mini/lib -d
[email protected]:~/work/source$ mkdir fs_mini/usr/lib -p
[email protected]:~/work/source$ cp /home/freescale/work/tools/freescale-2010.09/powerpc-linux-gnu/libc/te500v2/usr/lib/*so* /home/freescale/work/source/fs_mini/usr/lib -d
[email protected]:~/work/source$
(3)构建etc目录
[email protected]:~/work/source/nfs_root/rootfs_dir$ mkdir etc
[email protected]:~/work/source/nfs_root/rootfs_dir$ vim etc/inittab
console::askfirst:-/bin/sh
::sysinit:/etc/init.d/rcS
保存退出
[email protected]:~/work/source/nfs_root/rootfs_dir$ vim etc/init.d/rcS
#!/bin/sh
ifconfig eth0 172.16.1.111
mount-a
[email protected]:~/work/source/nfs_root/rootfs_dir$ chmod +x etc/init.d/rcS
[email protected]:~/work/source/nfs_root/rootfs_dir$ vim etc/fstab
proc /proc proc defaults 0 0
(4)构建dev目录
[email protected]:~/work/source/fs_mini$ ls -l /dev/console /dev/null
crw------- 1 root root 5, 1 2015-05-18 14:28 /dev/console
crw-rw-rw- 1 root root 1, 3 2015-05-18 14:28 /dev/null
[email protected]:~/work/source/fs_mini$ sudo mknod dev/console c 5 1
[email protected]:~/work/source/fs_mini$ sudo mknod dev/null c 1 3
(5)创建其他目录
[email protected]:~/work/source/fs_mini$ mkdir proc tmp mnt sys root
[email protected]:~/work/source/fs_mini$
2.制作文件系统镜像文件
安装genext2fs,参考install文档,安装如下:
To install, just do it the normal GNU way:
./configure
make
make install
[email protected]:~/work/tools/genext2fs-1.4.1$ sudo make instal
[email protected]:~/work/source$ genext2fs -b 4096 -d fs_mini fs_mini_ramdisk
genext2fs: couldn‘t allocate a block (no free space)
[email protected]:~/work/source$ genext2fs -b 8192 -d fs_mini fs_mini_ramdisk
genext2fs: couldn‘t allocate a block (no free space)
这个错误的原因是给的大小太小了,需要把大小增大,查看手册只是说了 “size of the image in blocks”,
这样 于是便先使用 du -h rootfs,计算出来
[email protected]:~/work/source$ du -h fs_mini
1.9M fs_mini/bin
4.5M fs_mini/lib
4.0K fs_mini/tmp
4.0K fs_mini/sys
4.0K fs_mini/mnt
4.0K fs_mini/usr/bin
1.7M fs_mini/usr/lib
4.0K fs_mini/usr/sbin
1.7M fs_mini/usr
4.0K fs_mini/root
4.0K fs_mini/dev
4.0K fs_mini/sbin
4.0K fs_mini/proc
8.0M fs_mini
[email protected]:~/work/source$ genext2fs -b 10240 -d fs_mini fs_mini_ramdisk
[email protected]:~/work/source$
3.修改p1010rdb.dtb 配置文件
p1010rdb.dtb 配置文件,用于linux传参数
/home/freescale/work/source/linux-2.6.35-r2/arch/powerpc/boot/dts/p1010rdb.dts
/home/freescale/work/source/linux-2.6.35-r2/scripts/dtc/dtc
/home/freescale/work/source/linux-2.6.35-r2/p1010rdb.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 = 2919575 (2c8c97 hex)
=> tftp 0x2000000 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: 0x2000000
Loading: #
done
Bytes transferred = 12994 (32c2 hex)
=> tftp 0x3000000 rootfs.ext2.gz.u-boot
Speed: 100, full duplex
Using eTSEC2 device
TFTP from server 192.168.2.242; our IP address is 192.168.2.21
Filename ‘rootfs.ext2.gz.u-boot‘.
Load address: 0x3000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
################################################################
done
Bytes transferred = 4745428 (4868d4 hex)
=> bootm 0x1000000 0x3000000 0x2000000
WARNING: adjusting available memory to 30000000
## Booting kernel from Legacy Image at 01000000 ...
Image Name: Linux-2.6.35
Created: 2015-05-24 2:26:09 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 2919511 Bytes = 2.8 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 03000000 ...
Image Name: fsl-image-minimal-p2020rdb-20140
Created: 2014-01-24 6:44:46 UTC
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 4745364 Bytes = 4.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Uncompressing Kernel Image ... OK
Loading Ramdisk to 2fb79000, end 2ffff894 ... OK
Loading Device Tree to 00ff9000, end 00fff2c1 ... OK
WARNING: could not find compatiblenode fsl-usb2-dr: FDT_ERR_NOTFOUND.
Using P1010 RDB machine description
Memory CAM mapping: 256/256/256 Mb, residual: 256Mb
Linux version 2.6.35 ([email protected]) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-55) ) #1 Sun May 24 10:25:50 CST 2015
Found initrd at 0xefb79000:0xeffff894
bootconsole [udbg0] enabled
setup_arch: bootmem
p1010_rdb_setup_arch()
Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: 0->255
PCI host bridge /[email protected] ranges:
MEM 0x00000000a0000000..0x00000000bfffffff -> 0x00000000a0000000
IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000
/[email protected]: PCICSRBAR @ 0xfff00000
Found FSL PCI host bridge at 0x00000000ffe0a000. Firmware bus number: 0->255
PCI host bridge /[email protected] ranges:
MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000
IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000
/[email protected]: PCICSRBAR @ 0xfff00000
P1010 RDB board from Freescale Semiconductor
arch: exit
Zone PFN ranges:
DMA 0x00000000 -> 0x00030000
Normal empty
HighMem 0x00030000 -> 0x00040000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00040000
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260096
Kernel command line:
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1028772k/1048576k available (5700k kernel code, 19804k reserved, 216k data, 164k bss, 212k init)
Kernel virtual memory layout:
* 0xfffcf000..0xfffff000 : fixmap
* 0xff800000..0xffc00000 : highmem PTEs
* 0xff7d8000..0xff800000 : early ioremap
* 0xf1000000..0xff7d8000 : vmalloc & ioremap
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:512 nr_irqs:512
mpic: Setting up MPIC " OpenPIC " version 1.2 at ffe40000, max 1 CPUs
mpic: ISU size: 256, shift: 8, mask: ff
mpic: Initializing for 256 sources
clocksource: timebase mult[5000000] shift[22] registered
Console: colour dummy device 80x25
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
pci 0000:00:00.0: ignoring class b20 (doesn‘t match header type 01)
pci 0000:00:00.0: PCI bridge to [bus 01-ff]
pci 0001:02:00.0: ignoring class b20 (doesn‘t match header type 01)
pci 0001:02:00.0: PCI bridge to [bus 03-ff]
pci 0000:00:00.0: not setting up bridge for bus 0000:01
pci 0001:02:00.0: not setting up bridge for bus 0001:03
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Freescale Elo / Elo Plus DMA driver
Advanced Linux Sound Architecture Driver Version 1.0.23.
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 4634k freed
fsl-elo-dma ffe21300.dma: #0 (fsl,eloplus-dma-channel), irq 20
fsl-elo-dma ffe21300.dma: #1 (fsl,eloplus-dma-channel), irq 21
fsl-elo-dma ffe21300.dma: #2 (fsl,eloplus-dma-channel), irq 22
fsl-elo-dma ffe21300.dma: #3 (fsl,eloplus-dma-channel), irq 23
audit: initializing netlink socket (disabled)
type=2000 audit(0.188:1): initialized
highmem bounce pool size: 64 pages
Installing knfsd (copyright (C) 1996 [email protected]).
NTFS driver 2.1.29 [Flags: R/O].
msgmni has been set to 1506
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Generic non-volatile memory driver v1.1
Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0xffe04500 (irq = 42) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
serial8250.0: ttyS1 at MMIO 0xffe04600 (irq = 42) is a 16550A
brd: module loaded
loop: module loaded
nbd: registered device at major 43
fsl_pm.ko: loading ...
fsl_pm.ko: no SoC node, ignoring
fsl_pm.ko: hal initialisation
st: Version 20081215, fixed bufsize 32768, s/g segs 256
fsl-sata ffe18000.sata: Sata FSL Platform/CSB Driver init
scsi0 : sata_fsl
ata1: SATA max UDMA/133 irq 74
fsl-sata ffe19000.sata: Sata FSL Platform/CSB Driver init
scsi1 : sata_fsl
ata2: SATA max UDMA/133 irq 41
fsl-espi ffe07000.spi: Freescale eSPI Controller driver at 0xf1054000 (irq = 59)
fsl_m25p80 spi32766.0: unrecognized JEDEC id 1f2701
fsl-espi ffe07000.spi: chipselect 0 already in use
spi_master spi32766: spi_device register error /[email protected]/[email protected]00/[email protected]
Fixed MDIO Bus: probed
e1000e: Intel(R) PRO/1000 Network Driver - 1.0.2-k4
e1000e: Copyright (c) 1999 - 2009 Intel Corporation.
/proc/ptp_1588 created
IEEE1588: ptp-timer devicepresent in the system
IEEE1588: ptp-timer initialized
eth0: Gianfar Ethernet Controller Version 1.4-skbr1.1.5, 00:04:9f:ef:01:01
eth0: Running with NAPI enabled
eth0: RX BD ring size for Q[0]: 128
eth0: RX BD ring size for Q[1]: 128
eth0: RX BD ring size for Q[2]: 128
eth0: RX BD ring size for Q[3]: 128
eth0: RX BD ring size for Q[4]: 128
eth0: RX BD ring size for Q[5]: 128
eth0: RX BD ring size for Q[6]: 128
eth0: RX BD ring size for Q[7]: 128
eth0: TX BD ring size for Q[0]: 128
eth0: TX BD ring size for Q[1]: 128
eth0: TX BD ring size for Q[2]: 128
eth0: TX BD ring size for Q[3]: 128
eth0: TX BD ring size for Q[4]: 128
eth0: TX BD ring size for Q[5]: 128
eth0: TX BD ring size for Q[6]: 128
eth0: TX BD ring size for Q[7]: 128
IEEE1588: ptp-timer devicepresent in the system
IEEE1588: ptp-timer initialized
eth1: Gianfar Ethernet Controller Version 1.4-skbr1.1.5, 00:04:9f:ef:01:02
eth1: Running with NAPI enabled
eth1: RX BD ring size for Q[0]: 128
eth1: RX BD ring size for Q[1]: 128
eth1: RX BD ring size for Q[2]: 128
eth1: RX BD ring size for Q[3]: 128
eth1: RX BD ring size for Q[4]: 128
eth1: RX BD ring size for Q[5]: 128
eth1: RX BD ring size for Q[6]: 128
eth1: RX BD ring size for Q[7]: 128
eth1: TX BD ring size for Q[0]: 128
eth1: TX BD ring size for Q[1]: 128
eth1: TX BD ring size for Q[2]: 128
eth1: TX BD ring size for Q[3]: 128
eth1: TX BD ring size for Q[4]: 128
eth1: TX BD ring size for Q[5]: 128
eth1: TX BD ring size for Q[6]: 128
eth1: TX BD ring size for Q[7]: 128
IEEE1588: ptp-timer devicepresent in the system
IEEE1588: ptp-timer initialized
eth2: Gianfar Ethernet Controller Version 1.4-skbr1.1.5, 00:04:9f:ef:01:03
eth2: Running with NAPI enabled
eth2: RX BD ring size for Q[0]: 128
eth2: RX BD ring size for Q[1]: 128
eth2: RX BD ring size for Q[2]: 128
eth2: RX BD ring size for Q[3]: 128
eth2: RX BD ring size for Q[4]: 128
eth2: RX BD ring size for Q[5]: 128
eth2: RX BD ring size for Q[6]: 128
eth2: RX BD ring size for Q[7]: 128
eth2: TX BD ring size for Q[0]: 128
eth2: TX BD ring size for Q[1]: 128
eth2: TX BD ring size for Q[2]: 128
eth2: TX BD ring size for Q[3]: 128
eth2: TX BD ring size for Q[4]: 128
eth2: TX BD ring size for Q[5]: 128
eth2: TX BD ring size for Q[6]: 128
eth2: TX BD ring size for Q[7]: 128
ucc_geth: QE UCC Gigabit Ethernet Controller
Freescale PowerQUICC MII Bus: probed
mdio_bus [email protected]: error probing PHY at address 1
mdio_bus [email protected]: error probing PHY at address 0
mdio_bus [email protected]: error probing PHY at address 2
Freescale PowerQUICC MII Bus: probed
Freescale PowerQUICC MII Bus: probed
ehci_hcd: USB 2.0 ‘Enhanced‘ Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
ulpi dump reg 0x31h=0x00003108
fsl-ehci fsl-ehci.0: irq 28, io base 0xffe22000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 ‘Open‘ Host Controller (OHCI) Driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i2c /dev entries driver
rtc-pt7c4338 0-0068: rtc core: registered pt7c4338 as rtc0
EDAC MC: Ver: 2.1.0 May 24 2015
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: SDHCI controller on ffe2e000.sdhci [ffe2e000.sdhci] using DMA
of_platform ffe01000.jr: failed to flush job queue 0
of_platform ffe02000.jr: failed to flush job queue 1
of_platform ffe03000.jr: failed to flush job queue 2
ata2: No Device OR PHYRDY change,Hstatus = 0xa0000000
ata2: SATA link down (SStatus 0 SControl 300)
ata1: No Device OR PHYRDY change,Hstatus = 0xa0000000
ata1: SATA link down (SStatus 0 SControl 300)
of_platform ffe04000.jr: failed to flush job queue 3
caam ffe30000.crypto: device ID = 0x0a14010000000000
caam ffe30000.crypto: job queues = 4
caam ffe30000.crypto: algapi error in job queue registration: -19
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
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
rtc-pt7c4338 0-0068: hctosys: unable to read the hardware clock
RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) readonly on device 1:0.
Freeing unused kernel memory: 212k init
INIT: version 2.88 booting
/etc/init.d/rcS: line 27: can‘t create /etc/hostname: Read-only file system
Starting udev
Missing devtmpfs, which is required for udev to run
Halting...
INIT: Sending phwclock: can‘t open ‘/dev/misc/rtc‘: No such file or directory
Stopping syslogd/klogd: no syslogd found; none killed
Deconfiguring network interfaces... ifdown: interface lo not configured
done.
Stopping Lighttpd Web Server: no /usr/sbin/lighttpd found; none killed
lighttpd.
Sending all processes the TERM signal...
Sending all processes the KILL signal...
/etc/init.d/rc: /etc/rc0.d/S25save-rtc.sh: line 13: can‘t create /etc/timestamp: Read-only file system
urandom stop: failed.
Unmounting remote filesystems...
Deactivating swap...
Unmounting local filesystems...
Power down.
System Halted, OK to turn off power
4.解决死机问题:
(1)配置kernel
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
重新编译kernel
(2)修改p1010rdb.dts
去掉nand 配置部分
根据报错去掉串口1、I2C,系统打印一大堆udevd[1170]: unable to receive ctrl connection: Function not implemented
跑起来了
p1010 login: root
[email protected]:~# cd /
[email protected]:/# ls
bin etc linuxrc mnt sbin usr
boot home lost+found proc sys var
dev lib media run tmp
5.配置phy,编译p1010rdb.dts文件
配置phy地址phy:6 phy2:4
phy0: [email protected] {
interrupt-parent = <&mpic>;
interrupts = <3 1>;
reg = <0x1>;
};
phy1: [email protected] {
interrupt-parent = <&mpic>;
interrupts = <2 1>;
reg = <0x6>;
};
phy2: [email protected] {
interrupt-parent = <&mpic>;
interrupts = <2 1>;
reg = <0x4>;
};
编译p1010rdb.dts
[email protected]:~/work/source/linux-2.6.35-r2$ make p1010rdb.dtb
/home/freescale/work/source/linux-2.6.35-r2/arch/powerpc/boot/Makefile:404: target `(copy).dts‘ doesn‘t match the target pattern
/home/freescale/work/source/linux-2.6.35-r2/scripts/dtc/dtc -O dtb -o arch/powerpc/boot/p1010rdb.dtb -b 0 -p 1024 /home/freescale/work/source/linux-2.6.35-r2/arch/powerpc/boot/dts/p1010rdb.dts
DTC: dts->dtb on file "/home/freescale/work/source/linux-2.6.35-r2/arch/powerpc/boot/dts/p1010rdb.dts"
[email protected]:~/work/source/linux-2.6.35-r2$
6.测试
[email protected]:/# ifconfig eth1 192.168.2.24
eth1: attached PHY driver [Generic PHY] (mii_bus:[email protected]:06, id=4dd074)
[email protected]:/# ifconfig
eth1 Link encap:Ethernet HWaddr 00:04:9F:EF:01:02
inet addr:192.168.2.24 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:85 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8123 (7.9 KiB) TX bytes:0 (0.0 B)
Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[email protected]:/# ping 192.168.2.242
PING 192.168.2.242 (192.168.2.242): 56 data bytes
64 bytes from 192.168.2.242: seq=0 ttl=64 time=3.684 ms
INIT: Id "2" respawning too fast: disabled for 5 minutes
INIT: Id "1" respawning too fast: disabled for 5 minutes
64 bytes from 192.168.2.242: seq=1 ttl=64 time=0.354 ms
64 bytes from 192.168.2.242: seq=2 ttl=64 time=0.325 ms
64 bytes from 192.168.2.242: seq=3 ttl=64 time=0.333 ms
64 bytes from 192.168.2.242: seq=4 ttl=64 time=0.340 ms
--- 192.168.2.242 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.325/1.007/3.684 ms
[email protected]:/# ifconfig eth2 172.16.2.24
eth2: attached PHY driver [Generic PHY] (mii_bus:[email protected]:04, id=4dd074)
[email protected]:/#
[email protected]:/# ifconfig
eth1 Link encap:Ethernet HWaddr 00:04:9F:EF:01:02
inet addr:192.168.2.24 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:454 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43411 (42.3 KiB) TX bytes:870 (870.0 B)
Base address:0xc000
eth2 Link encap:Ethernet HWaddr 00:04:9F:EF:01:03
inet addr:172.16.2.24 Bcast:172.16.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[email protected]:/# ping 172.16.1.242
PING 172.16.1.242 (172.16.1.242): 56 data bytes
64 bytes from 172.16.1.242: seq=0 ttl=64 time=2.901 ms
64 bytes from 172.16.1.242: seq=1 ttl=64 time=0.285 ms
64 bytes from 172.16.1.242: seq=2 ttl=64 time=0.289 ms
64 bytes from 172.16.1.242: seq=3 ttl=64 time=0.738 ms
--- 172.16.1.242 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.285/1.053/2.901 ms
[email protected]:/#
单板2个网卡都能ping通,linux系统基本跑起来了,下一步实现网络挂载文件系统。