制作jffs2根文件系统

一、制作mkfs.jffs2工具 

       首先得准备好两个软件包 ,一个是MTD设备的工具包,另一个是zlib压缩包,在这我的MTD设备工具包为mtd-snapshot-20050519.tart.tar,zlib压缩包是zlib-1.2.3.tar.tar。

步骤:
(1)解压zlib-1.2.3.tar.tar,

$tar xf zlib-1.2.3.tar.tar (在制作mkfs.jffs2过程中需要用到得库);
(2)解压mtd-snapshot-20050519.tar.tar

$tar xf mtd-snapshot-20050519.tar.tar
$ ls

mtd  mtd-snapshot-20050519.tar.tar  zlib-1.2.3  zlib-1.2.3.tar.tar
(3)进入解压后的目录zlib-1.2.3执行:
$ cd zlib-1.2.3/ 
$ ./configure --shared --prefix=/usr/(放入系统目录中);
(4)直接make,进行编译。
$ make
(5)安装编译好的库文件:
$ make install
(6)编译安装mkfs.jffs2工具

$cd mtd/util

$make

$make install (安装命令到系统中)

$which mkfs.jffs2

/usr/sbin/mkfs.jffs2

二、制作jffs2文件系统

          这时你就可以用你制作的mkfs.jfss2工具制作jfffs文件系统了!

$mkfs.jffs2 -n -s 512 -e 16KiB -d filesys -o filesys.jffs2

或$mkfs.jffs2 -r filesys -o filesys.jffs2 -e 0x4000 --pad=0x800000 -n(这个制作的,不管文件系统多大,--pad=0x800000 这个参数都让做成8MB)

 注释:

       上面命令中,"-n"表示不要在每个擦除块上都加上清除标志,"-s 512"指明一页大小为512字节,"-e 16KiB”指明一个擦除块大小为16KB,"-d"表示根文件系统目录,"-o"表示输出文件(目标文件)。"--pad"表示用16进制输出文件的大小,也就是filesys.jffs2的size。

三、jffs2文件系统烧写

#tftp 30008000 filesys.jffs2

#nand erase 200000 800000 (根文件系统所在的分区,kernel启动的时候有显示)

#nand write 30008000 200000 800000   (nand write 下载的地址 偏移地址 大小)

然后设置uboot启动参数

#setenv bootcmd tftp 30800000 zImage\; Go 30800000

#setenv bootargs root=/dev/mtdblock2 init=/linuxrc rootfstype=jffs2 rw console=ttySAC0,115200

mkfs.jffs2使用方法
选项含义(man a mkfs.jffs2)

mkfs.jffs2: Usage: mkfs.jffs2 [OPTIONS]Make a JFFS2 file system image from an existing directory treeOptions:

-p, --pad[=SIZE]       用16进制來表示所要输出档案的大小,也就是root.jffs2的size。 很重要的是, 為了不浪费flash空间,这个值最好符合flash driver所规定的区块大小 。果不足则使用0xff来填充补满。                            

 -r, -d, --root=DIR      指定要做成image的原资料夹.(默认:当前文件夹)

-s, --pagesize=SIZE     节点页大小(默认: 4KiB)

-e, --eraseblock=SIZE   设定擦除块的大小为(默认: 64KiB)

-c, --cleanmarker=SIZE Size of cleanmarker (default 12)

-m, --compr-mode=MODE   Select compression mode (default: priortiry)

-x, --disable-compressor=COMPRESSOR_NAME                          Disable a compressor

-X, --enable-compressor=COMPRESSOR_NAME                          Enable a compressor

-y, --compressor-priority=PRIORITY:COMPRESSOR_NAME        Set the priority of a compressor

-L, --list-compressors Show the list of the avaiable compressors

-t, --test-compression Call decompress and compare with the original (for test)

-n, --no-cleanmarkers   指明不添加清楚标记(nand flash 有自己的校检块,存放相关的信息。)如果挂载后会出现类 似:          CLEANMARKER node found at 0x0042c000 has totlen 0xc != normal 0x0                     的警告,则加上-n 就会消失。

