From fb4e10c846fe01bce525f0ceef777fd6502b4452 Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Fri, 1 Nov 2019 11:02:30 +0100 Subject: OTA-3988: Non-systemd/poky-sota local.conf Signed-off-by: Mykhaylo Sul Signed-off-by: Patrick Vacek --- conf/local.nonsystemd.conf.sample.append | 19 +++++++++++++++++++ scripts/envsetup.sh | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 conf/local.nonsystemd.conf.sample.append diff --git a/conf/local.nonsystemd.conf.sample.append b/conf/local.nonsystemd.conf.sample.append new file mode 100644 index 0000000..6aeb61c --- /dev/null +++ b/conf/local.nonsystemd.conf.sample.append @@ -0,0 +1,19 @@ + +# +# meta-updater configuration, see README.adoc and aktualizr's +# documentation for more options and detailed documentation +# + +MACHINE = "##MACHINE##" +DISTRO = "poky-sota" + +# General SOTA setup +#SOTA_CLIENT_PROV = "aktualizr-shared-prov" +#SOTA_PACKED_CREDENTIALS = "/path/to/credentials.zip" + +# Uncomment this line to start an ssh server at boot automatically +#IMAGE_FEATURES += "ssh-server-dropbear" + +# Uncomment this line to set the log level of aktualizr to 'debug' (from 'info' +# by default) +#IMAGE_INSTALL_append += " aktualizr-log-debug" 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 @@ SCRIPT="envsetup.sh" MACHINE="$1" BUILDDIR="build" +DISTRO="poky-sota-systemd" +declare -A supported_distros=( ["poky-sota-systemd"]="local.conf.sample.append" ["poky-sota"]="local.nonsystemd.conf.sample.append" ) -[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} [builddir]"; return 1; } +[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} [builddir] [distro=< poky-sota-systemd | poky-sota >]"; return 1; } [[ "$#" -eq 2 ]] && { BUILDDIR="$2"; } +[[ "$#" -eq 3 ]] && { DISTRO="$3"; } # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 SOURCED=0 @@ -22,6 +25,8 @@ if [[ $SOURCED -ne 1 ]]; then fi METADIR=${METADIR:-${SOURCEDIR}/../..} +DISTRO_CONF=${supported_distros[$DISTRO]} +[[ -n $DISTRO_CONF ]] && { echo "Using $DISTRO_CONF for the specified distro $DISTRO"; } || { echo "The specified distro $DISTRO is not supported"; return 1; } if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" @@ -30,7 +35,7 @@ if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf - sed "s/##MACHINE##/$MACHINE/g" "${METADIR}/meta-updater/conf/local.conf.sample.append" >> conf/local.conf + sed "s/##MACHINE##/$MACHINE/g" "${METADIR}/meta-updater/conf/$DISTRO_CONF" >> conf/local.conf else source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" fi -- cgit v1.2.3-54-g00ecf