Reputation: 175
let say i have a new yocto image call stargazer-cmd what file should i edit so that every time i source poky/oe-init-env it display as a build option to the user?
kj@kj-Aspire-V3-471G:~/stm32Yoctominimal$ source poky/oe-init-build-env build-mp1/
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support
I wish to add stargazer-cmd on top of core-image-minimal, i am not sure what to google and what is the file i need to change.
Upvotes: 1
Views: 2358
Reputation: 4314
Let me explain how to add a custom configuration to the OpenEmbedded build process.
First of all, here is the process that is done when running:
source poky/oe-init-build-env
The oe-init-build-env
script initializes OEROOT
variable to point to the location of the script itself.
The oe-init-build-env
script sources another file $OEROOT/scripts/oe-buildenv-internal
which will:
OEROOT
is setBUILDDIR
to your custom build directory name $1
, or just build
if you do not provide oneBBPATH
to the poky/bitbake
folder$BBPATH/bin
and OEROOT/scripts
to PATH
(This will enable commands like bitbake
and bitbake-layers
...)BUILDDIR
and PATH
to the next fileoe-init-build-env
script continues by running the final build script with:TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir
oe-setup-builddir
script will:BUILDDIR
is setconf
directory under $BUILDDIR
TEMPLATECONF
variable is set:. $OEROOT/.templateconf
That file contains:
# Template settings
TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}
it means that if TEMPLATECONF
variable is not set, set it to meta-poky/conf
, and that is where the default local.conf
and bblayers.conf
are coming from.
$TEMPLATECONF
to $BUILDDIR/conf/templateconf.cfg
local.conf
and bblayers.conf
:OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
OECORENOTESCONF="$TEMPLATECONF/conf-notes.txt"
In the oe-setup-builddir
there is a comment saying that TEMPLATECONF
can point to a directory:
#
# $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
#
local.conf.sample
and bblayers.conf.sample
from TEMPLATECONF
directory into BUIDDIR/conf
:cp -f $OECORELOCALCONF "$BUILDDIR/conf/local.conf"
sed -e "s|##OEROOT##|$OEROOT|g" \
-e "s|##COREBASE##|$OEROOT|g" \
$OECORELAYERCONF > "$BUILDDIR/conf/bblayers.conf"
Finally it will print what is inside OECORENOTESCONF
which points to TEMPLATECONF/conf-notes.txt
:
[ ! -r "$OECORENOTESCONF" ] || cat $OECORENOTESCONF
and by default that is located under meta-poky/conf/conf-notes.txt
:
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
Other commonly useful commands are:
- 'devtool' and 'recipetool' handle common recipe tasks
- 'bitbake-layers' handles common layer tasks
- 'oe-pkgdata-util' handles common target package tasks
So, now, after understanding all of that, here is what you can do:
Do not forget to set the path to poky
in bblayers.conf
to ##OEROOT##
as it will be set automatically by the build script.
Set your custom message in conf-notes.txt
Before any new build, just set TEMPLATECONF
:
TEMPLATECONF="<path/to/template-directory>" source poky/oe-init-build-env <build_name>
Then, you will find a build with your custom local.conf
and bblayers.conf
with additional file conf/templateconf.cfg
containing the path of TEMPLATECONF
Upvotes: 3
Reputation: 6327
conf/conf-notes.txt
in your layer.
OECORENOTESCONF
should point to the file.
Upvotes: 2