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. maven 发布到仓库

    到nexus中看到的仓库地址 <distributionManagement> <repository> <id>releases</id> <n ...

  2. 【LeetCode】132. Palindrome Partitioning II

    Palindrome Partitioning II  Given a string s, partition s such that every substring of the partition ...

  3. 【js】正则表达式(I)

    正则表达式是由英文词语regular expression翻译过来的,就是符合某种规则的表达式.正则表达式在软件开发中应用非常广泛,例如,找出网页中的超链接,找出网页中的email地址,找出网页中的手 ...

  4. Android studio 如何让包有层次显示

    Android studio中我新建的包在原来包名后面显示,而我想让包名能层次展示: 方法: 点击如图部分,在弹出框中 去掉 ”compact empty middle package“前面勾

  5. Android之getSystemService

    getSystemService是Android很重要的一个API,它是Activity的一个方法,根据传入的NAME来取得对应的Object,然后转换成相应的服务对象.以下介绍系统相应的服务. 传入 ...

  6. mysql查询-不存在记录时赋对应的数据

    使用mysql数据库,执行查询的时候,有时候就不存在记录,但是正好在不存在记录的时候又需要给赋予相应的查询结果字段,代码实现如下: select IFNULL(('), '1970-01-01 00: ...

  7. 自己写的一个操作Mysql的简单的实例

    #include <WinSock.h> #include <stdio.h> #include <iostream> #include <windows.h ...

  8. 外网登陆SAP的两种方式

    1.用SAP router实现从外网登录SAPserver(方式一) 自已搭建的局域网结构例如以下: SAPserverIP: 192.168.0.2, 路由器中设为DMZ区 在SAPserver上启 ...

  9. sqlite时间戳转时间语句(时间转时间戳)实例

    sqlite时间戳转时间.时间转时间戳的方法 实现代码: sqlite, 'unixepoch', 'localtime'); +----------------------------------- ...

  10. 深度学习FPGA实现基础知识10(Deep Learning(深度学习)卷积神经网络(Convolutional Neural Network,CNN))

    需求说明:深度学习FPGA实现知识储备 来自:http://blog.csdn.net/stdcoutzyx/article/details/41596663 说明:图文并茂,言简意赅. 自今年七月份 ...