Development and Open Embedded
Hi,
I'm helping my organization move our platform build infrastructure to better than the complicated and disparate make jumble of make files and tarballs that we currently use. I've integrated much of it to Open Embedded (basic root fs image, kernel, tools).
This all works well, but it seems to me (a kernel hacker mostly) that the hacking cycle of code, compile, run is a bit difficult if you are working within the confines of source control systems.
that is, say I modify a file within my kernel development (git) tree and then want to compile it. under OE, the whole tree is going to be copied to the sources dir, tarballed, and then extracted into the ${S} directory. Further, when compiling, all the output files are left in the ${S} dir, instead of directing them to an output directory.
I find that most of the engineers I know start to grumble when the have to wait any longer than status quo in any one of the steps for turning around a small change to their source. My experience is mostly inside the kernel, but I suppose other projects are similar on embedded systems.
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})...
Maybe people have solved this problem in other ways or a similar way. I'd love to get some insight into how this is done in other organizations... It would be great to beable to inherit a class that allows use of an efficient dev cycle.
Thanks
Quoted 31 lines · Michael Sundius
Hi,
I'm helping my organization move our platform build infrastructure to better than the complicated and disparate make jumble of make files and tarballs that we currently use. I've integrated much of it to Open Embedded (basic root fs image, kernel, tools).
This all works well, but it seems to me (a kernel hacker mostly) that the hacking cycle of code, compile, run is a bit difficult if you are working within the confines of source control systems.
that is, say I modify a file within my kernel development (git) tree and then want to compile it. under OE, the whole tree is going to be copied to the sources dir, tarballed, and then extracted into the ${S} directory. Further, when compiling, all the output files are left in the ${S} dir, instead of directing them to an output directory.
I find that most of the engineers I know start to grumble when the have to wait any longer than status quo in any one of the steps for turning around a small change to their source. My experience is mostly inside the kernel, but I suppose other projects are similar on embedded systems.
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})...
Quoted 4 lines
Maybe people have solved this problem in other ways or a similar way. I'd love to get some insight into how this is done in other organizations... It would be great to beable to inherit a class that allows use of an efficient dev cycle.
I have a little class somewhere around here that did that. Killed fetch/unpack/patch, set S to ${TOPDIR}, set O to ${TOPDIR}/obj-${HOST_SYS} or so, redirect WORKDIR to ${TOPDIR}/somethingorother, etc. It works very well. You can then add the recipe from the source tree to your BBFILES, or add your development area to COLLECTIONS or so, and it mostly just works. Cleaning up something like that would be a huge boon to the application and kernel developer use cases, which are sadly not well satisfied in current openembedded.
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.
Quoted 6 lines · Chris Larson <clarson <at> kergoth.com> writes:
Quoted 5 lines
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})...
Quoted 9 lines
I have a little class somewhere around here that did that. Killed fetch/unpack/patch, set S to ${TOPDIR}, set O to ${TOPDIR}/obj-${HOST_SYS} or so, redirect WORKDIR to ${TOPDIR}/somethingorother, etc. It works very well. You can then add the recipe from the source tree to your BBFILES, or add your development area to COLLECTIONS or so, and it mostly just works. Cleaning up something like that would be a huge boon to the application and kernel developer use cases, which are sadly not well satisfied in current openembedded.
I'm happy to help clean it up try it out etc for kernel and other stuff. We're told here by our boss that giving back is good, so I'm happy to do it if you don't mind sharing the code and giving me a head start.
mike
Quoted 4 lines · 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 <[email protected]>) 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.