linux支持的内存根文件系统
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支持的内存根文件系统的更多相关文章
- 【Linux】程序内获取文件系统挂载信息
Linux shell可通过查看/etc/mtab或者/proc/mounts文件来获取当前文件系统挂载信息,示例: 程序内读取/etc/mtab或者/proc/mounts,解析字符串较为繁琐,可以 ...
- 文件系统 - Linux 支持的文件系统类型
NAME 文件系统 - Linux 支持的文件系统类型:minix, ext, ext2, xia, msdos, umsdos, vfat, proc, nfs, iso9660, hpfs, sy ...
- LINUX支持哪些文件系统
我们在Linux中常用的文件系统主要有ext3.ext2及reiserfs :Windows和Dos常用的文件系统是fat系列(包括fat16及fat32等)和ntfs 文件系统:光盘文件系统是ISO ...
- dumpe2fs Linux支持的文件系统
dumpe2fs (-bh)装置文件名 选项与参数: -b : 列出保留为坏轨的部分 -h : 仅列出superblock的数据,不会列出其他的区段内容 查看Linux支持的文件系统哪些支持: ls ...
- linux概念之分区与文件系统
分区类型 [root@-shiyan dev]# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. It's strongly re ...
- Linux环境下使用JFS文件系统
Linux环境下使用JFS文件系统 JFS是IBM公司为linux系统开发的一个日志文件系统.从IBM的实力及它对Linux的态度来看,JFS应该是未来日志文件系统中最具实力的一个文件系统. JFS提 ...
- linux 内核移植和根文件系统的制作【转载】
原文地址:http://www.cnblogs.com/hnrainll/archive/2011/06/09/2076214.html 1.1 Linux内核基础知识 在动手进行Linux内核移植之 ...
- linux 内核移植和根文件系统的制作
1.1 Linux内核基础知识 在动手进行Linux内核移植之前,非常有必要对Linux内核进行一定的了解,下面从Linux内核的版本和分类说起. 1.1.1 Linux版本 Linux内核的版本号 ...
- Linux学习笔记之 Btrfs文件系统简介及使用
Btrfs 也有一个重要的缺点,当 BTree 中某个节点出现错误时,文件系统将失去该节点之下的所有的文件信息.而 ext2/3 却避免了这种被称为”错误扩散”的问题. Btrfs相关介绍: Btrf ...
随机推荐
- inet_ntoa 的一个小问题
一个简单点的阻塞式tcp服务器如下所示: #include <stdio.h> #include <string.h> #include <sys/socket.h> ...
- 使用Python的turtle库实现七段数码管绘制
七段数码管绘制:七段数码管是由7段数码管拼接而成,每段有亮或不亮两种情况,改进的七段数码管还包括一个小数点位置.七段数码管能形成2=128种状态,其中部分状态能够显示易于人们理解的数字或字母含义.因此 ...
- C#代码规范 程序员必备的秘笈
1.引言 本文是一套面向C# programmer和C# developer进行开发所应遵循的开发规范 按照此规范来开发C#程序可带来以下益处: 代码的编写保持一致性,提高代码的可读性和可维护性,在团 ...
- python学习笔记011——闭包
1 定义 定义:在计算机科学中,闭包是词法闭包的简称,是引用了自由变量的函数 简单地说:闭包就是能够读取其他函数内部变量的函数,闭包是将函数内部和函数外部连接起来的桥梁.——来源百度百科 2 描述 形 ...
- PLSQL_统计信息系列05_统计信息的比较
20150506 Created By BaoXinjian
- Eclipse编译快捷键
从C#转学Java,总结了一些Eclipse跟Microsoft Visual Studio 向对应的快捷键: 1. Run Ctrl+F11 (VS对应的是F5) 2. Debug F11 ( ...
- 使用Htmlhelper,创建文本框TextBox
下面通过HtmlHelper帮助类,创建文本框. 首先新建一个实体类,做为下面的例子: using System; using System.Collections.Generic; using Sy ...
- linux权限详解
一个用户.一个组 我们来看一看 Linux 权限和所有权模型.我们已经看到每个文件属于一个用户和一个组.这正是 Linux 中权限模型的核心.您可以在 ls -l 清单中查看用户和组: $ ls -l ...
- 使用SQL语句的子查询批量复制表数据
批量复制表数据这里有两种方法,下面分别来介绍这两种方法: 一.手动创建新表,然后复制数据 如果是要复制整个表的话,可以使用SQL SERVER自动生成CREATE脚本: 然后在脚本中改改表名就可以了, ...
- REST技术第三步 @BeanParam的使用
我简介下rest中@BeanParam的使用 我们来做一个计算加法的服务. 提供两个參数a和b,计算出a+b. 參数都在URL里 就是类似这样的效果. 这次用上@BeanParam 首先写个POJO来 ...