[yocto] Best practices for changing a conf file

Mario Domenech Goulart mario at ossystems.com.br
Mon Oct 27 11:16:19 PDT 2014


Hi Nick,

On Mon, 27 Oct 2014 17:25:41 +0000 "Crast, Nicholas" <Nicholas.Crast at saabsensis.com> wrote:

> I’m just looking for some advice on best practices. I want to change
> the configuration file for rsyslog called rsyslog.conf
> (poky/meta/recipes-extended/rsyslog), but there is a certain appeal to
> me of not changing the files in the meta directory. I like to keep
> those pristine and accomplish everything I need with recipes in a
> different layer. Is the best way to change this file to just go in and
> change that .conf file, or is there an easy way to use a .bbappend
> file to substitute my own configuration file?

I think the best approach is to add a bbappend file to your layer, which
installs your own config file.

If the config file is already in SRC_URI (like rsyslog's), it's just a
matter of creating a .bbappend like this:

  $ cat rsyslog_%.bbappend
  FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

, and adding your custom config file to the ${PN} directory (i.e.,
rsyslog/rsyslog.conf).  So, you'll have something like that in your
layer:

  recipes-extended/
  recipes-extended/rsyslog/
  recipes-extended/rsyslog/rsyslog/
  recipes-extended/rsyslog/rsyslog_%.bbappend
  recipes-extended/rsyslog/rsyslog/rsyslog.conf


Best wishes.
Mario
-- 
http://www.ossystems.com.br



More information about the yocto mailing list