What is correct way to keep track of bitbake configuration and used layers in git?
1 Answers
Here's what I find works best:
- Make new, empty git repository e.g.
my-yoctoon a drive with at least 50 GB of free space. - Add poky as a git submodule of
my-yocto.
git submodule add git://git.yoctoproject.org/poky.git
- From
my-yoctoroot, run:
source poky/oe-init-build-env .
Note the "." in that command; initializing the build environment in my-yocto instead of poky prevents Yocto's GB of temp files from accumulating under poky.
- The script will create a directory
confinmy-yoctowith some files in it; git-addconf/local.confandconf/bblayers.confto your repo. - By default, yocto sets up
bblayers.confusing absolute paths, which means a repo set up by Alice won't work on Bob's machine. Fix that by modifyingbblayers.confusing the Yocto${TOPDIR}variable:
(...)
BBLAYERS ?= " \
${TOPDIR}/poky/meta \
${TOPDIR}/poky/meta-poky \
${TOPDIR}/poky/meta-yocto-bsp \
(...)
Edit
local.confto a supported platform in e.gMACHINE=beaglebone-yoctoFrom
my-yocto, runbitbake core-image-minimal. Make sure your computer is well-ventilated and go for a hike.
If that works, you can build out the rest of your configuration by adding meta-openembedded etc. as submodules. I recommend any custom layers be distinct git repos from my-yocto, so that my-yocto only contains the git submodule details and the bitbake configuration.
To update before building, run:
git pull
git submodule update --remote --recursive
Other users will need to run git submodule init one time after cloning my-yocto.
Two other recommendations:
First, if you build for more than one machine, create a local.conf for each machine and create a symbolic link from local.conf to the machine-specific conf file. This allows you to track multiple machines in my-yocto.
Second, create a temp directory for each yocto branch (e.g. tmp-zeus, tmp-dunfell, tmp-gatesgarth) and then make a symbolic link from tmp to whichever branch you are building. (Don't add these to git.) Yocto accumulates an enormous amount of data in the tmp directory, and it requires you to clean out tmp when you switch branches. That's fine if you move to a newer release, but if you switch back and forth between branches it's a bummer to lose all of that cached data.
- 386
- 1
- 4