<div dir="ltr"><div>Hi Ulrich,</div><div><br></div><div>thank you very much for your explanation. The provided genimage.config looks similar to mine, so I guess it is ok. I will try when I come back to the office. The point I missed was that I need to call: bitbake your-customized-ubi and not bitbake my-custom-image, right?</div><div><br></div><div>Thank you again, <br></div><div>Gabriele<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 3 mag 2019 alle ore 07:59 Ulrich Ölmann <<a href="mailto:u.oelmann@pengutronix.de">u.oelmann@pengutronix.de</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Gabriele,<br>
<br>
On Thu, May 02 2019 at 13:25 +0200, Gabriele Zampieri <<a href="mailto:gabbla.malist@gmail.com" target="_blank">gabbla.malist@gmail.com</a>> wrote:<br>
> ok, I guess I miss-understand how that class works. I thought that I<br>
> had to add the customization on my own image recipe.<br>
> So the correct way is to write a 'customization recipe' and install<br>
> via IMAGE_INSTALL? Can you provide an example?<br>
<br>
use your custom image recipe as before to just produce your root-<br>
filesystem which results in a (compressed) tar-file in ${DEPLOY_DIR_<br>
IMAGE}. It will be referenced from the genimage recipe without any file<br>
extension via GENIMAGE_ROOTFS_IMAGE. Now your UBI-recipe (e.g. 'your-<br>
<a href="http://customized-ubi.bb" rel="noreferrer" target="_blank">customized-ubi.bb</a>') could look like<br>
<br>
  inherit genimage<br>
  LICENSE = "MIT"<br>
  LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"<br>
<br>
  SRC_URI += "file://genimage.config"<br>
<br>
  # to not confuse the flashable UBI-image ('ubi')<br>
  # with the UBI-filesystems ('ubifs') it contains<br>
  GENIMAGE_IMAGE_SUFFIX = "ubi"<br>
<br>
  # the name of the root-filesystem genimage should use<br>
  GENIMAGE_ROOTFS_IMAGE = "your-customized-rootfs"<br>
<br>
with the accompanying 'genimage.config' for example as follows<br>
<br>
  #<br>
  # Manufacturer ID: 0x2c, Chip ID: 0xda<br>
  # -> Micron MT29F2G08ABAEAWP<br>
  # 256 MiB, SLC<br>
  #<br>
  flash nand {<br>
    pebsize = 131072<br>
    lebsize = 126976<br>
    numpebs = 2044<br>
    minimum-io-unit-size = 2048<br>
    sub-page-size = 2048<br>
  }<br>
<br>
  image @IMAGE@ {<br>
    flashtype = "nand"<br>
    ubi {<br>
    }<br>
<br>
    partition rootfs {<br>
        image = rootfs.ubifs<br>
        size = 64MiB<br>
    }<br>
<br>
    partition opt {<br>
        image = opt.ubifs<br>
        size = 32MiB<br>
    }<br>
<br>
    partition data {<br>
        image = data.ubifs<br>
        autoresize = true<br>
    }<br>
  }<br>
<br>
  image rootfs.ubifs {<br>
    flashtype = "nand"<br>
    ubifs {<br>
        extraargs = "-x lzo"<br>
        max-size = 64MiB<br>
    }<br>
    mountpoint = "/"<br>
  }<br>
<br>
  image opt.ubifs {<br>
    flashtype = "nand"<br>
    ubifs {<br>
        extraargs = "-x lzo"<br>
        max-size = 32MiB<br>
    }<br>
    mountpoint = "/opt"<br>
  }<br>
<br>
  image data.ubifs {<br>
    flashtype = "nand"<br>
    ubifs {<br>
        extraargs = "-x lzo"<br>
        max-size = 192MiB<br>
    }<br>
    mountpoint = "/data"<br>
  }<br>
<br>
In a UBI-image almost all UBI-volumes need to have a fixed size and only<br>
one is allowed to use the autoresize mechanism which blows it up to use<br>
the remaining space when it is UBI-attached for the first time. Distinct<br>
from that is the UBI-filesystem's max-size parameter which prescribes<br>
the maximum size of an UBI-volume that shall be addressable by this<br>
filesystem. This means that if you would re-use 'data.ubifs' in a volume<br>
that has been autoresized to e.g. 1024MiB the filesystem would not be<br>
able to make use of it.<br>
<br>
I neither tested the recipe nor the genimage.config, so please give some<br>
feedback.<br>
<br>
Best regards<br>
Ulrich<br>
<br>
<br>
> Thanks,<br>
> Gabriele<br>
><br>
> Il giorno mer 24 apr 2019 alle ore 15:15 Ulrich Ölmann <<br>
> <a href="mailto:u.oelmann@pengutronix.de" target="_blank">u.oelmann@pengutronix.de</a>> ha scritto:<br>
><br>
>> Hi Gabriele,<br>
>><br>
>> On Wed, Apr 24 2019 at 14:06 +0200, Gabriele Zampieri <<br>
>> <a href="mailto:gabbla.malist@gmail.com" target="_blank">gabbla.malist@gmail.com</a>> wrote:<br>
>> > I'm now testing genimage via meta-ptx in my Yocto workflow, but I found a<br>
>> > problem: I cannot set a SRC_URI in my custom image recipe (that inherit<br>
>> > from core-image which in turn inherit from image) because do_fetch and<br>
>> > do_unpack tasks have noexec set to 1. If I specify the SRC_URI with my<br>
>> > genimage.config, bitbake exits, complaining about LIC_FILE_CHECKSUM (that<br>
>> > is correctly specified). If I hack image.bbclass and comment out<br>
>> ><br>
>> > #do_fetch[noexec] = "1"<br>
>> ><br>
>> ><br>
>> > #do_unpack[noexec] = "1"<br>
>> ><br>
>> > The process start correctly. Is there a way to avoid touching<br>
>> image.bbclass<br>
>> > and install my configuration from the image recipe?<br>
>> ><br>
>> > Thanks,<br>
>> > Gabriele<br>
>><br>
>> you need one or more recipe(s) that construct(s) your filesystem(s) and<br>
>> a separate one that makes a flashable image out of that (see the<br>
>> introductory documentation in 'genimage.bbclass'). In the former you<br>
>> inherit 'core-image' and only in the latter which inherits 'genimage'<br>
>> you have to set the SRC_URI to point to your 'genimage.config'.<br>
>><br>
>> Best regards<br>
>> Ulrich<br>
>><br>
>><br>
>> > Il giorno mer 13 mar 2019 alle ore 16:14 Gabriele Zampieri <<br>
>> > <a href="mailto:gabbla.malist@gmail.com" target="_blank">gabbla.malist@gmail.com</a>> ha scritto:<br>
>> ><br>
>> >> Hi all,<br>
>> >><br>
>> >> thank you very much for the suggestion, I will check genimage and test<br>
>> it.<br>
>> >><br>
>> >> Gabriele<br>
>> >><br>
>> >> Il giorno gio 7 mar 2019 alle ore 16:23 Ulrich Ölmann <<br>
>> >> <a href="mailto:u.oelmann@pengutronix.de" target="_blank">u.oelmann@pengutronix.de</a>> ha scritto:<br>
>> >><br>
>> >>> Hi there,<br>
>> >>><br>
>> >>> On Thu, Mar 07 2019 at 15:11 +0100, Stelling2 Carsten <<br>
>> >>> <a href="mailto:Carsten.Stelling2@goerlitz.com" target="_blank">Carsten.Stelling2@goerlitz.com</a>> wrote:<br>
>> >>> > Have you seen <a href="https://github.com/pengutronix/genimage" rel="noreferrer" target="_blank">https://github.com/pengutronix/genimage</a>?<br>
>> >>><br>
>> >>> you can find it included within<br>
>> <a href="https://github.com/pengutronix/meta-ptx" rel="noreferrer" target="_blank">https://github.com/pengutronix/meta-ptx</a><br>
>> >>> with an accompanying genimage.bbclass.<br>
>> >>><br>
>> >>> Best regards<br>
>> >>> Ulrich<br>
>> >>><br>
>> >>> > Regards,<br>
>> >>> ><br>
>> >>> > Carsten<br>
>> >>> ><br>
>> >>> > Von: <a href="mailto:yocto-bounces@yoctoproject.org" target="_blank">yocto-bounces@yoctoproject.org</a> [mailto:<br>
>> >>> <a href="mailto:yocto-bounces@yoctoproject.org" target="_blank">yocto-bounces@yoctoproject.org</a>] Im Auftrag von Gabriele Zampieri<br>
>> >>> > Gesendet: Montag, 4. März 2019 12:17<br>
>> >>> > An: <a href="mailto:yocto@yoctoproject.org" target="_blank">yocto@yoctoproject.org</a><br>
>> >>> > Betreff: [yocto] Multiple ubifs partition<br>
>> >>> ><br>
>> >>> > Hi all,<br>
>> >>> ><br>
>> >>> > I'm trying to build a distribution that has multiple partitions. The<br>
>> >>> desiderata is something like:<br>
>> >>> ><br>
>> >>> > - rootfs.ubifs mounted on /<br>
>> >>> > - data.ubifs mounted on /data<br>
>> >>> > - opt.ubifs mounted on /opt<br>
>> >>> ><br>
>> >>> > I was wondering if there is a standard way to achieve the goal. I see<br>
>> >>> that there is a tool called wic, but it does not seems to support<br>
>> ubifs. I<br>
>> >>> could post process the tarball image and doing stuff with my scripts,<br>
>> but<br>
>> >>> I'd prefer doing this in a single bitbake run. Can you suggest<br>
>> something?<br>
>> >>> ><br>
>> >>> > Thanks,<br>
>> >>> > Gabriele<br>
>> >>><br>
>> >>><br>
>> >>> --<br>
>> >>> Pengutronix e.K.              | Ulrich Ölmann<br>
>>Â Â |<br>
>> >>> Industrial Linux Solutions         |<br>
>> <a href="http://www.pengutronix.de/" rel="noreferrer" target="_blank">http://www.pengutronix.de/</a><br>
>> >>> |<br>
>> >>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0<br>
>>Â Â |<br>
>> >>> Amtsgericht Hildesheim, HRA 2686Â Â Â Â Â Â | Fax:<br>
>>Â +49-5121-206917-5555 |<br>
>> >>><br>
>> >><br>
>><br>
>><br>
>> --<br>
>> Pengutronix e.K.              | Ulrich Ölmann        |<br>
>> Industrial Linux Solutions         | <a href="http://www.pengutronix.de/" rel="noreferrer" target="_blank">http://www.pengutronix.de/</a> |<br>
>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0Â Â |<br>
>> Amtsgericht Hildesheim, HRA 2686Â Â Â Â Â Â | Fax:Â Â +49-5121-206917-5555 |<br>
>><br>
<br>
<br>
--<br>
Pengutronix e.K.              | Ulrich Ölmann        |<br>
Industrial Linux Solutions         | <a href="http://www.pengutronix.de/" rel="noreferrer" target="_blank">http://www.pengutronix.de/</a> |<br>
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0Â Â |<br>
Amtsgericht Hildesheim, HRA 2686Â Â Â Â Â Â | Fax:Â Â +49-5121-206917-5555 |<br>
</blockquote></div>