summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMykhaylo Sul <ext-mykhaylo.sul@here.com>2019-11-01 11:02:30 +0100
committerMykhaylo Sul <ext-mykhaylo.sul@here.com>2019-11-01 11:02:30 +0100
commit6680bfb70ce2285ef5243e489073fb26bc63f0e7 (patch)
tree683aac263122d9dee96f22c5b3cffb09c4ff113e /scripts
parent22165a78b34583c1389c0c9c5841c5377bad6e10 (diff)
downloadmeta-updater-6680bfb70ce2285ef5243e489073fb26bc63f0e7.tar.gz
OTA-3988: Non-systemd/poky-sota local.conf
Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/envsetup.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh
index 5827bc2..4754e1d 100755
--- a/scripts/envsetup.sh
+++ b/scripts/envsetup.sh
@@ -3,9 +3,12 @@
3SCRIPT="envsetup.sh" 3SCRIPT="envsetup.sh"
4MACHINE="$1" 4MACHINE="$1"
5BUILDDIR="build" 5BUILDDIR="build"
6DISTRO="poky-sota-systemd"
7declare -A supported_distros=( ["poky-sota-systemd"]="local.conf.sample.append" ["poky-sota"]="local.nonsystemd.conf.sample.append" )
6 8
7[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} <machine> [builddir]"; return 1; } 9[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} <machine> [builddir] [distro=< poky-sota-systemd | poky-sota >]"; return 1; }
8[[ "$#" -eq 2 ]] && { BUILDDIR="$2"; } 10[[ "$#" -eq 2 ]] && { BUILDDIR="$2"; }
11[[ "$#" -eq 3 ]] && { DISTRO="$3"; }
9 12
10# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 13# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594
11SOURCED=0 14SOURCED=0
@@ -22,6 +25,8 @@ if [[ $SOURCED -ne 1 ]]; then
22fi 25fi
23 26
24METADIR=${METADIR:-${SOURCEDIR}/../..} 27METADIR=${METADIR:-${SOURCEDIR}/../..}
28DISTRO_CONF=${supported_distros[$DISTRO]}
29[[ -n $DISTRO_CONF ]] && { echo "Using $DISTRO_CONF for the specified distro $DISTRO"; } || { echo "The specified distro $DISTRO is not supported"; return 1; }
25 30
26if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then 31if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then
27 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" 32 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR"
@@ -30,7 +35,7 @@ if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then
30 cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf 35 cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf
31 cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf 36 cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf
32 37
33 sed "s/##MACHINE##/$MACHINE/g" "${METADIR}/meta-updater/conf/local.conf.sample.append" >> conf/local.conf 38 sed "s/##MACHINE##/$MACHINE/g" "${METADIR}/meta-updater/conf/$DISTRO_CONF" >> conf/local.conf
34else 39else
35 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" 40 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR"
36fi 41fi