2. 给内核打上yaffs补丁,使内核对yaffs的支持 #tar -zxvf cvs-root.tar.gz
#cd cvs/yaffs2/
#./patch-ker.sh c /root/my2440/linux-2.6.30.4/ 3. 配置内核,使其对yaffs2文件系统的支持。配置完后重新编译内核,下载到开发板上 File systems --->
< > Second extended fs support
< > Ext3 journalling file system support
< > The Extended 4 (ext4) filesystem
< > Reiserfs support
< > JFS filesystem support
< > XFS filesystem support
< > OCFS2 file system support
< > Btrfs filesystem (EXPERIMENTAL) Unstable disk format
[*] Enable POSIX file locking API
[*] Dnotify support
[*] Inotify file change notification support
[*] Inotify support for userspace
[ ] Quota support
Kernel automounter support
Kernel automounter version 4 support (also supports v3)
FUSE (Filesystem in Userspace) support
Caches --->
CD-ROM/DVD Filesystems --->
<*> ISO 9660 CDROM file system support
[ ] Microsoft Joliet CDROM extensions
[ ] Transparent decompression extension
< > UDF file system support
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(437) Default codepage for FAT
(iso8859-1) Default iocharset for FAT
< > NTFS file system support
Pseudo filesystems --->
[*] Miscellaneous filesystems --->
--- Miscellaneous filesystems
< > ADFS file system support (EXPERIMENTAL)
< > Amiga FFS file system support (EXPERIMENTAL)
< > Apple Macintosh file system support (EXPERIMENTAL)
< > Apple Extended HFS file system support
< > BeOS file system (BeFS) support (read only) (EXPERIMENTAL)
< > BFS file system support (EXPERIMENTAL)
< > EFS file system support (read only) (EXPERIMENTAL)
<*> YAFFS2 file system support
-*- 512 byte / page devices
[ ] Use older-style on-NAND data format with pageStatus byte
[ ] Lets Yaffs do its own ECC
-*- 2048 byte (or larger) / page devices
[*] Autoselect yaffs2 format
[ ] Disable lazy loading
[ ] Turn off wide tnodes
[ ] Force chunk erase check
[*] Cache short names in RAM
<*> Journalling Flash File System v2 (JFFS2) support
(0) JFFS2 debugging verbosity (0 = quiet, 2 = noisy)
[*] JFFS2 write-buffering support
[ ] Verify JFFS2 write-buffer reads
[*] JFFS2 summary support (EXPERIMENTAL)
[ ] JFFS2 XATTR support (EXPERIMENTAL)
[ ] Advanced compression options for JFFS2
<*> Compressed ROM file system support (cramfs)
SquashFS 4.0 - Squashed file system support
[ ] Additional option for memory-constrained systems
< > FreeVxFS file system support (VERITAS VxFS(TM) compatible)
< > Minix file system support
< > SonicBlue Optimized MPEG File System support
< > OS/2 HPFS file system support
< > QNX4 file system support (read only)
<*> ROM file system support
RomFS backing stores (Block device-backed ROM file system support) --
< > System V/Xenix/V7/Coherent file system support
< > UFS file system support (read only)
< > NILFS2 file system support (EXPERIMENTAL)
[*] Network File Systems --->
Partition Types --->
-*- Native language support --->
< > Distributed Lock Manager (DLM) --->
大概164行改成CROSS_COMPILE = arm-linux- ,189行改成ARCH = arm 2)配置busybox选项,下面只列出了要注意的地方,没有列出的默认即可 #make menuconfig
Busybox Settings --->
General Configuration --->
Buffer allocation policy (Allocate with Malloc) --->
[*] Show verbose applet usage messages
[*] Store applet usage messages in compressed form
[*] Support --install [-s] to install applet links at runtime
[*] Enable locale support (system needs locale for this to work)
[*] Support for --long-options
[*] Use the devpts filesystem for Unix98 PTYs
[*] Support writing pidfiles
[*] Runtime SUID/SGID configuration via /etc/busybox.conf
[*] Suppress warning message if /etc/busybox.conf is not readable
(/proc/self/exe) Path to BusyBox executable
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)
[*] Build with Large File Support (for accessing files > 2 GB)
Installation Options --->
[ ] Don't use /usr
Applets links (as soft-links) --->
(./_install) BusyBox installation prefix
Busybox Library Tuning --->
(6) Minimum password length
(2) MD5: Trade Bytes for Speed
[*] Faster /proc scanning code (+100 bytes)
[*] Command line editing
(1024) Maximum length of input
[*] vi-style line editing commands
(15) History size
[*] History saving
[*] Tab completion
[*] Fancy shell prompts
(4) Copy buffer size, in kilobytes
[*] Use ioctl names rather than hex values in error messages
[*] Support infiniband HW
Linux Module Utilities --->
(/lib/modules) Default directory containing modules
(modules.dep) Default name of modules.dep
[*] insmod
[*] rmmod
[*] lsmod
[*] modprobe
--- Options common to multiple modutils
[ ] Support version 2.2/2.4 Linux kernels
[*] Support tainted module checking with new kernels
[*] Support for module.aliases file
[*] Support for module.symbols fileLinux System Utilities ---> 3)编译和安装busybox,安装完后会在busybox-1.13.0/_install/目录下生成:bin、linuxrc、sbin、usr #make
#make install
5. 开始构建文件系统 1)新建一个目录root-2.6.30.4,把busybox-1.13.0/_install/目录下生成:bin、linuxrc、sbin、usr复制过来,并且在该目录下创建文件系统所需要的其他目录 #mkdir root-2.6.30.4
#cp -rf busybox-1.13.0/_install/* root-2.6.30.4/
#cd root-2.6.30.4/
#mkdir dev etc home lib mnt opt proc tmp var www
2)向各目录中添加文件系统所需要的目录或文件,没有提到的就不用添加。这里要注意各种文件的权限,建议都改为777,命令:#chmod 777 文件名"dev"目录,创建两个设备文件: #mknod console c 5 1
#mknod null c 1 3
rc.d/init.d/httpd: 内容如下: #!/bin/shbase=boa# See how we were called.
case "$1" in
start)
/usr/sbin/$base
;;
stop)
pid=`/bin/pidof $base`
if [ -n "$pid" ]; then
kill -9 $pid
fi
;;
esacexit 0