[oe-users] Using OpenEmbedded to produce several "almost" identical packages with a single bb.

James Mills jmills at avionpartners.com
Thu Aug 30 21:47:10 UTC 2007


Hello list.

I use OpenEmbedded to manage several embedded Linux distributions, as
well as several hand-rolled packages of my own.  Great system!

I have a need for a package configuration that I cannot seem to find
an example of anywhere, so I am hoping to get a hand from you guys.

There are two levels of difficulty here, and I will try and explain
each of them as much as possible.  Sorry if it doesn't make any
sense...

Okay, I have a product that gets deployed via ipkg.  Up to now, it has
been shipped all-in-one, but I now find myself needing to split the
configuration from the base for two reasons:

a) I am deploying into two environments, and each needs specialized
configuration
b) Inside of each of those environments, I need to create several
config-packages, each again with a slightly different configuration.

My goal is to do this all in one bb file, but I might be pushing it.
If I cannot, then I will settle for creating a separate bb file for
each environment, but would still really like to be able to
dynamically create the config packages for the environment.

Here is a simple example:

I have a program named foo that runs in two different environments,
local and remote.  foo runs on 5 machines in local, and 3 machines in
remote.  Each instance of foo needs three config files.  One called
environment-foo, and the other called id-foo would be created
dynamically by the bb file, and the third config-foo is in an svn
SRC_URI.

So, I need a total of 8 config packages, each containing three files.
I would have:

config-foo-local-1.ipk
config-foo-local-2.ipk
config-foo-local-3.ipk
config-foo-remote-1.ipk
config-foo-remote-2.ipk
config-foo-remote-3.ipk
config-foo-remote-4.ipk
config-foo-remote-5.ipk

In each of these eight packages, the config-foo would be identical,
but the other files would be dynamic, based on which environment and
id they were.

I initially tried to add a task that would read variables from the bb
file, and use a while loop to create a structure for each of the
packages.  I was then going to use PACKAGES_DYNAMIC to sew each of
those up into separate packages.

Of course, I ran into the fact that you cannot (please correct me if I
am wrong) do while loops in bb files, since values are calculated and
replaced before execution.  I had a while loop in the run file that
looked like "while [ 0 -lt 1 ]", since the variables were being
replaced by the values before being run... :)

So, what should I do?  I am happy to create config-foo-remote.bb and
config-foo-local.bb, as long as I can create the needed "id" packages
automatically.  Is doing a straight pythonn task my only option here?

Thanks for any help or advice!

~james




More information about the Openembedded-users mailing list