[yocto] A simpler way to apply custom config files to an image ?

Erik Bolton EBolton at agjunction.com
Thu Apr 16 08:05:24 PDT 2015


Hey Laurent:

Is your config recipe being built before all the recipes with the default config files and overriding your config files?

In that case I would make anything with a config file that you want to override a dependency of your config recipe.

What's the actual error?

-Erik

Sent from my Verizon 4G LTE Smartphone

----- Reply message -----
From: "Laurent Eschenauer" <laurent at eschenauer.be>
To: "yocto at yoctoproject.org" <yocto at yoctoproject.org>
Subject: [yocto] A simpler way to apply custom config files to an image ?
Date: Thu, Apr 16, 2015 7:18 AM

Hello,

I'm stuck on something that I would have assumed trivial and can't
managed to do and hope someone can point me to a best practice.

I want to customize various config file of an image I'm building (e.g.
network interfaces, sshd banner, hostapd, etc..).

To make this simple, I wrote my own recipe called 'custom-config' and
bundled in there all my config files. Then copying them in the on_install.

do_install () {
   install -m 0755 -d ${D}${sysconfdir}
   install -b -m 0644 ${WORKDIR}/udhcpd.conf ${D}${sysconfdir}
   install -b -m 0644 ${WORKDIR}/hostapd.conf ${D}${sysconfdir}
   ....
}

It works great for files that are not provided by packages (e.g.
udhcpd.conf), however it does not work for files already provided by
another package (e.g. hostapd.conf). I've tried adding the backup flag
to install but this did not help.

It seems the recommended way to do this is by extending each individual
recipe with bbappend and provide an updated config file. This works
great, although quite heavy for just updating a single config file.

More over, this does not work when the config file is not in the recipe
but coming from sources archive. This is the case with hostapd.conf from
recipe hostapd.

Questions:

- Is my idea of a single 'config' recipe completely stupid ? is there
any way to make it work ? It seems the simpler approach.

- If not possible and I have to stick with bbappend to every recipe
concerned, then how could I do it in the case of a config file coming
from the source package instead of the recipe ?

Thanks for your help !

Best,

Laurent





Disclaimer: This message contains information that may be privileged or confidential and is the property of AgJunction Inc and its subsidiaries. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20150416/6de99697/attachment.html>


More information about the yocto mailing list