linux支持两种内存根文件系统:ramdisk和initramfs。

----------------------------------------------------------------------------------------------------

Document/early-userspace/README

128 The kernel has currently 3 ways to mount the root filesystem:
129
130 a) all required device and filesystem drivers compiled into the kernel, no
131    initrd.  init/main.c:init() will call prepare_namespace() to mount the
132    final root filesystem, based on the root= option and optional init= to run
133    some other init binary than listed at the end of init/main.c:init().
134
135 b) some device and filesystem drivers built as modules and stored in an
136    initrd.  The initrd must contain a binary '/linuxrc' which is supposed to
137    load these driver modules.  It is also possible to mount the final root
138    filesystem via linuxrc and use the pivot_root syscall.  The initrd is
139    mounted and executed via prepare_namespace().
140
141 c) using initramfs.  The call to prepare_namespace() must be skipped.
142    This means that a binary must do all the work.  Said binary can be stored
143    into initramfs either via modifying usr/gen_init_cpio.c or via the new
144    initrd format, an cpio archive.  It must be called "/init".  This binary
145    is responsible to do all the things prepare_namespace() would do.
146
147    To maintain backwards compatibility, the /init binary will only run if it
148    comes via an initramfs cpio archive.  If this is not the case,
149    init/main.c:init() will run prepare_namespace() to mount the final root
150    and exec one of the predefined init binaries.
------------------------------------------------------------------------------------------------

initramfs

initramfs可以直接嵌入linux内核中,同内核一起编译。它可以为压缩文件,也可为普通非压缩文件系统。

其位置通过CONFIG_INITRAMFS_SOURCE指定。

注:若指定了CONFIG_INITRAMFS_SOURCE,则系统不会再响应ramdisk,jffs2等根文件系统,

       不响应CONFIG_CMDLINE,即使INITRAMFS_SOURCE指定的目录为空或非正确的文件系统。

initramfs文件系统启动时,会在根文件系统中执行第一个init程序,对uboot中穿过来的

init=/linuxrc不予理睬。

注:不管linuxrc,还是init,都是符号链接,指向/bin/busybox.

linux支持的内存根文件系统的更多相关文章

  1. 【Linux】程序内获取文件系统挂载信息

    Linux shell可通过查看/etc/mtab或者/proc/mounts文件来获取当前文件系统挂载信息,示例: 程序内读取/etc/mtab或者/proc/mounts,解析字符串较为繁琐,可以 ...

  2. 文件系统 - Linux 支持的文件系统类型

    NAME 文件系统 - Linux 支持的文件系统类型:minix, ext, ext2, xia, msdos, umsdos, vfat, proc, nfs, iso9660, hpfs, sy ...

  3. LINUX支持哪些文件系统

    我们在Linux中常用的文件系统主要有ext3.ext2及reiserfs :Windows和Dos常用的文件系统是fat系列(包括fat16及fat32等)和ntfs 文件系统:光盘文件系统是ISO ...

  4. dumpe2fs Linux支持的文件系统

    dumpe2fs  (-bh)装置文件名 选项与参数: -b : 列出保留为坏轨的部分 -h : 仅列出superblock的数据,不会列出其他的区段内容 查看Linux支持的文件系统哪些支持: ls ...

  5. linux概念之分区与文件系统

    分区类型 [root@-shiyan dev]# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. It's strongly re ...

  6. Linux环境下使用JFS文件系统

    Linux环境下使用JFS文件系统 JFS是IBM公司为linux系统开发的一个日志文件系统.从IBM的实力及它对Linux的态度来看,JFS应该是未来日志文件系统中最具实力的一个文件系统. JFS提 ...

  7. linux 内核移植和根文件系统的制作【转载】

    原文地址:http://www.cnblogs.com/hnrainll/archive/2011/06/09/2076214.html 1.1 Linux内核基础知识 在动手进行Linux内核移植之 ...

  8. linux 内核移植和根文件系统的制作

    1.1 Linux内核基础知识 在动手进行Linux内核移植之前,非常有必要对Linux内核进行一定的了解,下面从Linux内核的版本和分类说起. 1.1.1  Linux版本 Linux内核的版本号 ...

  9. Linux学习笔记之 Btrfs文件系统简介及使用

    Btrfs 也有一个重要的缺点,当 BTree 中某个节点出现错误时,文件系统将失去该节点之下的所有的文件信息.而 ext2/3 却避免了这种被称为”错误扩散”的问题. Btrfs相关介绍: Btrf ...

随机推荐

  1. HTML:减少页面加载时间的方法

    1. 重复的HTTP请求数量应尽量减少 (1)减少调用其他页面.文件的数量. (2)在使用css格式时,常会采用background载入图形文件,而每个background的图像都会产生1次HTTP ...

  2. 马老师 生产环境mysql主从复制、架构优化方案

    Binlog日志(主服务器) => 中继日志(从服务器 运行一遍,保持一致).从服务器是否要二进制日志取决于架构设计.如果二进制保存足够稳定,从性能上来说,从服务器不需要二进制日志.默认情况下, ...

  3. Evernote如何邮件分享

    把你的笔记通过邮件发送给别人,从而实现分享

  4. Android Zip文件解压缩代码

    2011-04-01 17:58:52|  分类: Android |举报 |字号 订阅   在Android平台中如何实现Zip文件的解压 缩功能呢? 因为Android内部已经集成了zlib库,对 ...

  5. Java 异常模型综述

    一. 异常的引入及基础 发现错误的理想时机是在编译阶段.也就是在你试图运行程序之前. 然而,编译期间编译器并不能找出全部的错误,余下的错误仅仅有在运行期才干发现和解决,这类错误就是 Throwable ...

  6. hdu 4961 Boring Sum(高效)

    pid=4961" target="_blank" style="">题目链接:hdu 4961 Boring Sum 题目大意:给定ai数组; ...

  7. unity, multi pass shader中的surface pass

    今天尝试写一个multi pass shader,但其中有一个Pass是surface pass,总是莫名奇妙地报错.后来看到下面帖子: http://forum.unity3d.com/thread ...

  8. html5中script的async属性

    html5中script的async属性 我兴奋于html5的原因之一是一些久久未能实现的特性现在可以真正运用于实际项目中了. 如我们使用placeholder效果蛮久了但是那需要javascript ...

  9. Java:多线程,分别用Thread、Runnable、Callable实现线程

    并发性(concurrency)和并行性(parallel)是两个概念,并行是指在同一时刻,有多条指令在多个处理器上同时执行:并发指在同一时刻只能有一条指令执行,但多个进程指令被快速轮换执行,使得宏观 ...

  10. NPOI之Excel——自动筛选、数字格式

    设置Excel的自动筛选功能 最新导出数据需要使用Excel的筛选功能,网上多方查找,终于在一个繁体的网站上找到了方法,呃,这个网站还是Java的,讲的是POI,不过.NET的NPOI也就一样用了. ...