howto make a bitbake recipe - victronenergy/venus GitHub Wiki

(Needs converting to markdown, or perhaps just deleting it all: this content used to be on Victron Live)

====== Bitbake: making and managing recipes for CCGX ======

To build all the CCGX rootfs or images with all the existing recipes, see instructions here: https://github.com/victronenergy/venus/blob/master/README.

Below guide is an introduction on how to add recipes and create/debug them.

Start bitbake: make bb

Build a single recipe: bitbake -b dbus-modbustcp_0.7.2.bb

That probably didn't work, because dependencies are missing. To build the recipe including dependencies, do: bitbake dbus-modbustcp

when changing the source code that is fetched by the recipe, make sure to do a cleanall before running the recipe again (note I changed from the dbus-modbustcp example to vrmportal: bitbake -c cleanall vrmportal

To see what happened, and where all the source files are, see here (replace vrmportal with the recipe you are working on): /media/venusbuilds/venus/build/tmp-eglibc/work/armv7a-vfp-neon-ve-linux-gnueabi/vrmportal-0.01-r0/

After successfully building a package, it is somewhere in the deploy folder. In above case it is here: matthijs@matthijs-VirtualBox:/media/venusbuilds/venus/deploy/ipk/armv7a-vfp-neon$ ls -al vrm* -rw-r--r-- 1 matthijs matthijs 18381088 sep 20 13:19 vrmportal_0.01-r0_armv7a-vfp-neon.ipk -rw-r--r-- 1 matthijs matthijs 818 sep 20 13:19 vrmportal-dbg_0.01-r0_armv7a-vfp-neon.ipk -rw-r--r-- 1 matthijs matthijs 828 sep 20 13:19 vrmportal-dev_0.01-r0_armv7a-vfp-neon.ipk

As you can see there is a dbg and dev as well, see internet for more explanation on those. Now, to test the package on a ccgx, copy the package to it: scp vrmportal_0.01-r0_armv7a-vfp-neon.ipk [email protected]:~/

and then login with ssh and install it: root@ccgx:~# opkg install vrmportal_0.01-r0_armv7a-vfp-neon.ipk

some more tips and trick I wish that I knew before hand:

  • use bitbake -k [packagename] when building packages with lots of dependencies. It will then continue instead of stopping on the first error.
  • after pressing ctrl-c once, wait to bitbake to finish the remaining tasks. Instead of being impatient and pressing it again immediately. It will mess up the cache causing errors on your next build.
  • there are several ways/levels of cleaning up:
    • bitbake -c clean [packagename]
    • bitbake -c cleansstate [packagename]
    • bitbake -c cleanall [packagename] (this one also deletes downloaded sources)
    • and to clean everything, exit bitbake and do a make clean in the root folder of venus

=== running local pkg repo === instead of testing with manually installing a package, which is nice to test a single install, the other way to test if all the R-numbers and dependencies are done in the right way is to host them yourself.

see here for instructions: http://www.jumpnowtek.com/yocto/Using-your-build-workstation-as-a-remote-package-repository.html

⚠️ **GitHub.com Fallback** ⚠️