[yocto] Per image customizations

Oleksandr Poznyak oleksandr.poznyak at gmail.com
Wed Jun 1 05:25:09 PDT 2016


Don't forget to add your fstab/inittab files into CONFFILES_${PN} cause if
the package that includes them will be changed and You'll update it via
package system, your POSTPROCESS hacks will be overwritten.

Anyway, its better to avoid POSTPROCESS if possible.
1) Create *.bbappend recipe base-files_%s.bbappend in your layer. It
appends to poky "base-files" recipe.
2) Create your own "python do_package_prepend" function where you should
make your recipe produce two different packages
3) Add them to DEPENDS in your image recipe

On Wed, Jun 1, 2016 at 2:57 AM, Paul Eggleton <paul.eggleton at linux.intel.com
> wrote:

> Hi Diego,
>
> On Tue, 31 May 2016 18:05:19 Diego wrote:
> > I've asked this question on IRC, but haven't received complete enough
> > replies, so posting here.
> >
> > I have my own layer with my recipes and customizations. In my layer I
> have
> > two images, one which is the "regular OS" that runs the product
> > application, and one which is the "flash OS", a minimal ramdisk OS that
> > flashes the disks. I want the two images to have different fstab and
> > inittab files: what is the correct way to do that? I know how to handle
> > machine / arch specific differences, but I don't think there's a way to
> > "dress a package depending on the image it gets included in", right?
> >
> > Should I create my own IMAGE_FEATURE and hack my fstab and inittab when
> > rootfs is created, sort of how the "read-only-rootfs" feature was done?
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/core-image
> .
> > bbclass?h=fido#n77
>
> You can do that, yes. The only other possibility is outright replacing the
> package providing the file (since you are free to specify whatever packages
> you want in the image, though you may have to break up
> packagegroup-core-boot
> to do it). This only works of course if either there are no dependencies on
> the package or you can satisfy any dependencies that might exist. It could
> be
> that for your "flash OS" image there aren't any, but it depends what it
> has in
> it.
>
> It may be simpler just to hack it after the fact though. Note that you
> don't
> have to add an IMAGE_FEATURES item to do that - you could simply create a
> shell/python function and add a call to it in ROOTFS_POSTPROCESS_COMMAND.
> If
> the changes to the files are substantial you could even supply the
> alternative
> files in a separate package and then move them over the top of the original
> ones in the postprocessing function to save jumping through hoops adding
> files
> to the image recipe.
>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160601/f58fe9ea/attachment.html>


More information about the yocto mailing list