Building UBIFS for Nand Flash

Moderator: nferre

pelco
Posts: 1
Joined: Tue Aug 19, 2014 2:32 pm

Building UBIFS for Nand Flash

Tue Aug 19, 2014 2:47 pm

Hi,

I have a lot of problems booting from nand flash when using ubifs from buildroot.
But i found out that using an older mtd-utils solved my problem and i don't know why.
Does anyone have any idea?

Here is the tutorial:

 1 - Download and install mtd-utils from lucid repository (ubuntu 10.04.4) http://packages.ubuntu.com/lucid-updates/mtd-utils
 1.1 -  For 64-bit OS
      http://mirrors.kernel.org/ubuntu/pool/u ... _amd64.deb
 1.2 -  For 32-bit OS
      http://mirrors.kernel.org/ubuntu/pool/u ... 1_i386.deb

2 - Build Ubifs
# mkfs.ubifs -r your_rootfs/ -o mine.img -m 2048 -e 126976 -c 2048
# vi ubinize.cfg
    [ubifs]                 
    mode=ubi              
    image=mine.img         
    vol_id=0              
    vol_size=248MiB      
    vol_type=dynamic     
    vol_name=rootfs       
    vol_flags=autoresize 

# ubinize -o mine.ubi -m 2048 -p 128KiB -s 2048 -O 2048 ubinize.cfg

3 - Use SAM-BA to load mine.ubi image to nand flash
blue_z
Location: USA
Posts: 1761
Joined: Thu Apr 19, 2007 10:15 pm

Re: Building UBIFS for Nand Flash

Tue Aug 19, 2014 11:35 pm

The most reliable method of creating/installing the UBI volume with UBIFS is to use the "proper" Linux tools on the target system:

Code: Select all

# ubiformat /dev/mtdX
# ubiattach -p /dev/mtdX
# ubimkvol /dev/ubi0 -N volume_name -s 64MiB
# ubiupdatevol /dev/ubi0_0 /path/to/ubifs.img
# mount -t ubifs ubi0:volume_name /mount/point
following this guide.
You should build another kernel to boot from SDcard or for tftpbooting with an initramfs.
After all of that you will have a UBI volume and UBIFS installed by the same version of Linux device drivers and utilities as your runtime Linux.

Regards

Return to “SAMA5-based”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests