From 96588eb8370bfcffcde486a5010520bafa69abfe 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 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 conf/local.nonsystemd.conf.sample.append (limited to 'conf') 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" -- cgit v1.2.3-54-g00ecf From d9cd0e37d52ac4cbe17173af134424722232a0ae Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Tue, 5 Nov 2019 09:17:53 +0100 Subject: OTA-3988: force an ostree boot indication only in case of non-systemd distro Signed-off-by: Mykhaylo Sul Signed-off-by: Patrick Vacek --- classes/sota.bbclass | 2 +- conf/distro/poky-sota.conf | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'conf') diff --git a/classes/sota.bbclass b/classes/sota.bbclass index ecf08ae..5b06397 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -21,7 +21,7 @@ python () { d.setVar("SOTA_CLIENT_PROV", "aktualizr-device-prov-hsm") } -IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV} ostree-booted" +IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" IMAGE_CLASSES += " image_types_ostree image_types_ota" IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" diff --git a/conf/distro/poky-sota.conf b/conf/distro/poky-sota.conf index 3fb1d20..bfac90f 100644 --- a/conf/distro/poky-sota.conf +++ b/conf/distro/poky-sota.conf @@ -5,3 +5,5 @@ DISTRO = "poky-sota" DISTRO_NAME = "OTA-enabled Linux" DISTRO_VERSION = "1.0" DISTRO_CODENAME = "sota" + +IMAGE_INSTALL_append_sota = " ostree-booted" -- cgit v1.2.3-54-g00ecf From e6f90ebd1f0035e2b4d21488785b79dc6cd396d1 Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Tue, 5 Nov 2019 17:35:43 +0100 Subject: OTA-3988: make the DISTRO value in poky-sota-systemd.conf aligned to the systemd case Signed-off-by: Mykhaylo Sul Signed-off-by: Patrick Vacek --- conf/distro/poky-sota-systemd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conf') diff --git a/conf/distro/poky-sota-systemd.conf b/conf/distro/poky-sota-systemd.conf index b30b322..0dc50b0 100644 --- a/conf/distro/poky-sota-systemd.conf +++ b/conf/distro/poky-sota-systemd.conf @@ -2,7 +2,7 @@ require conf/distro/poky.conf require conf/distro/sota.conf.inc -DISTRO = "poky-sota" +DISTRO = "poky-sota-systemd" DISTRO_NAME = "OTA-enabled Linux" DISTRO_VERSION = "1.0" DISTRO_CODENAME = "sota" -- cgit v1.2.3-54-g00ecf From 750fe804a72a1cf97d4d92d9df47391ec1a07b04 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 Signed-off-by: Patrick Vacek --- 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 (limited to 'conf') 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