From c74c4eb5399ed7a195e00172774a283582da6e44 Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Wed, 6 Nov 2019 09:44:03 +0100 Subject: OTA-3988: Split the local.conf to a base and a distro specific part Signed-off-by: Mykhaylo Sul --- conf/local.conf.base.append | 18 ++++++++++++++++ conf/local.conf.sample.append | 35 -------------------------------- conf/local.conf.systemd.append | 15 ++++++++++++++ conf/local.nonsystemd.conf.sample.append | 19 ----------------- scripts/envsetup.sh | 13 +++++++++--- 5 files changed, 43 insertions(+), 57 deletions(-) create mode 100644 conf/local.conf.base.append delete mode 100644 conf/local.conf.sample.append create mode 100644 conf/local.conf.systemd.append delete mode 100644 conf/local.nonsystemd.conf.sample.append diff --git a/conf/local.conf.base.append b/conf/local.conf.base.append new file mode 100644 index 0000000..36b2f59 --- /dev/null +++ b/conf/local.conf.base.append @@ -0,0 +1,18 @@ +# +# meta-updater configuration, see README.adoc and aktualizr's +# documentation for more options and detailed documentation +# + +MACHINE = "##MACHINE##" +DISTRO = "##DISTRO##" + +# 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/conf/local.conf.sample.append b/conf/local.conf.sample.append deleted file mode 100644 index fc565f8..0000000 --- a/conf/local.conf.sample.append +++ /dev/null @@ -1,35 +0,0 @@ - -# -# meta-updater configuration, see README.adoc and aktualizr's -# documentation for more options and detailed documentation -# - -MACHINE = "##MACHINE##" -DISTRO = "poky-sota-systemd" - -# 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" - -# Store systemd logs in persistent storage -# -# It greatly helps diagnosing issues on testing devices but should be -# carefully weighted against file system usage and flash device wear for -# production systems. Please refer to systemd's docs for more details -IMAGE_INSTALL_append += " systemd-journald-persistent" - -# Set resource limits for aktualizr service -# -# Uncomment these lines to change the default parameters. -# -#RESOURCE_CPU_WEIGHT_pn-aktualizr = "100" -#RESOURCE_MEMORY_HIGH_pn-aktualizr = "100M" -#RESOURCE_MEMORY_MAX_pn-aktualizr = "80%" -IMAGE_INSTALL_append += " aktualizr-resource-control" diff --git a/conf/local.conf.systemd.append b/conf/local.conf.systemd.append new file mode 100644 index 0000000..12e0182 --- /dev/null +++ b/conf/local.conf.systemd.append @@ -0,0 +1,15 @@ +# Store systemd logs in persistent storage +# +# It greatly helps diagnosing issues on testing devices but should be +# carefully weighted against file system usage and flash device wear for +# production systems. Please refer to systemd's docs for more details +IMAGE_INSTALL_append += " systemd-journald-persistent" + +# Set resource limits for aktualizr service +# +# Uncomment these lines to change the default parameters. +# +#RESOURCE_CPU_WEIGHT_pn-aktualizr = "100" +#RESOURCE_MEMORY_HIGH_pn-aktualizr = "100M" +#RESOURCE_MEMORY_MAX_pn-aktualizr = "80%" +IMAGE_INSTALL_append += " aktualizr-resource-control" diff --git a/conf/local.nonsystemd.conf.sample.append b/conf/local.nonsystemd.conf.sample.append deleted file mode 100644 index 6aeb61c..0000000 --- a/conf/local.nonsystemd.conf.sample.append +++ /dev/null @@ -1,19 +0,0 @@ - -# -# 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 4754e1d..19a5c94 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -4,10 +4,11 @@ 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" ) +BASE_CONF="local.conf.base.append" +declare -A supported_distros=( ["poky-sota-systemd"]="local.conf.systemd.append" ["poky-sota"]="local.conf.base.append" ) [[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} [builddir] [distro=< poky-sota-systemd | poky-sota >]"; return 1; } -[[ "$#" -eq 2 ]] && { BUILDDIR="$2"; } +[[ "$#" -ge 2 ]] && { BUILDDIR="$2"; } [[ "$#" -eq 3 ]] && { DISTRO="$3"; } # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 @@ -35,7 +36,13 @@ 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/$DISTRO_CONF" >> conf/local.conf + sed -e "s/##MACHINE##/$MACHINE/g" \ + -e "s/##DISTRO##/$DISTRO/g" \ + "${METADIR}/meta-updater/conf/$BASE_CONF" >> conf/local.conf + + if [ "$BASE_CONF" != "$DISTRO_CONF" ]; then + cat "${METADIR}/meta-updater/conf/$DISTRO_CONF" >> conf/local.conf + fi else source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" fi -- cgit v1.2.3-54-g00ecf