All of lore.kernel.org
 help / color / mirror / Atom feed
* How to customize a file coming from another recipe?
@ 2013-09-11 19:24 Brad Litterell
  2013-09-12 11:43 ` Tomas Frydrych
  0 siblings, 1 reply; 7+ messages in thread
From: Brad Litterell @ 2013-09-11 19:24 UTC (permalink / raw)
  To: yocto

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

I'm building w/the Arago distribution which contains lighttpd for a web server.  I include this in my image as follows:

IMAGE_INSTALL = "packagegroup-core-boot \
...
lighttpd lighttpd-module-cgi lighttpd-module-compress lighttpd-module-expire \
...
"

This installs a default configuration file for the service which I now want to customize.  What is the recommended way to overwrite or customize files in another package?

Is the best course to create a recipe bbappend for the lighttpd_1.4.31.bb file that is being used?  And can I just include a new file with the same name in my append and will it overwrite the old one, or do I need to create an actual patch file?

Or is it better to create a new separate  recipe that just ships my version of the configuration file? How are conflicts handled when two recipes attempt to install the same file?

Thanks,
Brad


[-- Attachment #2: Type: text/html, Size: 1948 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to customize a file coming from another recipe?
  2013-09-11 19:24 How to customize a file coming from another recipe? Brad Litterell
@ 2013-09-12 11:43 ` Tomas Frydrych
  0 siblings, 0 replies; 7+ messages in thread
From: Tomas Frydrych @ 2013-09-12 11:43 UTC (permalink / raw)
  To: yocto

Hi,

On 11/09/13 20:24, Brad Litterell wrote:
> This installs a default configuration file for the service which I now
> want to customize.  What is the recommended way to overwrite or
> customize files in another package?
> 
> Is the best course to create a recipe bbappend for the
> lighttpd_1.4.31.bb file that is being used?

Yes.

> And can I just include a
> new file with the same name in my append and will it overwrite the old
> one, or do I need to create an actual patch file?

Assuming you set up the FILESEXTRAPATHS in the bbappend correctly (as
per documentation), you can just provide the whole file, it just takes
the first instance of the file it locates in the files path.


> Or is it better to create a new separate  recipe that just ships my
> version of the configuration file? How are conflicts handled when two
> recipes attempt to install the same file?

No, do not do this, two packages can't install the same file (if the
file is being staged to the sysroot, bitbake will catch that, but I am
not sure if currently that throws and error or just a warning; in your
case with a file that is not staged in a sysroot the problem would only
become apparent at rootfs time, but I am not sure how the different
package managers handle this).

Tomas

> 
> Thanks,
> Brad
> 
> 
> 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
> 


-- 
http://sleepfive.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to customize a file coming from another recipe?
  2013-09-12 11:53   ` Nicolas Dechesne
@ 2013-10-10 10:33     ` Paul Eggleton
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Eggleton @ 2013-10-10 10:33 UTC (permalink / raw)
  To: Nicolas Dechesne; +Cc: yocto

On Thursday 12 September 2013 13:53:49 Nicolas Dechesne wrote:
> On Thu, Sep 12, 2013 at 12:16 PM, Paul Eggleton <
> paul.eggleton@linux.intel.com> wrote:
> > > Is the best course to create a recipe bbappend for the
> > > lighttpd_1.4.31.bb file that is being used?  And can I just include a new
> > > file with the same name in my append and will it overwrite the old one,
> > > or do I need to create an actual patch file?
> > 
> > So, since this config file is provided along with the original recipe, and
> > is already mentioned in SRC_URI and installed within do_install, you only
> > need to extend FILESEXTRAPATHS in your bbappend so that the system can
> > pick up your version of the file. Outright replacing the file is the easiest
> > way here rather than trying to patch it.
> > 
> > So in your bbappend you would have:
> > 
> > FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> 
> how about if the lighttpd.conf file needs to be fetched (git or svn)
> instead added in the same repo as the recipe?

If fetching from git/svn then you'd just add an entry to SRC_URI, and the file 
would be fetched into a subdirectory; you'd then just have a do_install() / 
do_install_append() to install the version of the file from within that 
subdirectory.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to customize a file coming from another recipe?
  2013-09-12 10:16 ` Paul Eggleton
@ 2013-09-12 11:53   ` Nicolas Dechesne
  2013-10-10 10:33     ` Paul Eggleton
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Dechesne @ 2013-09-12 11:53 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: Yocto list discussion

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

On Thu, Sep 12, 2013 at 12:16 PM, Paul Eggleton <
paul.eggleton@linux.intel.com> wrote:

> > Is the best course to create a recipe bbappend for the
> lighttpd_1.4.31.bb
> > file that is being used?  And can I just include a new file with the same
> > name in my append and will it overwrite the old one, or do I need to
> create
> > an actual patch file?
>
> So, since this config file is provided along with the original recipe, and
> is
> already mentioned in SRC_URI and installed within do_install, you only
> need to
> extend FILESEXTRAPATHS in your bbappend so that the system can pick up your
> version of the file. Outright replacing the file is the easiest way here
> rather
> than trying to patch it.
>
> So in your bbappend you would have:
>
> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"


how about if the lighttpd.conf file needs to be fetched (git or svn)
instead added in the same repo as the recipe?

[-- Attachment #2: Type: text/html, Size: 1433 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to customize a file coming from another recipe?
  2013-09-11 20:30 Brad Litterell
  2013-09-12 10:16 ` Paul Eggleton
@ 2013-09-12 10:25 ` Andrea Galbusera
  1 sibling, 0 replies; 7+ messages in thread
From: Andrea Galbusera @ 2013-09-12 10:25 UTC (permalink / raw)
  To: Brad Litterell; +Cc: yocto

Hi Brad,

On Wed, Sep 11, 2013 at 10:30 PM, Brad Litterell <brad@evidence.com> wrote:
> I'm building w/the Arago distribution which contains lighttpd for a web
> server.  I include this in my image as follows:
>
> IMAGE_INSTALL = "packagegroup-core-boot \
> ...
> lighttpd lighttpd-module-cgi lighttpd-module-compress lighttpd-module-expire
> \
> ...
> "
>
> This installs a default configuration file for the service which I now want
> to customize.  What is the recommended way to overwrite or customize files
> in another package?
> Is the best course to create a recipe bbappend for the lighttpd_1.4.31.bb
> file that is being used?  And can I just include a new file with the same
> name in my append and will it overwrite the old one, or do I need to create
> an actual patch file?

In my experience, the suggested approach for packaging and deploying a
custom configuration file in your target rootfs is to define an
override for the corresponding recipe.
The way you do this is slightly different depending upon the Arago
Project your using: from some details you provide, I guess you are
using meta-arago layer on top of Yocto build system and not the old
Arago Project based on OpenEmbedded Classic. If this is not the case
you might have better luck posting this to the arago mailing list.

If this is correct instead, the suggested approach for packaging and
deploying a custom configuration file is to define a .bbappend for
lighttpd recipe i.e. in your own layer. See [1] for more details and
examples on using bbappend files.

[1] http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#using-bbappend-files


> Or is it better to create a new separate  recipe that just ships my version
> of the configuration file?

This is not convenient, since it would generate metadata duplication
and a lot of unnecessary maintenance burden when the upstream recipe
gets updated.

> How are conflicts handled when two recipes
> attempt to install the same file?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to customize a file coming from another recipe?
  2013-09-11 20:30 Brad Litterell
@ 2013-09-12 10:16 ` Paul Eggleton
  2013-09-12 11:53   ` Nicolas Dechesne
  2013-09-12 10:25 ` Andrea Galbusera
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Eggleton @ 2013-09-12 10:16 UTC (permalink / raw)
  To: Brad Litterell; +Cc: yocto

Hi Brad,

On Wednesday 11 September 2013 20:30:47 Brad Litterell wrote:
> I'm building w/the Arago distribution which contains lighttpd for a web
> server.  I include this in my image as follows:
> 
> IMAGE_INSTALL = "packagegroup-core-boot \
> ...
> lighttpd lighttpd-module-cgi lighttpd-module-compress lighttpd-module-expire
> \ ...
> "
> 
> This installs a default configuration file for the service which I now want
> to customize.  What is the recommended way to overwrite or customize files
> in another package?
> 
> Is the best course to create a recipe bbappend for the lighttpd_1.4.31.bb
> file that is being used?  And can I just include a new file with the same
> name in my append and will it overwrite the old one, or do I need to create
> an actual patch file?

So, since this config file is provided along with the original recipe, and is 
already mentioned in SRC_URI and installed within do_install, you only need to 
extend FILESEXTRAPATHS in your bbappend so that the system can pick up your 
version of the file. Outright replacing the file is the easiest way here rather 
than trying to patch it.

So in your bbappend you would have:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

and then next to the bbappend you would have a directory called "lighttpd" (to 
match ${PN} in the above line) containing your replacement lighttpd.conf file. 
If you prefer you could replace "${PN}" with "files" and name the directory the 
same; it's up to you.

> Or is it better to create a new separate  recipe that just ships my version
> of the configuration file? How are conflicts handled when two recipes
> attempt to install the same file?

This won't work because the package manager will refuse to install packages 
that install the same file (unless it is forced). bbappending the existing 
recipe is the way to go.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 7+ messages in thread

* How to customize a file coming from another recipe?
@ 2013-09-11 20:30 Brad Litterell
  2013-09-12 10:16 ` Paul Eggleton
  2013-09-12 10:25 ` Andrea Galbusera
  0 siblings, 2 replies; 7+ messages in thread
From: Brad Litterell @ 2013-09-11 20:30 UTC (permalink / raw)
  To: yocto

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

I'm building w/the Arago distribution which contains lighttpd for a web server.  I include this in my image as follows:

IMAGE_INSTALL = "packagegroup-core-boot \
...
lighttpd lighttpd-module-cgi lighttpd-module-compress lighttpd-module-expire \
...
"

This installs a default configuration file for the service which I now want to customize.  What is the recommended way to overwrite or customize files in another package?

Is the best course to create a recipe bbappend for the lighttpd_1.4.31.bb file that is being used?  And can I just include a new file with the same name in my append and will it overwrite the old one, or do I need to create an actual patch file?

Or is it better to create a new separate  recipe that just ships my version of the configuration file? How are conflicts handled when two recipes attempt to install the same file?

Thanks,
Brad

[-- Attachment #2: Type: text/html, Size: 1432 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-10 10:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 19:24 How to customize a file coming from another recipe? Brad Litterell
2013-09-12 11:43 ` Tomas Frydrych
2013-09-11 20:30 Brad Litterell
2013-09-12 10:16 ` Paul Eggleton
2013-09-12 11:53   ` Nicolas Dechesne
2013-10-10 10:33     ` Paul Eggleton
2013-09-12 10:25 ` Andrea Galbusera

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.