Creating small ubi volume images for swupdate

331 views
Skip to first unread message

Felix Böhme

unread,
May 9, 2016, 10:41:33 AM5/9/16
to swupdate
Hi,

I would like to split my rootfs (ubifs) in 3 parts:
- a big root part to mount in /
- a small software part to mount in /firmware (< 1MB)
- a small config part to mount in /config ( < 30 KB)

I tried to create an ubi volume image for swupdate with
mkfs.ubifs -e 0x1f000 -c 2048 -m 0x800 -x lzo  -o config.ubifs
and got an image which is > 1,8 MB for a folder which is smaller then 30KB.

Can someone explain whrere the problem is or can suggest me a smarter solution if I´m wrong?

KR
Felix

Stefano Babic

unread,
May 9, 2016, 11:39:48 AM5/9/16
to Felix Böhme, swupdate
Hi Felix,

you are OT here - your question can be better explained on the MTD ML.
The topic is related to ubifs, not swupdate. Anyway:

On 09/05/2016 16:41, Felix Böhme wrote:
> Hi,
>
> I would like to split my rootfs (ubifs) in 3 parts:
> - a big root part to mount in /
> - a small software part to mount in /firmware (< 1MB)
> - a small config part to mount in /config ( < 30 KB)

This is quite not efficient. Do you want to set up a UBI volume about 30
KB ? The overhead for UBI is much more, and you have to taken into
account. IMHO it does not make sense to have such a small UBIFS.

>
> I tried to create an ubi volume image for swupdate with
> |

I do not understand the connection with swupdate...

> mkfs.ubifs -e 0x1f000-c 2048-m 0x800-x lzo -o config.ubifs

Most of this options are default value, and you do not need to specify.
LZO is the default algorithm is not differently specified. -e must
correspond to the size of a LEB, and you specify a maximum size of
2048 LEB.

> |
> and got an image which is > 1,8 MB for a folder which is smaller then 30KB.

Please read documentation about UBI and UBIFS. Not only, to put staff
into a UBIFS you need a UBI volue and this has always some spare LEBs
(2% ot the size of the *whole* NAND is the default value in kernel) to
back up data when some sectors become bad.

>
> Can someone explain whrere the problem

I do not think there is a problem, check how UBI / UBIFS work.

> is or can suggest me a smarter
> solution if I´m wrong?

No idea what you really want. If this is a NAND device, you need
unfortunately to reserve a bigger value. If your storage is not NAND,
you are doing something wrong - you do not need a filesystem at all for
30Kb of data.

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Felix Böhme

unread,
May 9, 2016, 12:05:29 PM5/9/16
to swupdate, boeh...@gmail.com, sba...@denx.de
Ok i can explain the connection with swupdate...
I have a big rootfs,
and some own software modules in folders,
and a configuration of the device in one folder.

Only an OTA update is possible for the devices with small bandwith and traffic limitation. Because of that I can´t do an update of the whole rootfs. Mostly the software partition should be updated and the configuration should be saved. I know that i can use the single file handler of swupdate but would like to have a small (software) image which can be pushed over the air, so I thought to generate small ubi volume image and use the ubi handler of swupdate but that seems wrong in case of less and small files.

What alternatives I have in this case?

Thx
Felix

Stefano Babic

unread,
May 9, 2016, 12:17:29 PM5/9/16
to Felix Böhme, swupdate
Hi Felix,

On 09/05/2016 18:05, Felix Böhme wrote:
> Ok i can explain the connection with swupdate...
> I have a big rootfs,
> and some own software modules in folders,
> and a configuration of the device in one folder.
>
> Only an OTA update is possible for the devices with small bandwith and
> traffic limitation. Because of that I can´t do an update of the whole
> rootfs.

I mean, the only connection is that you plan to use swupdate, but this
has nothing to do with UBI / UBIFS.


> Mostly the software partition should be updated and the
> configuration should be saved. I know that i can use the single file
> handler of swupdate but would like to have a small (software) image
> which can be pushed over the air, so I thought to generate small ubi
> volume image and use the ubi handler of swupdate but that seems wrong in
> case of less and small files.
> What alternatives I have in this case?

You know your project - I cannot say a lot. But if your configuration is
just 30KB, you can think about where to save it. Do you have just NAND
(you do not answer my question if this is the case) ? Then you can
rethink and write your configuration as raw-data (without fs),
duplicating the data (2-4 sectors ?) to avoid that a bad sector let your
data corrupted.
Or do you have another storage (SPI, I2C, ..) ? The size of the
configuration data is so small, that you could use another storage - I2C
Eeprom, ...

Best regards,
Stefano babic
Reply all
Reply to author
Forward
0 new messages