分类: LINUX
2008-04-22 21:22:27
Linux 2.6.24.4移植到S3C2410之:建立nfs根文件系统(busybox1.9.2)
基础上,制作cramfs,过程很简答~简要介绍一下.
首先从下载cramfs-1.1.tar.gz
解压 $tar zxvf cramfs-1.1.tar.gz
编译 $make
在 cramfs-1.1目录下会出现两个bin文件mkcramfs和cramfsck
把他们copy到/usr/bin: $sudo cp mkcramfs cramfsck /usr/bin
之前做的根文件系统位于 /nano2410/root目录中
[kevin@localhost nano2410]$ sudo mkcramfs root kevin-cramfs.img
Directory data: 6404 bytes
Everything: 1636 kilobytes
Super block: 76 bytes
CRC: ddc862c4
warning: gids truncated to 8 bits (this may be a security concern)
目前用的nfs加载根文件系统,可以在把生成的kevin-cramfs.img copy到/root中,然后在目标板linux环境中烧录文件kevin-cramfs.img到mtdblock2
.......
启动linux,通过nfs方式加载根文件系统
/
$ ls -l /dev/mtd*
crw-rw---- 1 root root 90, 0 Jan 1 00:00 /dev/mtd0
crw-rw---- 1 root root 90, 1 Jan 1 00:00 /dev/mtd0ro
crw-rw---- 1 root root 90, 2 Jan 1 00:00 /dev/mtd1
crw-rw---- 1 root root 90, 3 Jan 1 00:00 /dev/mtd1ro
crw-rw---- 1 root root 90, 4 Jan 1 00:00 /dev/mtd2
crw-rw---- 1 root root 90, 5 Jan 1 00:00 /dev/mtd2ro
crw-rw---- 1 root root 90, 6 Jan 1 00:00 /dev/mtd3
crw-rw---- 1 root root 90, 7 Jan 1 00:00 /dev/mtd3ro
brw-rw---- 1 root root 31, 0 Jan 1 00:00 /dev/mtdblock0
brw-rw---- 1 root root 31, 1 Jan 1 00:00 /dev/mtdblock1
brw-rw---- 1 root root 31, 2 Jan 1 00:00 /dev/mtdblock2
brw-rw---- 1 root root 31, 3 Jan 1 00:00 /dev/mtdblock3
烧录/下的kevin-cramfs.img到块设备文件/dev/mtdblock2
/
$ cat kevin-cramfs.img >/dev/mtdblock2
.....
ok,烧录成功~~ 当然也可以在uboot中烧录kevin-cramfs.img 到mtdblock2的起始位置.
下面在uboot中修改uboot命令行参数为.
kevin2410>$setenv bootargs console=ttySAC0,115200 root=/dev/mtdblock2 init=/linuxrc nfsroot=192.168.0.104:/nano2410/root ip=192.168.0.69:192.168.0.104:192.168.0.1:255.255.255.0:
kevin2410>$saveenv
kevin2410>$boot
启动信息...
......
IP-Config: Complete:
device=eth0, addr=192.168.0.69, mask=255.255.255.0, gw=192.168.0.1,
host=www, domain=, nis-domain=kevin.com,
bootserver=192.168.0.104, rootserver=192.168.0.104, rootpath=
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 124K
init started: BusyBox v1.9.2 (2008-04-01 21:32:34 CST)
......
cramfs加载成功~~~