android ubifs

1.tar -xvf zlib-1.2.3.tar.gz
zlib-1.2.3$ CC=arm-linux-gcc ./configure --shared --prefix=/home/UBI/install/
make
make install
2.tar -xvf lzo-2.03.tar.gz
lzo-2.03$ CC=arm-linux-gcc ./configure --host=arm-linux --prefix=/home/UBI/install/ --enable-shared
make
make install
3.tar -xvf e2fsprogs-1.41.14.tar.gz
e2fsprogs-1.41.14$ CC=arm-linux-gcc ./configure --host=arm-linux --prefix=/home/UBI/install/e2f
make
make install-libs
4.tar -xvf mtd-utils-HEAD-ec98519.tar.gz
patch Makefile
--- Makefile    2011-12-12 13:45:54.000000000 -0800
+++ ../Makefile 2011-12-18 22:35:37.081340863 -0800
@@ -2,8 +2,19 @@
 # -*- sh -*-

 VERSION = 1.4.8
+PREFIXS=/home/UBI/install
+ZLIBCPPFLAGS=-I$(PREFIXS)/include
+LZOCPPFLAGS=-I$(PREFIXS)/include/lzo
+
+ZLIBLDFLAGS=-L$(PREFIXS)/lib
+LZOLDFLAGS=-L$(PREFIXS)/lib
+
+UID=-I$(PREFIXS)/e2f/include
+WITHOUT_XATTR=1
+CROSS=arm-linux-
+CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)

-CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
+CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) $(UID)

 ifeq ($(WITHOUT_XATTR), 1)
   CPPFLAGS += -DWITHOUT_XATTR
@@ -101,6 +112,7 @@
 #
 obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \
        hashtable/hashtable.o hashtable/hashtable_itr.o
+LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
 LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid
 $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a)
 ---------------------------------------------------------------
 make
 在/UBI/mtd-utils-HEAD-ec98519/arm-linux$ 下会生成我们需要的命令
 5. JFFS2 
File systems  --->
[*] Miscellaneous filesystems  --->
<*>   Journalling Flash File System v2 (JFFS2) support       
at pc
生成rootfs.jffs2
mkfs.jffs2 -r nfsdir -o rootfs.jffs2 -e 0x80000 -n
-e 擦除块大小512k
-n 去掉生成映像中的clean marker
at board(nfsdir)
./flash_erase /dev/mtd2 0 0
./nandwrite -p /dev/mtd2 ../rootfs.jffs2
mount -t jffs2 /dev/mtdblock2 /mnt
setenv bootargs root=/dev/mtdblock2 rootfstype=jffs2 rw console=ttySAC0,115200 init=/init
 6.UBIFS
  Device Drivers  --->  
 <*> Memory Technology Device (MTD) support  --->
  UBI - Unsorted block images  --->
  <*> Enable UBI    

  File systems  --->     
  [*] Miscellaneous filesystems  --->
  <*>   UBIFS file system support  
at pc

nfsroot 下烧写 
http://blog.sina.com.cn/s/blog_5d9051c00100ek1j.html
 ./flash_erase /dev/mtd2 0 0
[/arm-linux/ubi-utils]# ./ubiformat /dev/mtd2 -f /ubi.img 
1)ubiformat /dev/mtd2 -f usr/prebuid/ubi.img
2)ubiattach /dev/ubi_ctrl -m 2
3)mdev -s
4)ubimkvol /dev/ubi0 -N rootfs -s 800MiB
5)setenv bootargs root=ubi0:rootfs ubi.mtd=2 rootfstype=ubifs console=ttySAC0,115200 init=/init
7 YAFFS2
at pc
tar -xvf yaffs2.tar.gz
cd yaffs2/utils/
make
./mkyaffs2image /home/nfsdir rootfs.yaffs2
at board
./flash_erase /dev/mtd2 0 0
./nandwrite -p /dev/mtd2 rootfs.yaffs2
mount -t yaffs2 /dev/mtdblock2 /mnt
setenv bootargs root=/dev/mtdblock2 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/init

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

UBIFS

运行的时候出错

UBIFS error (pid 1): validate_sb: LEB size mismatch: 520192 in superblock, 516096 real

http://blog.csdn.net/evilcode/article/details/6161759

 

说明是在制作ubifs文件系统时出错

在PC上制作buifs

mkfs.ubifs -r nfsdir -m 4096 -e 516096 -c 2024 -o ubifs.img

ubinize -o ubi.img -m 4096 -p 512KiB ubifs.conf

 cat ubifs.conf

[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=615MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

 

参数说明:-m 页面大小4K 4096 –e逻辑擦除大小可以通过ubiattach /dev/ubi_ctl –m 2查看
-p 物理擦除块大小 512Kib

在nfsdir下运行

首先删除/dev/ubi0(上一次创建的)

rm –rf /dev/ubi0

格式化/dev/mtd2

ubiformat /dev/mtd2 -f ubi.img

探测关联

ubiattach /dev/ubi_ctrl -m 2

mdev –s

通过ubinfo –a查看如果有ubi0上的标志就可以测试了

如果没有则创建

ubimkvol /dev/ubi0 -N rootfs -s 800MiB

测试:mount –t ubifs ubi0:rootfs /mnt

设置环境变量:

setenv bootargs root=ubi0:rootfs ubi.mtd=2 rootfstype=ubifs console=ttySAC0,115200  init=/init


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值