UBIFS Parameters

1,904 views
Skip to first unread message

Amjad Afzaal

unread,
Sep 6, 2012, 12:53:58 AM9/6/12
to meta-f...@googlegroups.com
Assalam o Alikum

Hello to every body!

I am developing bsp for imx31pdk and i am generating ubifs file system image. like following

IMAGE_FSTYPE = "ubi tar.bz2"
MKUBIFS_ARGS = "-m  -e  -c "
UBINIZE_ARGS = "-m  -p  -s "


Now i am confuse about what arguments to give in MKUBIFS_ARGS variable. I know the following

-m for minimum I/O unit size
-e for logical erase block size
-c for maximum logical erase block count
-p for count of erase blocks for orphans
-s don't know

but i don't know what are appropriate values for these arguments. Can anybody help me in this regard?

Chris Verges

unread,
Sep 6, 2012, 1:11:18 AM9/6/12
to meta-f...@googlegroups.com
Load the board with a JFFS2 partition, then use the UBIFS tools (mtdinfo, etc.) to query your device.  It should print out all the settings, and you just map them to the proper arguments.

Good luck,

Chris
 



--
--
OpenEmbedded/Yocto Freescale ARM BSP - meta-f...@googlegroups.com
 
Source code of the BSP: http://github.com/Freescale/meta-fsl-arm
 
To cancel your subscription in this group send an e-mail to meta-fsl-arm...@googlegroups.com
For more options go to http://groups.google.com/group/meta-fsl-arm

Eric Bénard

unread,
Sep 6, 2012, 3:22:46 AM9/6/12
to meta-f...@googlegroups.com
Hi,

Le Wed, 5 Sep 2012 21:53:58 -0700 (PDT),
Amjad Afzaal <bcsf0...@pucit.edu.pk> a écrit :
> *but i don't know what are appropriate values for these arguments. Can
> anybody help me in this regard?*
> *
>
as Chris said you can either boot from a JFFS2 file system or from aNFS
one (or from a ext2/3/4 loaded on a SDCard) and then query the mtd
device which will receive the ubifs. The following is taken from
beagleboard.conf and explains how to get the parameters :

# do ubiattach /dev/ubi_ctrl -m 4
# From dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: logical eraseblock size: 129024 bytes
# from ubiattach stdout:
# UBI device number 0, total 1996 LEBs
MKUBIFS_ARGS = "-m 2048 -e 129024 -c 1996"

# do ubiattach /dev/ubi_ctrl -m 4
# from dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: physical eraseblock size: 131072 bytes (128 KiB)
# UBI: sub-page size: 512
UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512"

Eric

Amjad Afzaal

unread,
Sep 6, 2012, 4:08:13 AM9/6/12
to meta-f...@googlegroups.com
Hi. You guys are really very helpful. Thanks for you kind help.
Now what i am doing is that i connect my imx31pdk device with my laptop through minicom and turn on the device. Then device boots and login prompt shown to me. During boot procedure i saw that redboot passess jffs2 as a file system to kernel. My minicom is running at /dev/ttyUSB0.
Then i type following command on my host terminal(on which ubuntu is running)
 $ ubiattach -m /dev/ttyUSB0

and get the following error

ubiattach: error!: bad MTD device number: "/dev/ttyUSB0"

Now what should i do or what device number should i give or any thing else that can be done ?

Eric Bénard

unread,
Sep 6, 2012, 4:36:52 AM9/6/12
to meta-f...@googlegroups.com
Hi,

Le Thu, 6 Sep 2012 01:08:13 -0700 (PDT),
Amjad Afzaal <bcsf0...@pucit.edu.pk> a écrit :

> Hi. You guys are really very helpful. Thanks for you kind help.
> Now what i am doing is that i connect my imx31pdk device with my laptop
> through minicom and turn on the device. Then device boots and login prompt
> shown to me. During boot procedure i saw that redboot passess jffs2 as a
> file system to kernel. My minicom is running at /dev/ttyUSB0.
> Then i type following command on my host terminal(on which ubuntu is
> running)
> * $ ubiattach -m /dev/ttyUSB0*
>
> and get the following error
>
> *ubiattach: error!: bad MTD device number: "/dev/ttyUSB0"*
>
> Now what should i do or what device number should i give or any thing else
> that can be done ?
>
why do you want to attach a ubi device on the serial port of your PC ?

reading that can help to understand ubi :
http://www.linux-mtd.infradead.org/faq/ubi.html

Also, always think what you are trying to do and where you should run
the commands to get the result you need.

Eric
Reply all
Reply to author
Forward
0 new messages