[oe] Development and Open Embedded
Roman I Khimov
khimov at altell.ru
Thu May 7 05:25:32 UTC 2009
On Thursday 07 May 2009 01:33:45 Michael Sundius wrote:
> I'm wondering if anyone has done such a thing as creating a
> recipe that forgoes the "fetch" task and point the ${S} to
> a local devel tree.. then adds an extra onto the make command
> to place the object in another directory (maybe ${O})...
One of our engineers (Alexey Zaytsev <zaytsev at altell.ru>) have done this for
kernel:
==================================================================
python do_fetch() {
linux_prefetch = bb.data.getVar('LINUX_PREFETCH', d)
if not linux_prefetch:
bb.build.exec_func('base_do_fetch', d)
}
python do_unpack() {
import os
linux_prefetch = bb.data.getVar('LINUX_PREFETCH', d)
if not linux_prefetch:
bb.build.exec_func('base_do_unpack', d)
else:
s = bb.data.expand(bb.data.getVar('S', d), d)
os.system("ln -sf %s %s" % (linux_prefetch, s))
config = "file://" + bb.data.getVar('LINUX_CONFIG', d)
oe_unpack_file(bb.fetch.localpath(config, d), d)
}
==================================================================
You set LINUX_PREFETCH to point to git tree in local.conf and LINUX_CONFIG to
config file (LINUX_CONFIG is set in kernel .bb file). That's it. I think it's
very hacky and generally don't like the approach, but the thing works and he's
been working successfully with this hack building two kernels from the same
source base. Of course, there is also separate directory building there, but
that's done in classes (will try to extract a good patch).
Also, just to give more hack directions, there is "git/git_repo/.git" in
sources directory that can be symlinked into "${S}/git/.git", that would allow
using "bitbake -c compile -f" to rebuild the package working with sources in
normal way. I think making bitbake patch to add this symlink would be a bit
better to start with, but then there should be some enforcement of local HEAD
usage without constant "rev=..." specifying in .bb.
More information about the Openembedded-devel
mailing list