[yocto] package development recompile and install to rootfs

Paul Eggleton paul.eggleton at linux.intel.com
Thu Sep 12 03:48:53 PDT 2013


Hi Karl / Hans,

On Thursday 12 September 2013 12:28:16 Hans Beckérus wrote:
> On Thu, Sep 12, 2013 at 11:57 AM, Karl Hiramoto <karl at hiramoto.org> wrote:
> > So to compile and reinstall mypackage i do:
> > bitbake -v mypackage -c clean -f  && bitbake -v mypackage -c install -f &&
> > bitbake -v mymachine-image
> > 
> > 
> > The mymachine-image  deletes and recreates the rootfs, which is lengthly.
> > After i do this, I need to reboot my  target board, so the nfsroot gets
> > remounted.
> > 
> > Is there any way to quickly get  mypackage  installed on the rootfs?   
> > I'd like to be able to quickly recompile/link mypackage after changing a
> > few lines of code.
> > 
> > I could write a script to copy the binaries over but I'm wondering if
> > there is an easier way.
> 
> AFAIK there is no quick way of updating a rootfs image with a new
> version of a package. If there is then please tell us because I would
> like to know too ;)

Well, assuming you're prepared to enable package management in the target
image (can just be temporary during development), you can share your
packages as a feed over http and install/update from there from the target. 
There's a section of the manual that covers this (for rpm, but can be
adapted for ipk):

http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#setting-up-runtime-package-management

> If your are only after package development and testing it on target I
> would use the SDK. That is why it exists. The poky tree is so much
> more than a simple cross-compilation toolchain. It is a complete
> integration/build and package management environment, not a
> development tool for individual packages. In our case we build our
> packages stand-alone using the SDK toolchain and then upload them to
> the board using scp or a special dedicated NFS mount for testing. It
> is a very quick way to try out those few lines of code you changed.
> 
> To build the SDK, you do bitbake -c populate_sdk <your image>
> The result will be a huge .sh script that you run to install the
> toolchain somewhere on your host/build machine.
> After install you source an environment setup script in the root of
> the install path and that is it. Now you can configure/compile your
> package from anywhere. The SDK will provide exactly the same header
> files and libraries as used when building your rootfs so output from
> the build is 100% binary compatible. Just throw it onto the board and
> run :)

This is definitely an option. Personally I prefer something closer to the build
system like the package method I mentioned above; however it depends on what
you're doing. The SDK is great for people developing applications that just
want to be able to build their apps so they can run on the target and don't
want or need to deal with the complexities of building the entire OS, but on
the other hand it doesn't automate building the application like the build
system can (on the assumption that you have your own means to do that, e.g. an
IDE that you're integrating the SDK with).

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list