内核选项需要修改的地方
1)Device Drivers
--->Memory Technology Device (MTD) support
--->UBI - Unsorted block images
--->Enable UBI
2)File systems
--->Miscellaneous filesystems
--->UBIFS file system support
解压ubi.tar.gz中的命令,放入已有文件系统系统(nfs或者cramfs)
下载地址http://www.armfans.net/viewthread.php?tid=2318&extra=page%3D1&frombbs=1
执行
1)./flash_eraseall /dev/mtd3
格式化Nand的第三分区
我们分了200MB以上,作为主分区使用
Erasing 128 Kibyte @ 5240000 -- 33 % complete.
Skipping bad block at 0x05260000
Erasing 128 Kibyte @ f220000 -- 98 % complete.
Skipping bad block at 0x0f240000
Erasing 128 Kibyte @ f5e0000 -- 99 % complete.
2)./ubiattach /dev/ubi_ctrl -m 3
将第三分区附着至ubi0上
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd3 to ubi0
UBI: MTD device name: "UBIfs"
UBI: MTD device size: 246 MiB
UBI: number of good PEBs: 1966
UBI: number of bad PEBs: 2
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1943
UBI: total number of reserved PEBs: 23
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 0/0
UBI: background thread "ubi_bgt0d" started, PID 58
UBI device number 0, total 1966 LEBs (253661184 bytes, 241.9 MiB), available 1943 LEBs (250693632 bytes, 239.1 MiB), LEB size 129024 bytes (126.0 KiB)
3)mdev -s
如果使用mdev,系统不会自动创建/dev/ubi0节点
4)./ubimkvol /dev/ubi0 -N rootfs -s 200MiB
将ubi0分200MB出来作为rootfs用
Volume ID 0, size 1626 LEBs (209793024 bytes, 200.1 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "rootfs", alignment 1
5)mount -t ubifs ubi0_0 /mnt
将分出的分区挂载至mnt目录
UBIFS: default file-system created
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 208373760 bytes (203490 KiB, 198 MiB, 1615 LEBs)
UBIFS: journal size: 10450944 bytes (10206 KiB, 9 MiB, 81 LEBs)
UBIFS: media format: 4 (latest is 4)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 5182151 bytes (5060 KiB)
6)tar -xvf android.tar -C mnt
解压android文件系统,如果压缩了请用-jxvf
data/
default.prop
dev/
init
init.goldfish.rc
init.rc
init.smdk6410.rc
proc/
sbin/
sbin/adbd
sys/
system/
system/framework/
system/framework/svc.jar
system/framework/core.jar
system/framework/input.jar
system/framework/pm.jar
system/framework/android.policy.jar
system/framework/android.test.runner.jar
system/framework/am.jar
system/framework/ime.jar
system/framework/bmgr.jar
system/framework/framework-res.apk
system/framework/framework-tests.jar
system/framework/framework.jar
system/framework/monkey.jar
system/framework/services.jar
system/framework/javax.obex.jar
system/framework/ext.jar
system/default.prop
system/xbin/
system/xbin/daemonize
system/xbin/cpueater
system/xbin/showmap
system/xbin/tcpdump
system/xbin/latencytop
system/xbin/crasher
system/xbin/su
system/xbin/netserver
system/xbin/check-lost+found
system/xbin/sqlite3
system/xbin/dexdump
system/xbin/showslab
system/xbin/dbus-monitor
system/xbin/procmem
system/xbin/nc
system/xbin/scp
system/xbin/btool
system/xbin/ssh
system/xbin/opcontrol
system/xbin/timeinfo
system/xbin/librank
system/xbin/oprofiled
system/xbin/procrank
system/xbin/dbus-send
system/xbin/strace
system/xbin/add-property-tag
system/xbin/netperf
system/lib/
system/lib/libstagefright.so
system/lib/libm.so
system/lib/libGLESv1_CM.so
system/lib/libomx_mp3dec_sharedlibrary.so
system/lib/libaudiopolicygeneric.so
system/lib/libaudioflinger.so
system/lib/libterm.so
system/lib/libpvrtsptunicast_streaming.so
system/lib/libwebcore.so
system/lib/libjni_latinime.so
system/lib/libsysutils.so
system/lib/libdrm1.so
system/lib/libsrec_jni.so
system/lib/libopencore_mp4local.so
system/lib/libreference-ril.so
system/lib/libstdc++.so
system/lib/libpixelflinger.so
system/lib/libcameraservice.so
system/lib/libopencore_download.so
system/lib/libc_debug.so
system/lib/libicui18n.so
system/lib/libopencore_player.so
system/lib/libicuuc.so
system/lib/libomx_amrenc_sharedlibrary.so
system/lib/liblog.so
system/lib/libsystem_server.so
system/lib/libpvoma1passthru.so
system/lib/libthread_db.so
system/lib/libEGL.so
system/lib/libopencore_mp4localreg.so
system/lib/libdrm1_jni.so
system/lib/libcutils.so
system/lib/libexpat.so
system/lib/libsoundpool.so
system/lib/libomx_m4venc_sharedlibrary.so
system/lib/libnativehelper.so
system/lib/libopencore_author.so
system/lib/libFFTEm.so
system/lib/libpvrtsptunicast_streamingreg.so
system/lib/libomx_sharedlibrary.so
system/lib/libssl.so
system/lib/libopencore_rtsp.so
system/lib/libxml2wbxml.so
system/lib/libc.so
system/lib/libomx_amrdec_sharedlibrary.so
system/lib/libui.so
system/lib/libsurfaceflinger.so
system/lib/libreference-