Friday, February 24, 2012

UBIFS

http://www.linux-mtd.infradead.org/doc/ubi.html

** need to pay attention to kernel version and utiltools version.


mtd-utils# mkfs.ubifs/mkfs.ubifs -r filesystem/ -F -o ubifs.img -m 2048 -e 126976 -c 1580


  • Create ubinize.cfg file and write the contents into it
mtd-utils# vi ubinize.cfg
  [ubifs]                <== Section header
  mode=ubi              <== Volume mode (other option is static)
  image=ubifs.img       <== Source image
  vol_id=0              <== Volume ID in UBI image
  vol_size=192MiB       <== Volume size
  vol_type=dynamic      <== Allow for dynamic resize
  vol_name=rootfs       <== Volume name
  vol_flags=autoresize  <== Autoresize volume at first mount
mtd-utils# ubi-utils/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 -O 2048 ubinize.cfg






Symbol
MeaningValue for XO test case
SPPEB Size128KiB
SLLEB Size128KiB - 2 * 2KiB = 124 KiB
PTotal number of PEBs on the MTD device200MiB / 128KiB = 1600
BNumber of PEBs reserved for bad PEB handling1% of P = 16
OThe overhead related to storing EC and VID headers in bytes, i.e. O = SP - SL4KiB

Wednesday, February 08, 2012

Create and boot RAMDISK




The process I am using to build the ramdisk image:

  mkdir -p ramdisk
dd if=/dev/zero of=ramdisk_file bs=40M count=1
mkfs.ext2 ramdisk_file
sudo mount -o loop ramdisk_file ramdisk
sudo tar -xvzf ramfs.tar.gz -C ramdisk
sudo umount ramdisk
gzip ramdisk_file





uboot:
U-Boot# setenv bootargs console=ttyO0,115200n8 mem=256M earlyprintk root=/dev/ram0 rw initrd=0x82000000,40MB


jffs2:

mkfs.jffs2 -lqnp –e 128 -r target -o /tftpboot/rd-jffs2.bin