Linux-2.6.28Yaffs文件系统制作 for FL2440

转自:http://blog.csdn.net/jacobywu/article/details/6844794

1.新建根目录

[plain]  view plain copy
  1. mkdir rootfs  

2.建立根目录下的子目录

[plain]  view plain copy
  1. cd rootfs  
  2. mkdir bin dev etc lib proc sbin sys usr mnt tmp var  
  3. mkdir usr/bin usr/lib usr/sbin lib/modules  

3.创建设备文件

[plain]  view plain copy
  1. cd /dev  
  2. mknod -m 666 consolec 5 1  
  3. mknod -m 666 nullc 1 3  

改变执行权限

[plain]  view plain copy
  1. chmod 777 *  

3.配置etc目录下文件及文件夹,必须对以下文件及文件夹都用chmod 777 *修改权限

新建group文件

内容如下:

[plain]  view plain copy
  1. root:*:0:  
  2. daemon:*:1:  
  3. bin:*:2:  
  4. sys:*:3:  
  5. adm:*:4:  
  6. tty:*:5:  
  7. disk:*:6:  
  8. lp:*:7:lp  
  9. mail:*:8:  
  10. news:*:9:  
  11. uucp:*:10:  
  12. proxy:*:13:  
  13. kmem:*:15:  
  14. dialout:*:20:  
  15. fax:*:21:  
  16. voice:*:22:  
  17. cdrom:*:24:  
  18. floppy:*:25:  
  19. tape:*:26:  
  20. sudo:*:27:  
  21. audio:*:29:  
  22. ppp:x:99:  
  23. 500:x:500:plg  
  24. 501:x:501:fa  

新建inittab文件

内容如下:

[plain]  view plain copy
  1. # /etc/inittab  
  2. ::sysinit:/etc/init.d/rcS  
  3. console::askfirst:-/bin/sh  
  4. ::ctrlaltdel:/sbin/reboot  
  5. ::shutdown:/bin/umount -a –r  


新建passwd文件

内容如下:

[plain]  view plain copy
  1. root::0:0:root:/:/bin/sh  
  2. ftp::14:15:FTP User:/var/ftp:  
  3. bin:*:1:1:bin:/bin:  
  4. daemon:*:2:2:daemon:/sbin:  
  5. nobody:*:99:99:Nobody:/:  
  6. jacob::502:502:Linux User,,,:/home/jacob:/bin/sh  
[plain]  view plain copy
  1.   

新建fstab系统挂载文件系统列表文件

内容如下:

[cpp]  view plain copy
  1. # device    mount-point type        options     dump        fsck order    
  2. none        /proc       proc        defaults    0           0  
  3. none        /dev/pts    devpts      mode=0622   0           0  
  4. tmpfs       /dev/shm    tmpfs       defaults    0           0  

新建init.d/rcS:系统启动加载项,内容如下:

[plain]  view plain copy
  1. #!/bin/sh  
  2.    
  3. PATH=/sbin:/bin:/usr/sbin:/usr/bin  
  4. runlevel=S  
  5. prevlevel=N  
  6. umask 022  
  7. export PATHrunlevel prevlevel  
  8.   
  9.    
  10. #  
  11. #    Trap CTRL-C &c only in this shell so we can interrupt subprocesses.  
  12. #  
  13. /bin/mount -t procnone /proc  
  14. /bin/mount -ttmpfs none /tmp  
  15. /bin/mount -ttmpfs none /var  
  16.    
  17. /bin/mkdir -p/var/log  
  18.    
  19. /bin/hostname -F/etc/sysconfig/HOSTNAME  

新建sysconfig/HOSTNAME文件

内容如下:

[plain]  view plain copy
  1. FL2440  

mkdir profile文件

内容如下:

[plain]  view plain copy
  1. #Ash profile  
  2. #vim: syntax=sh  
  3. #No core files by default  
  4. #ulimit -S -c 0 > /dev/null 2>&1  
  5. USER="'id -un'"  
  6. LOGNAME=$USER  
  7. PS1='[FL2440]#'  
  8. PATH=$PATH:/usr/local/bin  
  9. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib  
  10. HOSTNAME='/bin/hostname'  
  11. export USER LOGNAME PS1 PATH LD_LIBRARY_PATH  

新建resolv.conf文件,内容如下:

[cpp]  view plain copy
  1. nameserver 61.144.56.100  

"home"目录:创建一个 jacob目录,与etc目录passwd文件中的jacob相对应


"lib"目录:这个里面放的都是库文件,由于我的busybox是用静态链接,所以不用拷贝交叉编译器中库文件。

注意一个路径是这样的 /etc/init.d/rcS, rcS是文件

 

 

4.编译内核模块,内核配置如上。

进入内核根目录

[plain]  view plain copy
  1. make modules ARCH=arm CROSS_COMPILE=arm-linux-  

5.安装内核模块

[plain]  view plain copy
  1. make modules_install ARCH=arm INSTALL_MOD_PATH=/xxx/rootfs  

6.配置busybox(在busybox源代码中)

 进入busybox目录执行

     make menuconfig

[plain]  view plain copy
  1. Busybox Settings--->  
  2.     General Configuration --->  
  3.             Buffer allocation policy (Allocatewith Malloc) --->  
  4.         [*] Show verbose applet usage messages  
  5.         [*] Support --install [-s] to installapplet links at runtime  
  6.         [*] Enable locale support (system needslocale for this to work)  
  7.         [*] Support for devfs  
  8.         [*] Use the devpts filesystem forUnix98 PTYs  
  9.         [*] Runtime SUID/SGID configuration via/etc/busybox.conf  
  10.         [*] Suppress warning message if/etc/busybox.conf is not readable  
  11.         (/proc/self/exe) Path to BusyBox executable  
  12.     Build Options --->  
  13.         [*] Build BusyBox as a static binary(no shared libs)  //选中"Build busybox as a static binary",静态链接  
  14.    
  15.         [*] Build with Large File Support (foraccessing files > 2 GB)  
  16.               [*]Do you want to build BusyBoxwith a Cross Compiler?  
  17.               (arm-linux-) cross Compiler prefix   //  填写交叉编译前缀  
  18.     Installation Options --->  
  19.         [ *] Don't use /usr         //选中“Don'tuse /usr”,选中该项可以避免busybox被安装到宿主系统的/usr目录下,破坏宿主系统  
  20.             Applets links (as soft-links)--->  
  21.         (/xxxx/rootfs) BusyBox installationprefix   //填写你的安装路径  
  22.     Busybox Library Tuning --->  
  23.         (2) MD5: Trade Bytes for Speed  
  24.        
  25. Linux ModuleUtilities --->  
  26.     (/lib/modules) Default directory containingmodules  
  27.     (modules.dep) Default name of modules.dep  
  28.     [*] insmod  
  29.     [*] rmmod  
  30. [*] lsmod  
  31.        [*]lsmodpretty output for 2.6.x Linux kernels  
  32. [*] modprobe  
  33. [*]  Multipleoptions parsing  
  34.     --- Options common to multiple modutils  
  35.     [*] Support tainted module checking withnew kernels  
  36.     [*] Support version 2.6.x Linux kernels  

7.编译,安装busybox

[plain]  view plain copy
  1. make arch=ARMCROSS COMPILE=arm-linux-  
  2. make install  

在sbin中看init检查busybox安装成功与否

 

Yaffs2文件系统制作工具:

http://arm9download.cncncn.com/linux/mkyaffs2image.tgz

最后执行:

[plain]  view plain copy
  1. mkyaffs2image-128M rootfs rootfs.bin 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值