现在的位置: 首页 > 综合 > 正文

initramf文件系统_zzhere2007

2018年02月07日 ⁄ 综合 ⁄ 共 861字 ⁄ 字号 评论关闭

准备:

移植的linux内核:     linux-2.6.32.1

制作好的根文件系统  rootfs

 

过程:

1   设置linux内核,使其支持initramfs

2 在rootfs目录下,建立一个软连接

 

ln –s /bin/busybox init

 

3重新编译内核

      make

  生成的initramfs和内核编译到一起

                                                                                                                                                                                   
                                                    

.启用后会有以下东东不停的弹出:

“Can`t
open /dev/tty2: No such file or directory”

“Can`t
open /dev/tty4: No such file or directory”

“Can`t
open /dev/tty3: No such file or directory”


解决办法1:

dev目录下建立需要的文件:

ln
-sf null tty2

ln
-sf null tty3

ln
-sf null tty4


解决办法2:mdev生成需要的文件

/etc/init.d/rcS文件加入以下内容:

#!/bin/sh

/bin/mount
-n -t sysfs none /sys

/bin/mount
-t ramfs none /dev

/sbin/mdev
-s

mdev启动后会用到/sys目录下的文件,并在/dev目录下生成设备文件。/bin/mount
-t ramfs none /dev
执行后,mdev生成的设备文件不会写入磁盘(flash), 否则可能弹出一大堆的

mdev:
can't create 'tty': Permission denied”

mdev:
can't create 'tty0': Permission denied”

mdev:
can't create 'tty1': Permission denied”

……

如果要使用ps,
top
等命令还要加入:/bin/mount
-n -t proc none /proc

抱歉!评论已关闭.