简单文件系统构建ramdisk
1. BusyBox编译工具,包含bin, sbin, usr, linuxrc.
2. 添加相关重要目录:dev, etc, mnt, proc, sys, lib, var, tmp.
proc, sys为虚拟文件系统,在内存中,创建文件系统时,只要创建空目录即可。
3. dev中添加相关设备文件。
mknod -m 666 ttyS0 c 4 64
mknod -m 666 null c 1 3
mknod -m 666 console c 5 1
mtd0 c 90 0
mtd1 c 90 2
mtd2 c 90 4
mtdblock0 b 31 0
mtdblock1 b 31 1
telnet相关的文件:
ptmx c 5 2
mkdir dev/pts
4. etc目录文件:inittab, init.d/rcS, fstab, profile, group, shadow, passwd.
制作,请参考rootfs下相关文档。
5. 把相关内容保存到rootfs下,通过以下脚本生成rootfs.img.gz(ramdisk).
#!/bin/sh
umount ./mnt
test -e ./mnt || mkdir ./mnt>/dev/null
dd if=/dev/zero of=rootfs.img bs=1024 count=8192
losetup /dev/loop1 rootfs.img
echo y | mke2fs -m0 rootfs.img
sudo mount -o loop rootfs.img ./mnt
echo "create the rootfs.img.gz"
sudo cp rootfs/* ./mnt -a
sync
sudo umount ./mnt
gzip rootfs.img -v9
6. 通过uboot下载到内存中,并配置bootargs。
以at91sam9260为例:
tftp 0x21100000 rootfs.img.gz
setenv bootargs mem=64M console=ttyS0,115200 initrd=0x21100000,0x800000 root=/dev/ram0 rw init=/linuxrc
7. boot即可测试ramdisk文件系统。
简单文件系统构建ramdisk的更多相关文章
- 制作嵌入式linux文件系统(ramdisk,cramfs,squashfs)
转:http://blog.csdn.net/zyb19831212/article/details/1887930 一.什么是文件系统 (Filesystem): A directory struc ...
- .NET Core的文件系统[5]:扩展文件系统构建一个简易版“云盘”
FileProvider构建了一个抽象文件系统,作为它的两个具体实现,PhysicalFileProvider和EmbeddedFileProvider则分别为我们构建了一个物理文件系统和程序集内嵌文 ...
- 嵌入式Linux内核+根文件系统构建工具-Buildroot 快速入手指导【转】
本文转载自:https://my.oschina.net/freeblues/blog/596448 嵌入式Linux内核+根文件系统构建工具-Buildroot 快速入手指导 buildroot 是 ...
- 基于Linux的嵌入式文件系统构建与设计
摘 要:Linux是当今一种十分流行的嵌入式操作系统.由于其具有执行效率高.占用空间小.实时性能优良和可扩展性强等特点,因此被广泛应用于工业控制领域.该文对其文件系统进行了简单的介绍,结合嵌入式系统应 ...
- 混合文件系统(ramdisk+jffs)
背景知识: 一.Ramdisk文件系统: 1.掉电丢失 2.读写速度高 3.数据存储到内存 二.jffs文件系统 1.掉电不丢失 2.可存储于NOR NAND,但是适用于NOR 3.数据存储于flas ...
- 基于IndexedDB实现简单文件系统
现在的indexedDB已经有几个成熟的库了,比如西面这几个,任何一个都是非常出色的. 用别人的东西好处是上手快,看文档就好,要是文档不太好,那就有点尴尬了. dexie.js :A Minimali ...
- ARM-Linux移植之(四)——根文件系统构建
相关工具版本: busybox-1.7.0 arm-linux-4.3.2 linux-2.6.22 1.配置busybox并安装. 在我们的根文件系统中的/bin和/sbin目录下有各种命令的应 ...
- 如何简单的构建Android?
原文链接:https://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/ 过去的几个月中,在Tuenti上与同行例 ...
- 就这么简单!构建强大的WebShell防护体系
接触web安全中,例如上传一句话WebShell实现上传文件的功能,再通过上传的多功能WebShell,执行病毒文件最终创建远程连接账号,达到入侵目标服务器的效果.我们可以看到,webshell在整个 ...
随机推荐
- Foundations of Machine Learning: The Margin Explanation for Boosting's Effectiveness
Foundations of Machine Learning: The Margin Explanation for Boosting's Effectiveness 在这一节,我们要回答的一个问题 ...
- 如何在Access2007中使用日期类型查询数据
select * from 表 where datediff("d",日期型的字段,#2008-09-01#)=0或select * from 表 where 日期型的字段 > ...
- Win8.1设置ftp服务器并设定用户操作权限的详细教程
http://wenku.baidu.com/link?url=VTDLnDa_yfQN9OldjVnYsOBf7UdIj76QjaLDyHP-I0A6iFEfzB8EyBf9uztwm2JDXlFL ...
- HDU 4968 Improving the GPA(dp)
HDU 4968 Improving the GPA 题目链接 dp.最大最小分别dp一次,dp[i][j]表示第i个人,还有j分的情况,分数能够减掉60最为状态 代码: #include <c ...
- Statistical Concepts and Market Returns
Statistical Concepts and Market Returns Categories of statistics Descriptive statistics: used to sum ...
- Python文件遍历二种方法
分享下有关Python文件遍历的两种方法,使用的OS模块的os.walk和os.listdir实现. 关于Python的文件遍历,大概有两种方法,一种是较为便利的os.walk(),还有一种是利用os ...
- ccTouchBegan
CCLayer中的setTouchEnabled(true)会开启多点触摸. 如果使用CCDirector::sharedDirector()->getTouchDispatcher()-> ...
- Rewrite MSIL Code on the Fly with the .NET Framework Profiling API
http://clrprofiler.codeplex.com/ http://blogs.msdn.com/b/davbr/archive/2012/11/19/clrprofiler-4-5-re ...
- 使用自定义的按钮替换默认的<input type='file'>
可以通过让默认的input type = 'file'按钮透明度变为0,并且让它刚好覆盖在自定义的按钮上,来实现此效果: 将它写成一个jQuery插件: (function($){ $.fn.brow ...
- 每日英语:China Underwhelmed After First Apple Event
Apple's roll-out of its latest iPhones landed with a thud in China, the company's biggest foreign ma ...