-o, --output=FILE       指定输出image档案的文件名.(default: stdout)

-l, --little-endian     指定使用小端格式-b, --big-endian        指定使用大端格式

-D, --devtable=FILE     Use the named FILE as a device table file

-f, --faketime          Change all file times to '0' for regression testing

-q, --squash            Squash permissions and owners making all files be owned by root

-U, --squash-uids       将所有文件的拥有者设为root用户

-P, --squash-perms      Squash permissions on all files     

                                           --with-xattr        stuff all xattr entries into image     

                                          --with-selinux      stuff only SELinux Labels into jffs2 image     

                                          --with-posix-acl    stuff only POSIX ACL entries into jffs2 image

-h, --help              显示这些文字

-v, --verbose           Verbose operation

-V, --version           显示版本

-i, --incremental=FILE     Parse FILE and generate appendage output for it

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/462091.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

添加WCF服务引用失败解决办法

最近在玩SL4 beta,写了一个WCF的服务,在Silverlight Application中选择Add Service Reference,填入服务地址,但在生成服务引用代码(应该就是代理类)时发生错误:Error 7 Custom tool error: Fail…

javascript设计模式简单介绍之【工厂模式】

工厂模式分为两种,一种是简单工厂模式。另一种称之为工厂模式。 简单工厂模式是使用一个外部的单体或者静态方法来生成实例。 而工厂模式使用子类来决定内部成员要实现那个具体的类的实例。 工厂模式要求被具体实现的类,必须提供相同的接口。 下面我们将…

srand函数简介

srand函数是随机数发生器的初始化函数。 原型:void srand(unsigned seed); 用法:它需要提供一个种子,这个种子会对应一个随机数,如果使用相同的种子后面的rand()函数会出现一样的随机数。如:srand(1); 直接使用1来初始化种子。不过为了防止随机数每次重复…

python库--pandas--Series.str--字符串处理

目录 原数据字符大小写转换字符串拼接字符填充/插入/扩展字符串内容判断查找统计转码删减/截取分割/替换原数据 import pandas as pd a pd.Series([aSd, asd, dfd fsAsf sfs]) b pd.Series([None, asd, fgh]) indexab0aSdNone1asdasd2dfd fsAsf sfsfgh字符大小写转换 a.str.l…

linux下多线程之pthread_detach(pthread_self())

写个碰到的问题,记录下自己的技术之路点滴 pthread_detach(pthread_self()) linux线程执行和windows不同,pthread有两种状态joinable状态和unjoinable状态, 如果线程是joinable状态,当线程函数自己返回退出时或pthread_exit时都不…

Unique Binary Search Trees

使用带标记的DP int result[1000];int numTrees(int n) {result[0] 1;result[1] 1;result[2] 2;// Start typing your C/C solution below// DO NOT write int main() functionif(result[n] ! 0)return result[n];int num 0, t;for(t 1; t < n; t){num num numTrees(…

ERROR: Start Page at 'www/index.html' was not found

用Xcode 4.3.2新建了一个PhoneGap的应用&#xff0c;www目录下存在index.html文件&#xff0c;但是运行的时候&#xff0c;报错&#xff1a;ERROR: Start Page at www/index.html was not found&#xff0c;这是PhoneGap和Xcode 4还不兼容导致的。 可以右键项目名->Add File…

Linux线程-互斥锁pthread_mutex_t

在线程实际运行过程中&#xff0c;我们经常需要多个线程保持同步。这时可以用互斥锁来完成任务&#xff1b;互斥锁的使用过程中&#xff0c;主要有pthread_mutex_init&#xff0c;pthread_mutex_destory&#xff0c;pthread_mutex_lock&#xff0c;pthread_mutex_unlock这几个函…

百度前端技术学院,学习第一天。

有基础&#xff0c;所以第一天的了解基本可以跳过。 略.. 转载于:https://www.cnblogs.com/devanwu/p/11149051.html

ULS 日志为空

解决方案&#xff1a; 1.保存为ChangeAccounts_SPTraceV4.ps1&#xff0c;运行 # Get the tracing service. $farm Get-SPFarm $tracingService $farm.Services | where {$_.Name -eq "SPTraceV4"} # Get the "svc_sp_services" managed account. $manag…

2013 ACM/ICPC Asia Regional Changsha Online - C

2019独角兽企业重金招聘Python工程师标准>>> 竟然没写出来 还是比较坑&#xff0c;好吧 Color Representation Conversion Time Limit: 1 Second Memory Limit: 32768 KB So far, there are many color models in different area. For screen display, the most …

vs2017常量文本字符串无法转换成char*

vs2017中这种写法编译不通过&#xff1a;char* pTest "hello"; 解决方法&#xff1a;在C/C选项-命令行-附加选项中增加&#xff1a;/Zc:strictStrings- (Disable string literal type conversion)转载于:https://www.cnblogs.com/dqloveu/p/11149222.html

linux中DIR、dirent、opendir()、readdir()、closedir()函数的使用

一、 1、DIR 属性&#xff1a;数据类型&#xff1b; 头文件&#xff1a;#include <dirent.h> 用法&#xff1a;定义一个指向文件目录的指针&#xff1b; 举例&#xff1a;DIR *dirpt null; 2、dirent 属性&#xff1a;数据类型&#xff0c;结构体&#xff1b; 头…

BNUOJ 4358 左手定则 搜索

题目链接&#xff1a;http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid4358 一道很好的搜索题&#xff0c;要注意DFS函数的写法&#xff0c;特别是return的写法。 View Code 1 #include <iostream>2 #include <cstring>3 #include <cstdio>4 using names…

CentOS安装Confluence Wiki步骤

参考&#xff1a;http://supernetwork.blog.51cto.com/2304163/1187066参考&#xff1a;http://yjiang.tk/?p1085需要的文件CentOS-6.5-x86_64-minimal.isojre-7u67-linux-x64.rpmatlassian-confluence-5.4.4-x64.binmysql-connector-java-5.1.32-bin.jarconfluence5.1-crack.…

memset()、memcpy()、memcmp()的使用方法

1、void *memset(void *s,int ch,size_t n); 属性&#xff1a;函数&#xff1b; 用法&#xff1a;将s中当前位置后面n个字节用ch替换&#xff0c;并返回s&#xff1b; 头文件(C语言)&#xff1a;#include <string.h> 举例&#xff1a; char str_addr[50]; memset(str…

provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接错误的解决方法...

这个错误主要有以下几个原因造成&#xff1a; 1. 错误的连接字符串&#xff1a;例如数据源的实例名称“\"错误写成"/"了 2、Named Pipes(NP)没有启动 其他原因&#xff0c;详见&#xff1a;http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices…

使用VS2015编写C/C++开始步骤

下面围绕如何建立工程、如何添加代码和运行展开说明。 一、建立工程 &#xff08;1&#xff09;打开VS2015&#xff0c;然后在菜单栏中选择file—>New—>Project&#xff1b; &#xff08;2&#xff09;在弹出的界面中&#xff0c;选择Win32&#xff0c;编辑工程名字、…

ruby中正则表达式最小匹配与最大匹配

正则表达式中&#xff0c;默认的是最大匹配&#xff0c;即贪婪模式&#xff0c;但有些时候&#xff0c;要最小匹配&#xff0c; 请看下面的例子&#xff1a;(ruby) str "abbbbbdwwdwwwede"puts str[/a.*(dw)/] 结果为&#xff1a;abbbbbdwwdw str "abbbbbdwwd…

sprintf()、fprintf()的使用方法

1、int sprintf(char *str,char *format,[forgument,..]); 属性&#xff1a;函数&#xff1b; 用法&#xff1a;将格式化的字符写入字符串&#xff1b; 头文件&#xff1a;#include <stdio.h> 参数&#xff1a;char *str:要写入字符串的指针&#xff1b; char *form…