All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Eschenauer <laurent@eschenauer.be>
To: yocto@yoctoproject.org
Subject: A simpler way to apply custom config files to an image ?
Date: Thu, 16 Apr 2015 14:48:47 +0200	[thread overview]
Message-ID: <552FAFAF.30005@eschenauer.be> (raw)

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

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






[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

             reply	other threads:[~2015-04-16 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 12:48 Laurent Eschenauer [this message]
2015-04-16 15:05 ` A simpler way to apply custom config files to an image ? Erik Bolton
2015-04-16 15:31 ` Smith, Virgil
2015-04-17  6:00   ` Anders Darander
2015-04-17  6:18     ` ld: cannot find crti.o: No such file or directory Neil.Wu
2015-04-17 12:45     ` A simpler way to apply custom config files to an image ? Bryan Evenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=552FAFAF.30005@eschenauer.be \
    --to=laurent@eschenauer.be \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.