diff options
author | Mykhaylo Sul <ext-mykhaylo.sul@here.com> | 2019-11-06 09:44:03 +0100 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2019-11-20 10:42:32 +0100 |
commit | 750fe804a72a1cf97d4d92d9df47391ec1a07b04 (patch) | |
tree | d80a0e584536ed234d801153c55b9939ad40e4c9 /scripts/envsetup.sh | |
parent | e6f90ebd1f0035e2b4d21488785b79dc6cd396d1 (diff) | |
download | meta-updater-750fe804a72a1cf97d4d92d9df47391ec1a07b04.tar.gz |
OTA-3988: Split the local.conf to a base and a distro specific part
Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com>
Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Diffstat (limited to 'scripts/envsetup.sh')
-rwxr-xr-x | scripts/envsetup.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 4754e1d..19a5c94 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh | |||
@@ -4,10 +4,11 @@ SCRIPT="envsetup.sh" | |||
4 | MACHINE="$1" | 4 | MACHINE="$1" |
5 | BUILDDIR="build" | 5 | BUILDDIR="build" |
6 | DISTRO="poky-sota-systemd" | 6 | DISTRO="poky-sota-systemd" |
7 | declare -A supported_distros=( ["poky-sota-systemd"]="local.conf.sample.append" ["poky-sota"]="local.nonsystemd.conf.sample.append" ) | 7 | BASE_CONF="local.conf.base.append" |
8 | declare -A supported_distros=( ["poky-sota-systemd"]="local.conf.systemd.append" ["poky-sota"]="local.conf.base.append" ) | ||
8 | 9 | ||
9 | [[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} <machine> [builddir] [distro=< poky-sota-systemd | poky-sota >]"; return 1; } | 10 | [[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} <machine> [builddir] [distro=< poky-sota-systemd | poky-sota >]"; return 1; } |
10 | [[ "$#" -eq 2 ]] && { BUILDDIR="$2"; } | 11 | [[ "$#" -ge 2 ]] && { BUILDDIR="$2"; } |
11 | [[ "$#" -eq 3 ]] && { DISTRO="$3"; } | 12 | [[ "$#" -eq 3 ]] && { DISTRO="$3"; } |
12 | 13 | ||
13 | # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 | 14 | # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 |
@@ -35,7 +36,13 @@ if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then | |||
35 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf | 36 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf |
36 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf | 37 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf |
37 | 38 | ||
38 | sed "s/##MACHINE##/$MACHINE/g" "${METADIR}/meta-updater/conf/$DISTRO_CONF" >> conf/local.conf | 39 | sed -e "s/##MACHINE##/$MACHINE/g" \ |
40 | -e "s/##DISTRO##/$DISTRO/g" \ | ||
41 | "${METADIR}/meta-updater/conf/$BASE_CONF" >> conf/local.conf | ||
42 | |||
43 | if [ "$BASE_CONF" != "$DISTRO_CONF" ]; then | ||
44 | cat "${METADIR}/meta-updater/conf/$DISTRO_CONF" >> conf/local.conf | ||
45 | fi | ||
39 | else | 46 | else |
40 | source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" | 47 | source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" |
41 | fi | 48 | fi |