Skip to contentSkip to conversation

Is it possible for a recipe to include/require something from a subdirectory?

DISCUSSION Ulf Samuelsson 2 participants 3 messages Aug 20, 2009 – Aug 22, 2009

lore
Share & tools
lore
#0 lore raw

I just finished a nice gnome script which allows me to automatically generate SRC_URI_append's

I select the files[1-4] in <recipy-dir>/<recipy>/<xxx>/<yyy>", and then run the script

result is:

SRC_URI_append_<board> = "\
	file://<file1>	\
	file://<file2>	\
	file://<file3>	\
	file://<file4>	\
	"

Now, in <recipy-dir>/<recipy>.bb I want to include the file using

require <xxx>/<yyy>/SRC_URI_append

This did not work, so I tried symlinking - bad move... I'd hate having to move it to the top directory of the recipe.

Any ideas?

Signature · 2 lines
Best Regards
Ulf Samuelsson
#1 lore raw
Quoted 15 lines · Ulf Samuelsson

I just finished a nice gnome script which allows me to automatically generate SRC_URI_append's

I select the files[1-4] in <recipy-dir>/<recipy>/<xxx>/<yyy>", and then run the script

result is:

SRC_URI_append_<board> = "\
       file://<file1>  \
       file://<file2>  \
       file://<file3>  \
       file://<file4>  \
       "

Quoted 8 lines

Now, in <recipy-dir>/<recipy>.bb I want to include the file using

require <xxx>/<yyy>/SRC_URI_append

This did not work, so I tried symlinking - bad move... I'd hate having to move it to the top directory of the recipe.

Any ideas?

include/require obey BBPATH. As far as I know, the parser should be temporarily changing bbpath to facilitate includes relative to the file doing the including. If that isn't working, you could try require ${FILE_DIRNAME}/foo/bar instead.

Signature · 7 lines
Chris Larson
clarson at kergoth dot com
clarson at mvista dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Software Engineer
MontaVista Software, Inc.
#2 lore raw

Chris Larson skrev:

Quoted 23 lines · Ulf Samuelsson
Quoted 22 lines

I just finished a nice gnome script which allows me to automatically generate SRC_URI_append's

I select the files[1-4] in <recipy-dir>/<recipy>/<xxx>/<yyy>", and then run the script

result is:

SRC_URI_append_<board> = "\
       file://<file1>  \
       file://<file2>  \
       file://<file3>  \
       file://<file4>  \
       "

Now, in <recipy-dir>/<recipy>.bb I want to include the file using

require <xxx>/<yyy>/SRC_URI_append

This did not work, so I tried symlinking - bad move... I'd hate having to move it to the top directory of the recipe.

Quoted 6 lines
Quoted 1 line

Any ideas?

include/require obey BBPATH. As far as I know, the parser should be temporarily changing bbpath to facilitate includes relative to the file doing the including. If that isn't working, you could try require ${FILE_DIRNAME}/foo/bar instead.

That worked,
This saves me a lot of time.
I am thinking of checking in the script that generates the file. Anyone interested?

Got as few other gnome scripts which I find useful.

1: Select <dir>; Copy <dir> to <dir>-0rig for creating a patch 2: Select <dir1> and <dir2>; diff -urN <dir1> <dir2>
3: Select <patch>.patch;
splitdiff the patch into the directory <patch>/patchdir. Rename each <patch> to <patch>.patch
If the file "template" is present:
For each <string> (one per line) in template
If a patch matches the string:
create the <string> directory
move all matching patches to this directory.
4: Select <source> and <patch-directory>
The <patch-directory> is identified by having "./patchdir" "./patchdir contains a number of directories (patchsets). Attempt to apply all patches in the patch directory to the source tree using --dry-run.
Provide OK/FAIL result + a list of all
working patches are collected in a file.
5: Select a number of files; Generate SRC_URI_append.inc,
optimized for the kernel
It will check if a file "arch" exists and for
each machine listed in "arch" it will check its subdirectory for a "defconfig", and will generate a SRC_URI_append_<arch>.inc, containing the stuff for each arch.
6: Select <file>; Set the execute bit on the <file>
7: Select <dir> <file>.patch; apply <patch>.patch to <dir>
Report results

Signature · 2 lines
Best Regards
Ulf Samuelsson