summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMykhaylo Sul <ext-mykhaylo.sul@here.com>2019-11-01 11:02:30 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2019-11-20 10:42:54 +0100
commitfb4e10c846fe01bce525f0ceef777fd6502b4452 (patch)
treeb443a21571a4c52a2a1112a058b9d34ffbcf5b55 /scripts
parent0b087a34b708bfd808a013b3656f543d2709692e (diff)
downloadmeta-updater-fb4e10c846fe01bce525f0ceef777fd6502b4452.tar.gz
OTA-3988: Non-systemd/poky-sota local.conf
Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com> Signed-off-by: Patrick Vacek <patrickvacek@gmail.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