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 +++++++++++++++++++ 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 From 8b6ed98e2cb33a2f678e61ffd40c638052ba98b9 Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Fri, 1 Nov 2019 11:44:44 +0100 Subject: OTA-3988: Don't build the networkd-dhcp recipe if systemd is not included into the disto feature list Signed-off-by: Mykhaylo Sul Signed-off-by: Patrick Vacek --- recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb index 394531e..40a3958 100644 --- a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb @@ -15,7 +15,7 @@ SRC_URI = " \ " PR = "r1" -RDEPENDS_${PN} = "systemd" +REQUIRED_DISTRO_FEATURES_${PN} = "systemd" RCONFLICTS_${PN} = "connman" S = "${WORKDIR}" -- cgit v1.2.3-54-g00ecf From 0a6fccd03ef8d93cce9b5d96d87a87fb9350d94e Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Wed, 23 Oct 2019 17:34:19 +0200 Subject: Indicate an OSTree boot on start Signed-off-by: Mykhaylo Sul Signed-off-by: Patrick Vacek --- classes/sota.bbclass | 2 +- recipes-sota/ostree/files/touch-ostree | 21 +++++++++++++++++++++ recipes-sota/ostree/ostree-booted_1.0.bb | 15 +++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 recipes-sota/ostree/files/touch-ostree create mode 100644 recipes-sota/ostree/ostree-booted_1.0.bb diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 5b06397..ecf08ae 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}" +IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV} ostree-booted" 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/recipes-sota/ostree/files/touch-ostree b/recipes-sota/ostree/files/touch-ostree new file mode 100755 index 0000000..28cb672 --- /dev/null +++ b/recipes-sota/ostree/files/touch-ostree @@ -0,0 +1,21 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: touch-ostree +# Required-Start: $network $remote_fs +# Required-Stop: $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Indicate OSTree boot +### END INIT INFO + +case "$1" in + start) + touch /run/ostree-booted + ;; + stop) + ;; + *) + echo "Usage: /etc/init.d/touch-ostree {start|stop}" + exit 1 + ;; +esac diff --git a/recipes-sota/ostree/ostree-booted_1.0.bb b/recipes-sota/ostree/ostree-booted_1.0.bb new file mode 100644 index 0000000..d74cf24 --- /dev/null +++ b/recipes-sota/ostree/ostree-booted_1.0.bb @@ -0,0 +1,15 @@ +SUMMARY = "Indicate an OSTree boot" +DESCRIPTION = "Indicate an OSTree boot" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" +SRC_URI = "file://touch-ostree" + +inherit allarch update-rc.d + +INITSCRIPT_NAME = "touch-ostree" +INITSCRIPT_PARAMS = "start 8 2 3 4 5 . stop 20 0 1 6 ." + +do_install() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/touch-ostree ${D}${sysconfdir}/init.d/touch-ostree +} -- 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(-) 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 c020b3fde33bc532a5f90c7325fcb889f790ddec Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Tue, 5 Nov 2019 10:05:27 +0100 Subject: OTA-3988: oe-selftest for the non-systemd case Signed-off-by: Mykhaylo Sul Signed-off-by: Patrick Vacek --- lib/oeqa/selftest/cases/updater_qemux86_64.py | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py index 4506300..5f152ad 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py @@ -465,4 +465,40 @@ class ResourceControlTests(OESelftestTestCase): stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show --property=ExecMainStatus aktualizr') self.assertIn(b'ExecMainStatus=0', stdout, 'Aktualizr did not restart') + +class NonSystemdTests(OESelftestTestCase): + def setUpLocal(self): + layer = "meta-updater-qemux86-64" + result = runCmd('bitbake-layers show-layers') + if re.search(layer, result.output) is None: + self.meta_qemu = metadir() + layer + runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu) + else: + self.meta_qemu = None + self.append_config('MACHINE = "qemux86-64"') + self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "') + self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"') + self.append_config('DISTRO = "poky-sota"') + self.append_config('IMAGE_INSTALL_remove += " aktualizr-resource-control"') + self.qemu, self.s = qemu_launch(machine='qemux86-64') + + def tearDownLocal(self): + qemu_terminate(self.s) + if self.meta_qemu: + runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True) + + def qemu_command(self, command): + return qemu_send_command(self.qemu.ssh_port, command) + + def test_provisioning(self): + print('Checking if systemd is not installed...') + stdout, stderr, retcode = self.qemu_command('systemctl') + self.assertTrue(retcode != 0, 'systemd is installed while it is not supposed to: ' + str(stdout)) + + stdout, stderr, retcode = self.qemu_command('aktualizr --run-mode once') + self.assertEqual(retcode, 0, 'Failed to run aktualizr: ' + str(stdout) + str(stderr)) + + machine = get_bb_var('MACHINE', 'core-image-minimal') + verifyProvisioned(self, machine) + # vim:set ts=4 sw=4 sts=4 expandtab: -- cgit v1.2.3-54-g00ecf From c507fe8f5d309456eb98ba1558f1a2b8fbb891e4 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 5 Nov 2019 16:15:07 +0100 Subject: Remove a now unnecessary hack in rpi oe-selftests See https://github.com/advancedtelematic/meta-updater-qemux86-64/pull/37 Signed-off-by: Laurent Bonnans Signed-off-by: Patrick Vacek --- lib/oeqa/selftest/cases/updater_raspberrypi.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/oeqa/selftest/cases/updater_raspberrypi.py b/lib/oeqa/selftest/cases/updater_raspberrypi.py index 8efc941..fae631e 100644 --- a/lib/oeqa/selftest/cases/updater_raspberrypi.py +++ b/lib/oeqa/selftest/cases/updater_raspberrypi.py @@ -29,26 +29,10 @@ class RpiTests(OESelftestTestCase): else: self.meta_upd_rpi = None - # This is trickier that I would've thought. The fundamental problem is - # that the qemu layer changes the u-boot file extension to .rom, but - # raspberrypi still expects .bin. To prevent this, the qemu layer must - # be temporarily removed if it is present. It has to be removed by name - # without the complete path, but to add it back when we are done, we - # need the full path. - p = re.compile(r'meta-updater-qemux86-64\s*(\S*meta-updater-qemux86-64)\s') - m = p.search(result.output) - if m and m.lastindex > 0: - self.meta_qemu = m.group(1) - runCmd('bitbake-layers remove-layer meta-updater-qemux86-64') - else: - self.meta_qemu = None - self.append_config('MACHINE = "raspberrypi3"') self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "') def tearDownLocal(self): - if self.meta_qemu: - runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu, ignore_status=True) if self.meta_upd_rpi: runCmd('bitbake-layers remove-layer "%s"' % self.meta_upd_rpi, ignore_status=True) if self.meta_rpi: -- 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(-) 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 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 From 0a79da1dd5bd3672cecd983ec7630958445f5ab8 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Wed, 6 Nov 2019 19:50:08 +0100 Subject: meta: change OTA_IMAGE_ROOTFS to TAR_IMAGE_ROOTFS No functional changes, rename OTA_IMAGE_ROOTFS to TAR_IMAGE_ROOTFS since the later is a more common name. Signed-off-by: Ming Liu Signed-off-by: Patrick Vacek --- classes/image_types_ostree.bbclass | 4 ++-- classes/image_types_ota.bbclass | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 7ffe99d..0e047b1 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -13,11 +13,11 @@ BUILD_OSTREE_TARBALL ??= "1" SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'systemd', 'true', '')}" IMAGE_CMD_TAR = "tar --xattrs --xattrs-include=*" -CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}; ${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.tar -C ${OTA_IMAGE_ROOTFS} . || [ $? -eq 1 ]" +CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}; ${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.tar -C ${TAR_IMAGE_ROOTFS} . || [ $? -eq 1 ]" CONVERSIONTYPES_append = " tar" REQUIRED_DISTRO_FEATURES = "usrmerge" -OTA_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" +TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" do_image_ostree[dirs] = "${OSTREE_ROOTFS}" do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 31e3887..2cc8913 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -38,7 +38,7 @@ calculate_size () { } OTA_SYSROOT = "${WORKDIR}/ota-sysroot" -OTA_IMAGE_ROOTFS_task-image-ota = "${OTA_SYSROOT}" +TAR_IMAGE_ROOTFS_task-image-ota = "${OTA_SYSROOT}" IMAGE_TYPEDEP_ota = "ostreecommit" do_image_ota[dirs] = "${OTA_SYSROOT}" do_image_ota[cleandirs] = "${OTA_SYSROOT}" -- cgit v1.2.3-54-g00ecf From 838b59f39e72e623fdc0a10bcf9c3524be1f7330 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 8 Nov 2019 13:50:36 +0100 Subject: Send a copy of repo manifest through garage-push Signed-off-by: Laurent Bonnans Signed-off-by: Patrick Vacek --- classes/image_types_ostree.bbclass | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 0e047b1..f10e523 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -186,13 +186,19 @@ IMAGE_CMD_ostreecommit () { IMAGE_TYPEDEP_ostreepush = "ostreecommit" do_image_ostreepush[depends] += "aktualizr-native:do_populate_sysroot ca-certificates-native:do_populate_sysroot" IMAGE_CMD_ostreepush () { - # Print warnings if credetials are not set or if the file has not been found. + # send a copy of the repo manifest to backend if available + local SEND_MANIFEST="" + if [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then + SEND_MANIFEST="--repo-manifest ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml" + fi + if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then garage-push -vv --repo=${OSTREE_REPO} \ --ref=${OSTREE_BRANCHNAME} \ --credentials=${SOTA_PACKED_CREDENTIALS} \ - --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt + --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt \ + $SEND_MANIFEST else bbwarn "SOTA_PACKED_CREDENTIALS file does not exist." fi -- cgit v1.2.3-54-g00ecf From 2287fcc3e47d5cb01554b4a1ec20c0f233c49e97 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Mon, 11 Nov 2019 17:26:26 +0100 Subject: Only push repo manifest if garage-push supports it Signed-off-by: Laurent Bonnans Signed-off-by: Patrick Vacek --- classes/image_types_ostree.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index f10e523..0f0fd28 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -188,7 +188,8 @@ do_image_ostreepush[depends] += "aktualizr-native:do_populate_sysroot ca-certifi IMAGE_CMD_ostreepush () { # send a copy of the repo manifest to backend if available local SEND_MANIFEST="" - if [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then + # check if garage-push supports the --repo-manifest option before trying + if $(garage-push --help | grep -q '^\s*--repo-manifest') && [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then SEND_MANIFEST="--repo-manifest ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml" fi -- cgit v1.2.3-54-g00ecf From 127d27d1d2d91501feaf74b04a38bb3a6f8dca3d Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 12 Nov 2019 09:08:58 +0100 Subject: aktualizr: Remove systemd packaging. That dependency and build flag have been removed as they were unused. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr_git.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 22cba07..68a6ba9 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -55,7 +55,6 @@ PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF, PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree," PACKAGECONFIG[hsm] = "-DBUILD_P11=ON,-DBUILD_P11=OFF,libp11," PACKAGECONFIG[sota-tools] = "-DBUILD_SOTA_TOOLS=ON ${GARAGE_SIGN_OPS},-DBUILD_SOTA_TOOLS=OFF,glib-2.0," -PACKAGECONFIG[systemd] = "-DBUILD_SYSTEMD=ON,-DBUILD_SYSTEMD=OFF,systemd," PACKAGECONFIG[load-tests] = "-DBUILD_LOAD_TESTS=ON,-DBUILD_LOAD_TESTS=OFF," PACKAGECONFIG[serialcan] = ",,,slcand-start" PACKAGECONFIG[ubootenv] = ",,,u-boot-fw-utils aktualizr-uboot-env-rollback" -- cgit v1.2.3-54-g00ecf From bc833e1fcaa6ece5e907cbadfae8922e40955334 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Thu, 14 Nov 2019 13:46:33 +0100 Subject: Build core-image-minimal for rpi on CI Also publish images as artifact so that they can directly be downloaded for tests. Signed-off-by: Laurent Bonnans Signed-off-by: Patrick Vacek --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d08a7e6..0340e60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,17 @@ Build core-image-minimal: except: - pushes +Build core-image-minimal (rpi): + extends: .bitbake + + stage: test + variables: + TEST_BUILD_DIR: 'build-core-image-minimal-rpi' + BITBAKE_TARGETS: 'core-image-minimal' + TEST_MACHINE: 'raspberrypi3' + except: + - pushes + Oe-selftest qemux86_64: extends: .oe-selftest -- cgit v1.2.3-54-g00ecf From d0e40bd02a5eefc753e9a51b5904283fc7d626ce Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Thu, 14 Nov 2019 13:46:33 +0100 Subject: aktualizr: Upgrade to 2019.10 release and latest garage-sign. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr_git.bb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 68a6ba9..211db89 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -15,7 +15,7 @@ RDEPENDS_${PN}-ptest += "bash cmake curl net-tools python3-core python3-misc pyt PV = "1.0+git${SRCPV}" PR = "7" -GARAGE_SIGN_PV = "0.7.0-49-g5ffd420" +GARAGE_SIGN_PV = "0.7.0-59-gf6013d6" SRC_URI = " \ gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ @@ -27,10 +27,10 @@ SRC_URI = " \ ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \ " -SRC_URI[garagesign.md5sum] = "de0877ecb693fd48ec11052e51b0ff1a" -SRC_URI[garagesign.sha256sum] = "cf25759574c9c1206835daeaf6fc345f6db7b5ccdb95fb828c86d7451f78f0aa" +SRC_URI[garagesign.md5sum] = "3d38908f9b536a02cc73778b11bbc32e" +SRC_URI[garagesign.sha256sum] = "eceeb16a781e0e8d1f554defbcd5bbcea86d448ebd350fc6a2529372bf867dba" -SRCREV = "fa59e33208d3b1dc690a30ce8339b3b4162f8022" +SRCREV = "662aa23f0b9c97a2c93a428438dacae72333c751" BRANCH ?= "master" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf