[yocto] package development recompile and install to rootfs

Hans Beckérus hans.beckerus at gmail.com
Thu Sep 12 03:28:16 PDT 2013


On Thu, Sep 12, 2013 at 11:57 AM, Karl Hiramoto <karl at hiramoto.org> wrote:
> Hi,
>
> I'm looking for a faster way  to recompile and install my package to my
> rootfs.   I am currently developing on a ARM board, and I'm booting the
> kernel and loading the rootfs over NFS.  I point the nfs root to
> /home/karl/Work/yocto/poky-dylan-9.0.1/build/tmp/work/mymachine-poky-linux-gnueabi/mymachine-image/1.0-r0/rootfs
>
> in my custom "mypackage.bb" recipe I have:
>
> DESCRIPTION = "mypackage"
> SECTION = "base"
> LICENSE = "CLOSED"
> DEPENDS = "libnl jansson file"
> SRCREV = "HEAD"
> PR = "r0"
> inherit autotools pkgconfig externalsrc
> S = "/home/karl/Work/mypackage"
>
> 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 ;)
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 :)

Hope it helps!
Hans



>
> Thanks,
>
> Karl
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list