* A simpler way to apply custom config files to an image ?
@ 2015-04-16 12:48 Laurent Eschenauer
2015-04-16 15:05 ` Erik Bolton
2015-04-16 15:31 ` Smith, Virgil
0 siblings, 2 replies; 6+ messages in thread
From: Laurent Eschenauer @ 2015-04-16 12:48 UTC (permalink / raw)
To: yocto
[-- 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 --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: A simpler way to apply custom config files to an image ?
2015-04-16 12:48 A simpler way to apply custom config files to an image ? Laurent Eschenauer
@ 2015-04-16 15:05 ` Erik Bolton
2015-04-16 15:31 ` Smith, Virgil
1 sibling, 0 replies; 6+ messages in thread
From: Erik Bolton @ 2015-04-16 15:05 UTC (permalink / raw)
To: Laurent Eschenauer, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 2694 bytes --]
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@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.
[-- Attachment #2: Type: text/html, Size: 3857 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: A simpler way to apply custom config files to an image ?
2015-04-16 12:48 A simpler way to apply custom config files to an image ? Laurent Eschenauer
2015-04-16 15:05 ` Erik Bolton
@ 2015-04-16 15:31 ` Smith, Virgil
2015-04-17 6:00 ` Anders Darander
1 sibling, 1 reply; 6+ messages in thread
From: Smith, Virgil @ 2015-04-16 15:31 UTC (permalink / raw)
To: Laurent Eschenauer, yocto@yoctoproject.org
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A simpler way to apply custom config files to an image ?
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
0 siblings, 2 replies; 6+ messages in thread
From: Anders Darander @ 2015-04-17 6:00 UTC (permalink / raw)
To: yocto
* Smith, Virgil <Virgil.Smith@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* ld: cannot find crti.o: No such file or directory
2015-04-17 6:00 ` Anders Darander
@ 2015-04-17 6:18 ` Neil.Wu
2015-04-17 12:45 ` A simpler way to apply custom config files to an image ? Bryan Evenson
1 sibling, 0 replies; 6+ messages in thread
From: Neil.Wu @ 2015-04-17 6:18 UTC (permalink / raw)
To: yocto
Hi, all
I use the 1.8 YP to build the ccgi, the receip of ccgi as this:
SUMMARY = "Add ccgi lib to rootfs"
HOMEPAGE = "http://sourceforge.net/projects/libccgi/?source=typ_redirect"
LICENSE = "GPLv2"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
FILES_${PN}_dev = "${libdir}/* ${includedir}/* "
SRC_URI = "file://${PN}-${PV}.tgz \
file://0001-modify-the-source-code-to-match-the-G4-code.patch \ "
S = "${WORKDIR}/${PN}-${PV}"
PARALLEL_MAKEINST="prefix=${D}/usr"
EXTRA_OEMAKE = 'CROSS=${HOST_PREFIX}'
do_compile() {
oe_runmake OPENSSL_INCLUDE=${TOPDIR}/tmp/sysroots/${MACHINE}/usr/include
}
It appears the error as follows:
/home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crti.o: No such file or directory
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtbeginS.o: No such file or directory
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc_s
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lpthread
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lc
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc_s
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtendS.o: No such file or directory
| /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtn.o: No such file or directory
In fact , I can find the crti.o in /home/ectrs/poky/coretexa8/tmp/sysroots/i686-linux/usr/ directory.
How to resolve this problem? If you know ,please tell me .
Thanks
Neil
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: A simpler way to apply custom config files to an image ?
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 ` Bryan Evenson
1 sibling, 0 replies; 6+ messages in thread
From: Bryan Evenson @ 2015-04-17 12:45 UTC (permalink / raw)
To: yocto@yoctoproject.org, Laurent Eschenauer
Laurent,
> -----Original Message-----
> From: yocto-bounces@yoctoproject.org [mailto:yocto-
> bounces@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.Smith@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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-04-17 12:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16 12:48 A simpler way to apply custom config files to an image ? Laurent Eschenauer
2015-04-16 15:05 ` 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
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.