使用Busybox-1.13.4制作cramfs文件系统详解

转载 2012年03月24日 21:51:16

1、先准备好工具:
(1)Busybox-1.13.4下载地址:
http://busybox.net/downloads/busybox-1.13.4.tar.bz2
(2)cramfs-1.1工具下载地址: http://download.sunplusedu.com/download/cramfs-1.1.tar.gz 或则去官网http://sourceforge.net/projects/cramfs/

2、解压cramfs工具(这里我放在了根目录下):

2、编译cramfs;

3、cramfs工具制作好了,接下来我们解压Busybox。

4、对Busybox进行配置,运行make menuconfig命令

# make menuconfig

这里咱们只配置一下静态就可以了。

然后保存,退出。

5、然后执行命令:make install

注:编译“networking/interface.c”文件时可能会出现以下错误:
CC networking/interface.o
networking/interface.c:818: error: 'ARPHRD_INFINIBAND' undeclared here (not in a function)
make[1]: *** [networking/interface.o] Error 1
make: *** [networking] Error 2
通过查看内核源代码目录中的“include/linux/ifarp.h”文件可得知“ARPHRDINFINIBAND”的值为“32”,然后修改“networking/interface.c”文件,在其中添加:
#define ARPHRD_INFINIBAND 32 /* InfiniBand */

5、最后看到下面结果就Ok啦!

6、建立文件系统所需的目录和文件。

$ mkdir bin dev etc home lib mnt proc sbin sys tmp var usr

并且拷贝_install下面的四个文件到该目录下。

7、以root身份建立节点文件/dev/console, /dev/null

mknod -m 600 dev/console c 5 1

mknod -m 666 dev/null c 1 3

8. 建立配置文件如下:

[etc]# vi profile

#!/bin/sh

#/etc/profile:system-wide .profile file for the Bourne shells

echo

echo -n "Processing /etc/profile......"

# Set search library path

export LD_LIBRARY_PATH=/lib:/usr/lib

# set user path

export PATH=/bin:/sbin:/usr/bin:/usr/sbin

#Set PS1

USER = "`id -un`"

LOGNAME=$USER

PS1='[\u@\h\W]\$' //这里很好玩的你可以把\u换乘你的用户名比如,@后面也可以跟上计算机名

PATH=$PATH

echo "Done!"

[etc]# vi init.d/rcS

#!/bin/sh

# set hostname, needed host file in /etc directory

#./etc/host

#hostname `cat /etc/host`

# mount all filesystem defined in "fstab"

echo "#mount all......."

#/bin/mount -a

#/bin/chmod 0666 /dev/null

echo "# starting mdev...."

#/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug

mdev -s

/bin/sh

[etc]# ls

fstab host inittab passwd shadow

group init.d/ mdev.conf profile

[etc]# vi fstab

proc /proc proc defaults 0 0

none /tmp ramfs defaults 0 0

none /var ramfs defaults 0 0

mdev /dev ramfs defaults 0 0

sysfs /sys sysfs defaults 0 0

[etc]# vi inittab

::sysinit:/etc/init.d/rcS

::respawn:-/bin/sh

::ctrlaltdel:/bin/umount -a -r

::shutdown:/bin umount -a -r

::shutdown:/sbin/swapoff -a

[etc]# vi ../usr/etc/init

#!/bin/sh

ifconfig eth0 192.168.1.111 up

ifconfig lo 127.0.0.1

9.建立文件/etc/mdev.conf,内容为空

[etc]# vi mdev.conf

10.复制主机/etc/下面的文件passwd, group, shadow文件到etc目录(这一步也可以不做)

[etc]# cp /etc/group .

[etc]# cp /etc/passwd .

[etc]# cp /etc/shadow .

ok,所需要的文件都已经建立ok

[etc]# ls

fstab group host init.d inittab mdev.conf passwd profile shadow

启动后:

u-boot(armzone)=> bootm
## Booting image at 30008000 ...
Image Name: linux-2.6.25
Created: 2009-05-26 7:42:53 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1628180 Bytes = 1.6 MB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum ... OK
XIP Kernel Image ... OK
boot linux

Starting kernel ...

Uncompressing Linux.......................................................................................................... done, booting the kernel.
Linux version 2.6.25.8 (
root@localhost.localdomain) (gcc version 3.4.1) #8 Tue May 26 15:40:29 CST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177
Machine: SMDK2410
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
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: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200 mem=64M
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
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: 61440KB available (3004K code, 304K data, 140K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 152 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2410: Initialising architecture
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
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 c48000c0, irq 36
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)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
yaffs May 25 2009 19:50:02 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22
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
s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.30
Uniform Multi-Platform E-IDE driver
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
BAST NOR-Flash Driver, (c) 2004 Simtec Electronics
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand s3c2410-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
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
Bad eraseblock 2401 at 0x02584000
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00100000 : "Boot"
0x00100000-0x00300000 : "kernel"
0x00300000-0x02c00000 : "root"
0x02c00000-0x04000000 : "usr"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-i2c s3c2410-i2c: slave address 0x10
s3c2410-i2c s3c2410-i2c: bus frequency set to 99 KHz
s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 140K
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^ Welcome to CRAMFS root filesystem! ^
^ CWT ^
^^^^^^^^^^^^^^^^09-5-21^^^^^^^^^^^^^^^^^^^^
hostname: can't open '/etc/host': No such file or directory
ln: /dev/tty1: File exists
#mount all.......
mount: mounting none on /dev/pts failed: No such file or directory
mount: mounting tmpfs on /dev/shm failed: No such file or directory

Please press Enter to activate this console.

相关文章推荐

linux中模块的增添和删除

1.       编辑源代码在用户目录(我的是popozhu)下建立一个hello文件夹,在文件夹下新建一个hello.c。输入以下代码:#include #include #include ...
  • popozhu
  • popozhu
  • 2010年06月28日 20:18
  • 2543

U-BOOT移植过程详解: u-boot.bin

申明   本着学习交流的原则, 将个人移植u-boot的过程做一个记录. 文章参考了csdn blog里面的很多内容, 有的已经记不得出处了, 只好把当时的摘要直接贴出来. 如果冒犯, 还请见谅. 如...

使用Busybox制作Cramfs根文件系统.

  • 2013年12月16日 19:43
  • 285KB
  • 下载

使用Busybox制作CRAMFS文件系统成功

这几天在使用Busybox制作FS2410开发板的CRAMFS文件系统,由于开始 下载的是Busybox1.10,每次下载到开发板中,然后启动总是出现”Failed to execute /linux...

使用BusyBox制作linux根文件系统(CramFS+mdev)

操作系统:Ubuntu9.04 内核版本:linux-2.6.24.7   开发板:博创arm2410s     交叉编译工具:arm-linux-gcc-4.1.1  Bus...

使用Busybox构造cramfs根文件系统

使用Busybox构造cramfs根文件系统   11.1、下载Busybox,如果系统中没有mkcramfs工具则还要下载mkcramfs压缩工具。本文件系统使用Busybox-1.10....
  • maopig
  • maopig
  • 2012年03月03日 16:44
  • 1190

使用Busybox制作根文件系统

  • 2010年03月19日 20:02
  • 145KB
  • 下载

制作CRAMFS + YAFFS2文件系统

1.文件系统简述 随着32位CPU价格不断下跌,片上存储设备的容量相比越来越大,越来越多的嵌入式系统开始应用各种嵌入式操作系统。一般在嵌入式领域,只要应用到操作系统的必然会需要一个,甚至是多个文件系统...

制作cramfs根文件系统的步骤

  • 2011年05月19日 15:23
  • 15KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:使用Busybox-1.13.4制作cramfs文件系统详解
举报原因:
原因补充:

(最多只允许输入30个字)