[yocto] edit system-wise configuration files only on some images

Mauro Salvini mauro.salvini at smigroup.net
Wed Sep 5 00:11:26 PDT 2018


Hi all,

I'm writing to this mailing list to try to collect some advice about a
situation that I'm involved and that could be quite common.

I have a physical machine, and I have my own meta-layers to support it:
a BSP layer containing a machine configuration and some customizations
on kernel and u-boot, and a distro layer containing one distro
configuration and two .bb image recipes, plus some .bbappends.

In detail, I have one test image (used to do some hardware test) and
one production image. Both images are based on core-image, and differs
only for some packages. Moreover, test image needs two more things: a
DEFAULT_TIMEZONE customization and a modified inittab.

For inittab I followed this approach: it is a file installed by another
package, so I created a .bbappend file to sysvinit-inittab recipe that
simply contains FILESEXTRAPATHS_prepend to use my edited inittab
instead of default one (seems to be the recommended method). But doing
this, edited inittab get installed for both my images. I thought to
overrides, but I have same machine and distro for both images, and
there is no way to distinct what image I'm baking.

I evaluate the idea to create one new distro configuration (that
contains also DEFAULT_TIMEZONE configuration, the other thing that I
need to handle but not sure how), but this distro would be useful only
for test image (test-image needs to be built only with test-distro
configuration, and test-distro should be used only for test-image) and
seems to me that would not be how distros and images are intended to
co-operate (that is there aren't limitation on mixing images and
distros).

I read on this mailing list about ROOTFS_POSTPROCESS_COMMAND or a more
complex solution like this [1], but I wonder if there are other
approaches and if possible what is the best among them.

Thanks in advance, regards.

Mauro

[1] https://lists.yoctoproject.org/pipermail/yocto/2018-June/041378.htm
l


More information about the yocto mailing list