Skip to contentSkip to conversation

package development recompile and install to rootfs

DISCUSSION Karl Hiramoto 3 participants 3 messages Sep 12, 2013

lore
Share & tools
lore
#0 lore raw

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.

Thanks,

Karl

#1 lore raw
Quoted 27 lines · Karl Hiramoto

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.

Quoted 8 lines

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

Quoted 8 lines

Thanks,

Karl
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#2 lore raw

Hi Karl / Hans,

Quoted 14 lines · On Thursday 12 September 2013 12:28:16 Hans Beckérus wrote:
Quoted 13 lines · Karl Hiramoto

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.

Quoted 6 lines
Quoted 2 lines

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

Quoted 9 lines

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.

Quoted 9 lines

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

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre