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

2015-04-17 Thread Anders Darander
* Smith, Virgil virgil.sm...@flir.com [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.

Cheers,
Anders

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


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

2015-04-17 Thread Bryan Evenson
Laurent,

 -Original Message-
 From: yocto-boun...@yoctoproject.org [mailto:yocto-
 boun...@yoctoproject.org] On Behalf Of Anders Darander
 Sent: Friday, April 17, 2015 2:01 AM
 To: yocto@yoctoproject.org
 Subject: Re: [yocto] A simpler way to apply custom config files to an image ?
 
 * Smith, Virgil virgil.sm...@flir.com [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@yoctoproject.org
 https://lists.yoctoproject.org/listinfo/yocto
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


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

2015-04-16 Thread Erik Bolton
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 laur...@eschenauer.be
To: yocto@yoctoproject.org yocto@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.
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


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

2015-04-16 Thread Smith, Virgil
 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.



Notice to recipient: This email is meant for only the intended recipient of the 
transmission, and may be a communication privileged by law, subject to export 
control restrictions or that otherwise contains proprietary information. If you 
receive this email by mistake, please notify us immediately by replying to this 
message and then destroy it and do not review, disclose, copy or distribute it. 
Thank you in advance for your cooperation.
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


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

2015-04-16 Thread Laurent Eschenauer
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







signature.asc
Description: OpenPGP digital signature
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto