All of lore.kernel.org
 help / color / mirror / Atom feed
* #yocto Preferred development workflow
@ 2021-07-13  3:40 ivin.lim
  2021-07-13  4:10 ` [yocto] " Chuck Wolber
  0 siblings, 1 reply; 4+ messages in thread
From: ivin.lim @ 2021-07-13  3:40 UTC (permalink / raw)
  To: yocto

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

Hi everyone,

I'm curious on a good approach when dealing with multiple projects

I've just started out  yocto and have already  created our own meta-layer which contains our modules. Now these modules would sometimes have config files and this could vary when each project that we have would use these recipes. I'm thinking of a way to control this. And I don't think having one branch per project is a good style. Right now the best way I can think of is creating seperate "project layers" (ex. meta-project1, meta-project2) and from there create those .bbappends which would point to the project-specific conf files.

But I was wondering if there is a better way of handling it. Thanks.

Cheers.

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

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

* Re: [yocto] #yocto Preferred development workflow
  2021-07-13  3:40 #yocto Preferred development workflow ivin.lim
@ 2021-07-13  4:10 ` Chuck Wolber
  2021-07-13  4:36   ` ivin.lim
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Wolber @ 2021-07-13  4:10 UTC (permalink / raw)
  To: ivin.lim; +Cc: yocto

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

You left a few details out about how the configuration files are managed.
Ideally you could just make bitbake recipes for the config files
themselves. This way you can create an image recipe for each project and
use the IMAGE_INSTALL variable to append whatever configs and modules you
want on a per-project basis.

..Ch:W..

On Mon, Jul 12, 2021 at 8:40 PM ivin.lim via lists.yoctoproject.org
<ivin.lim=aei.com@lists.yoctoproject.org> wrote:

> Hi everyone,
>
> I'm curious on a good approach when dealing with multiple projects
>
> I've just started out  yocto and have already  created our own meta-layer
> which contains our modules. Now these modules would sometimes have config
> files and this could vary when each project that we have would use these
> recipes. I'm thinking of a way to control this. And I don't think having
> one branch per project is a good style. Right now the best way I can think
> of is creating seperate "project layers" (ex. meta-project1, meta-project2)
> and from there create those .bbappends which would point to the
> project-specific conf files.
>
> But I was wondering if there is a better way of handling it. Thanks.
>
> Cheers.
> 
>
>

-- 
*"Perfection must be reached by degrees; she requires the slow hand of
time." - Voltaire*

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

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

* Re: #yocto Preferred development workflow
  2021-07-13  4:10 ` [yocto] " Chuck Wolber
@ 2021-07-13  4:36   ` ivin.lim
  2021-07-13  5:14     ` [yocto] " Chuck Wolber
  0 siblings, 1 reply; 4+ messages in thread
From: ivin.lim @ 2021-07-13  4:36 UTC (permalink / raw)
  To: yocto

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

sorry about that, right now the config files are placed in the files directory of the recipe which builds the module.

Sample snippets of the recipe concerning this config file, I removed the rest of lines.
SRC_URI = " \
file://config.json \
"

do_install_append() {
install -m 0644 ${WORKDIR}/config.json ${D}/etc/directory/
}

If I were to have the config files placed on a separate recipe, would that mean making multiple of these recipes depending on the number of projects?
I did thought also of adding it in the image recipe but probably this wouldn't look well if more things get added.

Thanks

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

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

* Re: [yocto] #yocto Preferred development workflow
  2021-07-13  4:36   ` ivin.lim
@ 2021-07-13  5:14     ` Chuck Wolber
  0 siblings, 0 replies; 4+ messages in thread
From: Chuck Wolber @ 2021-07-13  5:14 UTC (permalink / raw)
  To: ivin.lim; +Cc: yocto

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

We have many recipes appended to IMAGE_INSTALL in our image recipes and it
works just fine.

From your description, it sounds like you could go either way. I personally
prefer to keep my image recipes as clean as possible, so I push as much as
I can to individual recipes. This helps with debugging later on as your
project (inevitably) gets more complex.

Also... Experience has shown that the following form is a lot more readable:

IMAGE_INSTALL  = "recipe_1"
IMAGE_INSTALL += "recipe_2"
IMAGE_INSTALL += "recipe_3"
IMAGE_INSTALL += "recipe_4"
IMAGE_INSTALL += "recipe_5"

Than this:

IMAGE_INSTALL = "\
         recipe_1 \
         recipe_2 \
         recipe_3 \
         recipe_4 \
         recipe_5"

When your repository grows large, a recursive grep for recipe_2 will make a
lot more sense if "IMAGE_INSTALL += "recipe_2"" is returned instead of
"recipe_2 \". The latter form gives no clue as to how recipe_2 is being
referenced.


..Ch:W..

On Mon, Jul 12, 2021 at 9:36 PM ivin.lim via lists.yoctoproject.org
<ivin.lim=aei.com@lists.yoctoproject.org> wrote:

> sorry about that, right now the config files are placed in the files
> directory of the recipe which builds the module.
>
> Sample snippets of the recipe concerning this config file, I removed the
> rest of lines.
> *SRC_URI = " \*
> * file://config.json \*
> *    "*
>
> *do_install_append() {*
> * install -m 0644 ${WORKDIR}/config.json ${D}/etc/directory/*
>
>
>
> *}*If I were to have the config files placed on a separate recipe, would
> that mean making multiple of these recipes depending on the number of
> projects?
> I did thought also of adding it in the image recipe but probably this
> wouldn't look well if more things get added.
>
>
> Thanks
>
>
> 
>
>

-- 
*"Perfection must be reached by degrees; she requires the slow hand of
time." - Voltaire*

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

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

end of thread, other threads:[~2021-07-13  5:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  3:40 #yocto Preferred development workflow ivin.lim
2021-07-13  4:10 ` [yocto] " Chuck Wolber
2021-07-13  4:36   ` ivin.lim
2021-07-13  5:14     ` [yocto] " Chuck Wolber

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.