Re: A simpler way to apply custom config files to an image ?


Bryan Evenson
 

Laurent,

-----Original Message-----
From: yocto-bounces@... [mailto:yocto-
bounces@...] On Behalf Of Anders Darander
Sent: Friday, April 17, 2015 2:01 AM
To: yocto@...
Subject: Re: [yocto] A simpler way to apply custom config files to an image ?

* Smith, Virgil <Virgil.Smith@...> [150416 17:33]:

I want to customize various config file of an image I'm building (e.g.
network interfaces, sshd banner, hostapd, etc..).
Paul Eggleton just gave a response to a similar question "Force install
package last"
https://lists.yoctoproject.org/pipermail/yocto/2015-April/024548.html
- 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 ?
If I understand you correctly, that would be a patch. For "unchecked"
whole replacement of files, I've seen bbappends with a do_patch_append
function to copy files (specified individually in SRC_URI like patch
files) from the base of the work dir to the correct path under the
source directory.
Unless the buildprocess heavily modifies the config file, I wouldn't create a
patch to patch it in the source tree. I'd rather just add the complete config
file to FILES +=... and then replace the one from the source package with my
copy in a do_install_appen() function.

This is by far the simplest way of those two.
I had similar issues getting my build system to take my copy of the kernel defconfig instead of the ones on the other layers. In bblayers.conf, I made sure my layer was at the top of the BBLAYERS list and I set the BBFILE_PRIORITY for my layer to a higher number than the other layers (in my layer's conf/layer.conf file). See http://www.yoctoproject.org/docs/1.7.1/mega-manual/mega-manual.html#var-BBFILE_PRIORITY for details on BBFILE_PRIORITY. I don't think the order in BBLAYERS makes a difference, but it is one way I can easily remember the BBFILE_PRIORITY for the different layers.

I would also suggest using a bbappend in your own layer to modify the configuration file. It makes it much easier to handle mainline updates. If the change you are making is not version dependent then you can use a wildcard for the bbappend name in your layer. For example, I have the cron job list specified in a configuration file in my layer for cronie. I named the bbappend "cronie_%.bbappend". Now the main cronie package can continue to get updates for newer versions and there is nothing I have to do with cronie in my layer.

Regards,
Bryan


Cheers,
Anders

--
Anders Darander
ChargeStorm AB / eStorm AB
--
_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto

Join {yocto@lists.yoctoproject.org to automatically receive all group messages.