Skip to content
Snippets Groups Projects
Commit 96799c56 authored by Mikhail Vanyulin's avatar Mikhail Vanyulin Committed by Jonas Höppner
Browse files

setup-environment: automate adding of available multiconfigs to local.conf


If MULTICONFIG=true parameter is passed to setup-environment script, it
will enable multiconfig in local.conf if multiconfigs configurations were
found in layers.

Signed-off-by: default avatarMikhail Vanyulin <mikhail.vanyulin@rtsoft.de>
parent fe6da031
No related branches found
No related tags found
1 merge request!235setup-environment: automate adding of available multiconfigs to local.conf
Pipeline #129764 passed with stage
in 15 seconds
......@@ -45,6 +45,13 @@ DEFAULT_DISTRO="$(echo "$GF_DISTROS" | head -n 1)"
GF_IMAGES="$(find sources/meta-seconorth-distro/recipes-bsp/images/ -iname "*.bb" \
-exec basename -s ".bb" {} \;)"
SUPPORTED_MULTICONFIGS="$(find sources/*/conf/multiconfig -name "*.conf" \
-exec basename -s ".conf" {} \; 2>/dev/null || true )"
SUPPORTED_MULTICONFIGS_SINGLE_LINE=${SUPPORTED_MULTICONFIGS//$'\n'/ }
if [ -z "$SUPPORTED_MULTICONFIGS_SINGLE_LINE" ]; then
MULTICONFIG="false"
fi
DL_DIR_GLOBAL="/usr/src/packages/"
SSTATE_DIR="/var/cache/yocto/sstate_cache"
SSTATE_MIRROR="/var/cache/yocto/sstate_cache"
......@@ -58,12 +65,13 @@ message()
usage()
{
echo "
Usage: MACHINE=<machine> DISTRO=<distro> {BBLAYERS=<bblayers>} source $PROGNAME <build-dir>
Usage: source $PROGNAME <build-dir>
Usage: MACHINE=<machine> DISTRO=<distro> {BBLAYERS=<bblayers>} {MULTICONFIG=true} source $PROGNAME <build-dir>
Usage: source $PROGNAME <build-dir>
<machine> machine name
<distro> distro name
<bblayers> file with layer list (optional)
<build-dir> build directory
MULTICONFIG set to true, to enable multiconfig configuration
The first usage is for creating a new build directory. In this case, the
script creates the build directory <build-dir>, configures it for the
......@@ -83,6 +91,9 @@ directory <build-dir>. The build directory configuration is unchanged.
echo
echo "Available Poky distros:"
echo "$POKY_DISTROS" | xargs -I% echo -e "\t%"
echo
echo "Available multiconfigs:"
echo "$SUPPORTED_MULTICONFIGS" | xargs -I% echo -e "\t%"
echo "
Examples:
......@@ -90,6 +101,9 @@ Examples:
- To create a new Yocto build directory:
$ MACHINE=$DEFAULT_MACHINE DISTRO=$DEFAULT_DISTRO source $PROGNAME build
- To create a new Yocto build directory with multiconfig configuration:
$ MACHINE=$DEFAULT_MACHINE DISTRO=$DEFAULT_DISTRO MULTICONFIG=true source $PROGNAME build
- To use an existing Yocto build directory:
$ source $PROGNAME build
"
......@@ -100,7 +114,7 @@ clean_up()
unset EULA
unset CWD TEMPLATES SHORTOPTS LONGOPTS ARGS PROGNAME
unset generated_config updated
unset MACHINE SDKMACHINE DISTRO OEROOT
unset MACHINE SDKMACHINE DISTRO OEROOT MULTICONFIG
unset BBLAYERS
}
......@@ -241,7 +255,8 @@ if "$build_dir_setup_enabled"; then
echo "Bitbake will fall back to the poky default bblayers.conf"
fi
if [ -z "${DISTRO/*fngsystem*}" ] || [ -z "${DISTRO/*no-gplv3*}" ]; then
if [ -z "${DISTRO/*fngsystem*}" ] || [ -z "${DISTRO/*no-gplv3*}" ] \
|| [ "$MULTICONFIG" = "true" ]; then
# Some custom projects already include the NoGPLv3 or GPLv2 layer.
# If these layers are already present, the Bitbake parsing fails.
# As a precaution, check if the layers are already present and
......@@ -323,6 +338,11 @@ if "$build_dir_setup_enabled"; then
echo " http://.*/.* https://support.garz-fricke.com/mirror/ \\ "
echo " https://.*/.* https://support.garz-fricke.com/mirror/ \\ "
echo "\""
if [ "$MULTICONFIG" = "true" ]; then
echo
echo "BBMULTICONFIG = \"$SUPPORTED_MULTICONFIGS_SINGLE_LINE\""
fi
} > conf/local.conf
# Change settings according environment
......@@ -331,7 +351,7 @@ if "$build_dir_setup_enabled"; then
-e "s,DISTRO ?=.*,DISTRO ?= '$DISTRO',g" \
-e "s,PACKAGE_CLASSES ?=.*,PACKAGE_CLASSES ?= '$PACKAGE_CLASSES',g" \
-i conf/local.conf
# MediTek Genio 700 specific settings
if [ "$MACHINE" = "seco-genio700" ]; then
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment