From 96c79d9fa72f9775a7bf6943d445149e4a683c0f Mon Sep 17 00:00:00 2001 From: antznin Date: Fri, 29 May 2020 09:59:15 +0200 Subject: image_types_ostree: allow specifying a device tree to deploy When setting `OSTREE_DEPLOY_DEVICETREE` to 1, it will by default deploy all the device tree blobs present in `KERNEL_DEVICETREE`. Adding `OSTREE_DEVICETREE` would allow specifying a specific device tree blob (or several dtbs), thus resulting in only the specified ones in the image. This is particularely useful because ostree selects the first device tree it finds in /boot, and discards the remaining ones. Signed-off-by: antznin --- classes/image_types_ostree.bbclass | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index fd38d28..051dcf9 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -10,6 +10,7 @@ OSTREE_COMMIT_BODY ??= "" OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" OSTREE_UPDATE_SUMMARY ??= "0" OSTREE_DEPLOY_DEVICETREE ??= "0" +OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}" BUILD_OSTREE_TARBALL ??= "1" @@ -141,9 +142,9 @@ IMAGE_CMD_ostree () { checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") touch boot/initramfs-${checksum} else - if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${KERNEL_DEVICETREE}" ]; then - checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") - for DTS_FILE in ${KERNEL_DEVICETREE}; do + if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then + checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${OSTREE_DEVICETREE} | sha256sum | cut -f 1 -d " ") + for DTS_FILE in ${OSTREE_DEVICETREE}; do DTS_FILE_BASENAME=$(basename ${DTS_FILE}) cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} done -- cgit v1.2.3-54-g00ecf From 6bdfa929bf43b3ec25e9926cadb54dd020032acc Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 16 Jun 2020 17:12:04 +0200 Subject: Add recipe to build images with binary primaries Signed-off-by: Laurent Bonnans --- recipes-sota/config/aktualizr-binary-pacman.bb | 21 +++++++++++++++++++++ recipes-sota/config/files/10-pacman.toml | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 recipes-sota/config/aktualizr-binary-pacman.bb create mode 100644 recipes-sota/config/files/10-pacman.toml diff --git a/recipes-sota/config/aktualizr-binary-pacman.bb b/recipes-sota/config/aktualizr-binary-pacman.bb new file mode 100644 index 0000000..36bafb3 --- /dev/null +++ b/recipes-sota/config/aktualizr-binary-pacman.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Configure aktualizr with a binary package manager" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" + +inherit allarch + +SRC_URI = "\ + file://10-pacman.toml \ + " + +FILES_${PN} = " \ + ${libdir}/sota/conf.d \ + ${libdir}/sota/conf.d/10-pacman.toml \ + " + +PR = "1" + +do_install() { + install -m 0700 -d ${D}${libdir}/sota/conf.d + install -m 0644 ${WORKDIR}/10-pacman.toml ${D}${libdir}/sota/conf.d/10-pacman.toml +} diff --git a/recipes-sota/config/files/10-pacman.toml b/recipes-sota/config/files/10-pacman.toml new file mode 100644 index 0000000..a24fd39 --- /dev/null +++ b/recipes-sota/config/files/10-pacman.toml @@ -0,0 +1,2 @@ +[pacman] +type = "none" -- cgit v1.2.3-54-g00ecf From 7951110d5be5ee5ff5a54173be5137e873527742 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 15 Jun 2020 08:27:36 +0000 Subject: aktualizr: make use of boot-complete.target From the systemd.special(7) man page section boot-complete.target: This target is intended as generic synchronization point for services that shall determine or act on whether the boot process completed successfully. Let's make use of the target. Since aktualizr by default marks a boot as successful, we consider aktualizr.service a service which needs to be executed on successful boot (hence after the boot-complete.target). This allows to declare a service as crucial by simply ordering it before the boot-complete.target. The systemd example service systemd-boot-check-no-failures.service can serve as an example. This change does not add any service dependency by default as boot-complete.target by default does not has any extra dependencies. Note that rebooting in the failure case is not handled by this mechanism. This can be added by using FailureAction. Boot assessement infrastructure got introduced with systemd 240. See also: https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ Signed-off-by: Stefan Agner --- recipes-sota/aktualizr/files/aktualizr.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service index 3d807a1..ae5d23a 100644 --- a/recipes-sota/aktualizr/files/aktualizr.service +++ b/recipes-sota/aktualizr/files/aktualizr.service @@ -1,6 +1,7 @@ [Unit] Description=Aktualizr SOTA Client -After=network-online.target nss-lookup.target +After=network-online.target nss-lookup.target boot-complete.target +Requires=boot-complete.target Wants=network-online.target [Service] -- cgit v1.2.3-54-g00ecf From 44c3156736ac7722a971ee4be4e25543571e2104 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Sun, 10 May 2020 10:36:20 +0200 Subject: meta: change virtual/network-configuration to network-configuration The name 'virtual' is a recipe specific concept but not a package specific one, it's confusing that a package provides 'virtual/' names. Let's drop 'virtual/' from network-configuration, to keep consistent with yocto naming styles. Signed-off-by: Ming Liu --- classes/sota_m3ulcb.bbclass | 4 ++-- classes/sota_minnowboard.bbclass | 4 ++-- classes/sota_porter.bbclass | 4 ++-- classes/sota_qemux86-64.bbclass | 2 +- classes/sota_raspberrypi.bbclass | 2 +- conf/distro/poky-sota-systemd.conf | 2 +- conf/local.conf.nonostree.append | 2 +- lib/oeqa/selftest/cases/updater_qemux86_64.py | 2 +- recipes-connectivity/connman/connman_%.bbappend | 2 +- recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb | 2 +- recipes-test/images/primary-image.bb | 2 +- recipes-test/images/secondary-image.bb | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/classes/sota_m3ulcb.bbclass b/classes/sota_m3ulcb.bbclass index e7fa9c2..7ea273d 100644 --- a/classes/sota_m3ulcb.bbclass +++ b/classes/sota_m3ulcb.bbclass @@ -8,5 +8,5 @@ OSTREE_BOOTLOADER ?= "u-boot" UBOOT_MACHINE_sota = "${@d.getVar('SOC_FAMILY').split(':')[1]}_ulcb_defconfig" -PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" -IMAGE_INSTALL_append_sota = " virtual/network-configuration " +PREFERRED_RPROVIDER_network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " network-configuration " diff --git a/classes/sota_minnowboard.bbclass b/classes/sota_minnowboard.bbclass index a907217..3128965 100644 --- a/classes/sota_minnowboard.bbclass +++ b/classes/sota_minnowboard.bbclass @@ -8,5 +8,5 @@ IMAGE_FSTYPES_remove_sota = "live hddimg" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0" IMAGE_INSTALL_append = " minnowboard-efi-startup" -PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" -IMAGE_INSTALL_append_sota = " virtual/network-configuration " +PREFERRED_RPROVIDER_network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " network-configuration " diff --git a/classes/sota_porter.bbclass b/classes/sota_porter.bbclass index 80062e1..6c6fe70 100644 --- a/classes/sota_porter.bbclass +++ b/classes/sota_porter.bbclass @@ -7,5 +7,5 @@ IMAGE_BOOT_FILES_sota += "porter-bootfiles/*" OSTREE_BOOTLOADER ?= "u-boot" UBOOT_MACHINE_sota = "porter_config" -PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" -IMAGE_INSTALL_append_sota = " virtual/network-configuration " +PREFERRED_RPROVIDER_network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " network-configuration " diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index fc4aa7c..3dc2428 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -13,4 +13,4 @@ IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '655 # fix for u-boot/swig build issue HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc" -IMAGE_INSTALL_append_sota = " virtual/network-configuration " +IMAGE_INSTALL_append_sota = " network-configuration " diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index d5d89a9..744ba22 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass @@ -13,7 +13,7 @@ UBOOT_DTBO_LOADADDRESS = "0x06000000" IMAGE_INSTALL_append = " fit-conf" DEV_MATCH_DIRECTIVE_pn-networkd-dhcp-conf = "Driver=smsc95xx lan78xx" -IMAGE_INSTALL_append_sota = " virtual/network-configuration " +IMAGE_INSTALL_append_sota = " network-configuration " PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" UBOOT_ENTRYPOINT_sota ?= "0x00080000" diff --git a/conf/distro/poky-sota-systemd.conf b/conf/distro/poky-sota-systemd.conf index 0dc50b0..4b7990f 100644 --- a/conf/distro/poky-sota-systemd.conf +++ b/conf/distro/poky-sota-systemd.conf @@ -9,4 +9,4 @@ DISTRO_CODENAME = "sota" DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" -PREFERRED_RPROVIDER_virtual/network-configuration ??= "networkd-dhcp-conf" +PREFERRED_RPROVIDER_network-configuration ??= "networkd-dhcp-conf" diff --git a/conf/local.conf.nonostree.append b/conf/local.conf.nonostree.append index 0e63e98..ee56b69 100644 --- a/conf/local.conf.nonostree.append +++ b/conf/local.conf.nonostree.append @@ -2,7 +2,7 @@ DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" -PREFERRED_RPROVIDER_virtual/network-configuration ??= "networkd-dhcp-conf" +PREFERRED_RPROVIDER_network-configuration ??= "networkd-dhcp-conf" SOTA_DEPLOY_CREDENTIALS ?= "1" PACKAGECONFIG_pn-aktualizr = "" diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py index 08220f4..dfcb8e0 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py @@ -130,7 +130,7 @@ class SharedCredProvTestsNonOSTree(SharedCredProvTests): self.append_config('DISTRO = "poky"') self.append_config('DISTRO_FEATURES_append = " systemd"') self.append_config('VIRTUAL-RUNTIME_init_manager = "systemd"') - self.append_config('PREFERRED_RPROVIDER_virtual/network-configuration ??= "networkd-dhcp-conf"') + self.append_config('PREFERRED_RPROVIDER_network-configuration ??= "networkd-dhcp-conf"') self.append_config('PACKAGECONFIG_pn-aktualizr = ""') self.append_config('SOTA_DEPLOY_CREDENTIALS = "1"') self.append_config('IMAGE_INSTALL_append += "aktualizr"') diff --git a/recipes-connectivity/connman/connman_%.bbappend b/recipes-connectivity/connman/connman_%.bbappend index b3633cc..cd1b95d 100644 --- a/recipes-connectivity/connman/connman_%.bbappend +++ b/recipes-connectivity/connman/connman_%.bbappend @@ -1 +1 @@ -RPROVIDES_${PN} += "virtual/network-configuration" +RPROVIDES_${PN} += "network-configuration" diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb index 40a3958..20a1a17 100644 --- a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 inherit systemd -RPROVIDES_${PN} = "virtual/network-configuration" +RPROVIDES_${PN} = "network-configuration" SRC_URI = " \ file://20-wired-dhcp.network \ diff --git a/recipes-test/images/primary-image.bb b/recipes-test/images/primary-image.bb index ba1dc1f..e6896ea 100644 --- a/recipes-test/images/primary-image.bb +++ b/recipes-test/images/primary-image.bb @@ -5,7 +5,7 @@ SUMMARY = "A minimal Uptane Primary image running aktualizr, for testing with a LICENSE = "MPL-2.0" IMAGE_INSTALL_remove = " \ - virtual/network-configuration \ + network-configuration \ " IMAGE_INSTALL_append = " \ diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index 7db2c68..22fb7f3 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb @@ -16,7 +16,7 @@ IMAGE_INSTALL_remove = " \ aktualizr-device-prov \ aktualizr-device-prov-hsm \ aktualizr-uboot-env-rollback \ - virtual/network-configuration \ + network-configuration \ " IMAGE_INSTALL_append = " \ -- cgit v1.2.3-54-g00ecf From 6a41d4cc7378939270d8ff78d9d3ad3fa8975c98 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Mon, 11 May 2020 20:16:05 +0200 Subject: meta: introduce ostree-kernel-initramfs recipe We package kernel image, devicetrees, initramfs and install them to /usr/lib/modules/${KERNEL_VERSION}, which is the preferred location according to ostree's new implementation, this could simplify the deployment. Reference: https://github.com/ostreedev/ostree/commit/3ab0d5e6644885440bac6abd17b6d2637df5435f To let initramfs-ostree-image be able to be depended by ostree-kernel-initramfs, it must inherit nopackages to avoid a annoying QA warning like the follows: | WARNING: initramfs-ostree-image-0.0.1-r0 do_package: Manifest ...initramfs-ostree-image.packagedata | not found in colibri_imx6 armv7ahf-neon-imx armv7at2hf-neon-imx armv7at2hf-neon armv7ahf-neon armv7at2hf-vfp | armv7ahf-vfp armv6thf-vfp armv6hf-vfp armv5tehf-vfp armv5ehf-vfp armv5thf-vfp armv5hf-vfp allarch | x86_64_x86_64-nativesdk (variant '')? Also we need define OSTREE_KERNEL, OSTREE_DEPLOY_DEVICETREE and OSTREE_DEVICETREE in sota.bbclass so they could be accessed in other recipes as well as in image recipes. Signed-off-by: Stefan Agner Signed-off-by: Ming Liu --- classes/image_types_ostree.bbclass | 24 ---------- classes/sota.bbclass | 8 +++- recipes-core/images/initramfs-ostree-image.bb | 2 +- .../ostree-kernel-initramfs_0.0.1.bb | 52 ++++++++++++++++++++++ 4 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 051dcf9..0b928a3 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -3,14 +3,11 @@ inherit features_check REQUIRED_DISTRO_FEATURES = "usrmerge" -OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs" OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" OSTREE_COMMIT_BODY ??= "" OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" OSTREE_UPDATE_SUMMARY ??= "0" -OSTREE_DEPLOY_DEVICETREE ??= "0" -OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}" BUILD_OSTREE_TARBALL ??= "1" @@ -135,27 +132,6 @@ IMAGE_CMD_ostree () { ln -sf ../var/usrlocal usr/local - if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then - # this is a hack for ostree not to override init= in kernel cmdline - - # make it think that the initramfs is present (while it is in FIT image) - # since initramfs is fake file, it does not need to be included in checksum - checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") - touch boot/initramfs-${checksum} - else - if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then - checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${OSTREE_DEVICETREE} | sha256sum | cut -f 1 -d " ") - for DTS_FILE in ${OSTREE_DEVICETREE}; do - DTS_FILE_BASENAME=$(basename ${DTS_FILE}) - cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} - done - else - checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} | sha256sum | cut -f 1 -d " ") - fi - cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} - fi - - cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} - # Copy image manifest cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest } diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 71bd303..dc18cbc 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -5,8 +5,11 @@ SOTA_CLIENT_PROV ??= "aktualizr-shared-prov" SOTA_DEPLOY_CREDENTIALS ?= "1" SOTA_HARDWARE_ID ??= "${MACHINE}" -IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" IMAGE_CLASSES += " image_types_ostree image_types_ota image_repo_manifest" +IMAGE_INSTALL_append_sota = " ${SOTA_CLIENT} ${SOTA_CLIENT_PROV} \ + ostree os-release ostree-kernel \ + ${@'ostree-initramfs' if d.getVar('KERNEL_IMAGETYPE') != 'fitImage' else ''} \ + ${@'ostree-devicetrees' if oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}') else ''}" IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}" @@ -27,6 +30,9 @@ OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" OSTREE_OSNAME ?= "poky" OSTREE_BOOTLOADER ??= 'u-boot' OSTREE_BOOT_PARTITION ??= "/boot" +OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" +OSTREE_DEPLOY_DEVICETREE ??= "0" +OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}" INITRAMFS_IMAGE ?= "initramfs-ostree-image" diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb index bc21ed3..4af1548 100644 --- a/recipes-core/images/initramfs-ostree-image.bb +++ b/recipes-core/images/initramfs-ostree-image.bb @@ -20,7 +20,7 @@ IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" # Avoid circular dependencies EXTRA_IMAGEDEPENDS = "" -inherit core-image +inherit core-image nopackages IMAGE_ROOTFS_SIZE = "8192" diff --git a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb new file mode 100644 index 0000000..fe8a9cc --- /dev/null +++ b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb @@ -0,0 +1,52 @@ +SUMMARY = "Ostree linux kernel, devicetrees and initramfs packager" +DESCRIPTION = "Ostree linux kernel, devicetrees and initramfs packager" +SECTION = "kernel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +# Whilst not a module, this ensures we don't get multilib extended (which would make no sense) +inherit module-base kernel-artifact-names + +PACKAGES = "ostree-kernel ostree-initramfs ostree-devicetrees" + +ALLOW_EMPTY_ostree-initramfs = "1" +ALLOW_EMPTY_ostree-devicetrees = "1" + +FILES_ostree-kernel = "${nonarch_base_libdir}/modules/*/vmlinuz" +FILES_ostree-initramfs = "${nonarch_base_libdir}/modules/*/initramfs.img" +FILES_ostree-devicetrees = "${nonarch_base_libdir}/modules/*/dtb/*" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +KERNEL_BUILD_ROOT = "${nonarch_base_libdir}/modules/" + +# There's nothing to do here, except install the artifacts where we can package them +do_fetch[noexec] = "1" +do_unpack[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +deltask do_populate_sysroot + +do_install() { + kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} + install -d $kerneldir + + cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} $kerneldir/vmlinuz + + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then + if [ -n "${INITRAMFS_IMAGE}" ]; then + cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} $kerneldir/initramfs.img + fi + + if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then + mkdir -p $kerneldir/dtb + for dts_file in ${KERNEL_DEVICETREE}; do + dts_file_basename=$(basename $dts_file) + cp ${DEPLOY_DIR_IMAGE}/$dts_file_basename $kerneldir/dtb/$dts_file_basename + done + fi + fi +} +do_install[vardepsexclude] = "KERNEL_VERSION" +do_install[depends] = "virtual/kernel:do_deploy ${@['${INITRAMFS_IMAGE}:do_image_complete', ''][d.getVar('INITRAMFS_IMAGE') == '']}" -- cgit v1.2.3-54-g00ecf From a4187918cb2b7c1884c1ccd39e6445b4f35fb318 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 23 Jun 2020 09:48:49 +0200 Subject: Put aktualizr-info in a separate package and use it in Secondaries. We did the work a while ago to make aktualizr-info work for Secondaries, but until now we weren't putting the tool into the secondary-image we use for testing. Now it's there. Actually, it's in every image that inherits from sota.bbclass, which is probably a good thing. Signed-off-by: Patrick Vacek --- classes/sota.bbclass | 3 +-- lib/oeqa/selftest/cases/updater_qemux86_64.py | 3 +-- recipes-sota/aktualizr/aktualizr_git.bb | 12 +++++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/classes/sota.bbclass b/classes/sota.bbclass index dc18cbc..fde00cd 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -1,12 +1,11 @@ DISTROOVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" -SOTA_CLIENT ??= "aktualizr" SOTA_CLIENT_PROV ??= "aktualizr-shared-prov" SOTA_DEPLOY_CREDENTIALS ?= "1" SOTA_HARDWARE_ID ??= "${MACHINE}" IMAGE_CLASSES += " image_types_ostree image_types_ota image_repo_manifest" -IMAGE_INSTALL_append_sota = " ${SOTA_CLIENT} ${SOTA_CLIENT_PROV} \ +IMAGE_INSTALL_append_sota = " aktualizr aktualizr-info ${SOTA_CLIENT_PROV} \ ostree os-release ostree-kernel \ ${@'ostree-initramfs' if d.getVar('KERNEL_IMAGETYPE') != 'fitImage' else ''} \ ${@'ostree-devicetrees' if oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}') else ''}" diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py index dfcb8e0..c7d0448 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py @@ -133,8 +133,7 @@ class SharedCredProvTestsNonOSTree(SharedCredProvTests): self.append_config('PREFERRED_RPROVIDER_network-configuration ??= "networkd-dhcp-conf"') self.append_config('PACKAGECONFIG_pn-aktualizr = ""') self.append_config('SOTA_DEPLOY_CREDENTIALS = "1"') - self.append_config('IMAGE_INSTALL_append += "aktualizr"') - self.append_config('IMAGE_INSTALL_append += " aktualizr-shared-prov"') + self.append_config('IMAGE_INSTALL_append += "aktualizr aktualizr-info aktualizr-shared-prov"') self.qemu, self.s = qemu_launch(machine='qemux86-64', uboot_enable='no') diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 56a6389..0bfe51a 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -132,23 +132,25 @@ PACKAGESPLITFUNCS_prepend = "split_hosttools_packages " python split_hosttools_packages () { bindir = d.getVar('bindir') - # Split all binaries to their own packages except aktualizr-info, - # aktualizr-info should stay in main package aktualizr. - do_split_packages(d, bindir, r'^((?!(aktualizr-info)).*)$', '%s', 'Aktualizr tool - %s', extra_depends='aktualizr-configs', prepend=False) + # Split all binaries to their own packages. + do_split_packages(d, bindir, '^(.*)$', '%s', 'Aktualizr tool - %s', extra_depends='aktualizr-configs', prepend=False) } PACKAGES_DYNAMIC = "^aktualizr-.* ^garage-.*" -PACKAGES =+ "${PN}-host-tools ${PN}-lib ${PN}-resource-control ${PN}-configs ${PN}-secondary ${PN}-secondary-lib ${PN}-sotatools-lib" +PACKAGES =+ "${PN}-host-tools ${PN}-info ${PN}-lib ${PN}-resource-control ${PN}-configs ${PN}-secondary ${PN}-secondary-lib ${PN}-sotatools-lib" ALLOW_EMPTY_${PN}-host-tools = "1" FILES_${PN} = " \ ${bindir}/aktualizr \ - ${bindir}/aktualizr-info \ ${systemd_unitdir}/system/aktualizr.service \ " +FILES_${PN}-info = " \ + ${bindir}/aktualizr-info \ + " + FILES_${PN}-lib = " \ ${libdir}/libaktualizr.so \ " -- cgit v1.2.3-54-g00ecf From cd677f074169586d59a84a0875dbae466331f557 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 26 Jun 2020 20:16:02 +0200 Subject: ostree-kernel-initramfs: fix parsing for MACHINEs which don't define INITRAMFS_IMAGE * when INITRAMFS_IMAGE isn't defined at all, the "d.getVar('INITRAMFS_IMAGE') == ''" part doesn't do anything useful, because the unexpanded version of this ends in do_install[depends] variable and breaks parsing: meta-updater/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb:do_install[depends], dependency ''][d.getVar('INITRAMFS_IMAGE') in 'virtual/kernel:do_deploy ${@['${INITRAMFS_IMAGE}:do_image_complete', ''][d.getVar('INITRAMFS_IMAGE') == '']} virtual/fakeroot-native:do_populate_sysroot' does not contain exactly one ':' character. Task 'depends' should be specified in the form 'packagename:task' Signed-off-by: Martin Jansa --- recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb index fe8a9cc..9139c7f 100644 --- a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb +++ b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb @@ -49,4 +49,5 @@ do_install() { fi } do_install[vardepsexclude] = "KERNEL_VERSION" +INITRAMFS_IMAGE ?= "" do_install[depends] = "virtual/kernel:do_deploy ${@['${INITRAMFS_IMAGE}:do_image_complete', ''][d.getVar('INITRAMFS_IMAGE') == '']}" -- cgit v1.2.3-54-g00ecf From 762a4ccbeb271da9a38db41330d70cdae8eca2d3 Mon Sep 17 00:00:00 2001 From: antznin Date: Tue, 30 Jun 2020 10:37:25 +0200 Subject: ostree-kernel-initramfs: deploy dtbs from OSTREE_DEVICETREE Signed-off-by: antznin --- recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb index 9139c7f..1b9c0ad 100644 --- a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb +++ b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb @@ -41,7 +41,7 @@ do_install() { if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then mkdir -p $kerneldir/dtb - for dts_file in ${KERNEL_DEVICETREE}; do + for dts_file in ${OSTREE_DEVICETREE}; do dts_file_basename=$(basename $dts_file) cp ${DEPLOY_DIR_IMAGE}/$dts_file_basename $kerneldir/dtb/$dts_file_basename done -- cgit v1.2.3-54-g00ecf From decd9bcf1f613702d59dec4d0d539d60c5fa2d9d Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Wed, 1 Jul 2020 17:24:59 +0200 Subject: ostree-kernel-initramfs: skip recipe when OSTREE_KERNEL is not defined * otherwise it fails with useless error: ostree-kernel-initramfs/0.0.1-r0/temp/run.do_install.3011' failed with exit code 1: cp: -r not specified; omitting directory 'tmp-glibc/deploy/images/qemux86/' WARNING: exit code 1 from a shell command. because of cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} $kerneldir/vmlinuz in do_install will try to copy whole ${DEPLOY_DIR_IMAGE}/ when ${OSTREE_KERNEL} is empty as reported in: https://github.com/advancedtelematic/meta-updater/pull/740#issuecomment-651952735 Signed-off-by: Martin Jansa --- .../ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb index 1b9c0ad..6159f00 100644 --- a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb +++ b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb @@ -51,3 +51,8 @@ do_install() { do_install[vardepsexclude] = "KERNEL_VERSION" INITRAMFS_IMAGE ?= "" do_install[depends] = "virtual/kernel:do_deploy ${@['${INITRAMFS_IMAGE}:do_image_complete', ''][d.getVar('INITRAMFS_IMAGE') == '']}" + +python() { + if not d.getVar('OSTREE_KERNEL'): + raise bb.parse.SkipRecipe('OSTREE_KERNEL is not defined, maybe your MACHINE config does not inherit sota.bbclass?') +} -- cgit v1.2.3-54-g00ecf From 29548b556744ee4472308a1d3faeb8c931313a1a Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Sat, 4 Jul 2020 10:06:00 +0200 Subject: image_types_ota.bbclass: change IMAGE_BASENAME to PN When setting intertask dependencies, we should use PN instead of IMAGE_BASENAME to refer to a image recipe, since PN is generated from recipe file name, while IMAGE_BASENAME is a variable that could be changed, it's not guaranteed to always equal to PN. Signed-off-by: Ming Liu --- classes/image_types_ota.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index a8a19b5..36a6a64 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -128,4 +128,4 @@ IMAGE_CMD_ota-ext4 () { mkfs.ext4 -O ^64bit ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 -L otaroot -d ${OTA_SYSROOT} } -do_image_wic[depends] += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '%s:do_image_ota_ext4' % d.getVar('IMAGE_BASENAME'), '', d)}" +do_image_wic[depends] += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '%s:do_image_ota_ext4' % d.getVar('PN'), '', d)}" -- cgit v1.2.3-54-g00ecf From 9b41913c909c030b2a738e05f66f4078daceca04 Mon Sep 17 00:00:00 2001 From: antznin Date: Fri, 3 Jul 2020 15:07:36 +0200 Subject: ostree-kernel-initramfs: fix devicetree deployment Following the changes in ostree's deployment of the kernel, initramfs and devicetree in /lib/modules/$kver, the deployment method of the device tree also changed. Instead of picking the first device tree it finds at a given location, ostree looks at a file named devicetree, next to kernel and initramfs in /lib/modules/$kver. This commit modifies ostree-kernel-initramfs to deploy the devicetree from the sota-defined variable OSTREE_DEVICETREE. It will pick the first one from the list of device trees that OSTREE_DEVICETREE defines, and copy it to /lib/modules/$kver. Note that since OSTREE_DEVICETREE equals to KERNEL_DEVICETREE when it isn't explicitly defined, it could indeed be a list of device trees. Signed-off-by: antznin --- .../ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb index 6159f00..136bb22 100644 --- a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb +++ b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb @@ -14,7 +14,9 @@ ALLOW_EMPTY_ostree-devicetrees = "1" FILES_ostree-kernel = "${nonarch_base_libdir}/modules/*/vmlinuz" FILES_ostree-initramfs = "${nonarch_base_libdir}/modules/*/initramfs.img" -FILES_ostree-devicetrees = "${nonarch_base_libdir}/modules/*/dtb/*" +FILES_ostree-devicetrees = "${nonarch_base_libdir}/modules/*/dtb/* \ + ${nonarch_base_libdir}/modules/*/devicetree \ +" PACKAGE_ARCH = "${MACHINE_ARCH}" @@ -45,6 +47,7 @@ do_install() { dts_file_basename=$(basename $dts_file) cp ${DEPLOY_DIR_IMAGE}/$dts_file_basename $kerneldir/dtb/$dts_file_basename done + cp $kerneldir/dtb/$(basename $(echo ${OSTREE_DEVICETREE} | awk '{print $1}')) $kerneldir/devicetree fi fi } -- cgit v1.2.3-54-g00ecf From 4cb3ea0eca94ba8b20d2c8035e6c12f863e4fd3d Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Wed, 8 Jul 2020 15:58:07 +0200 Subject: aktualizr: Bump to 2020.8 release. 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 0bfe51a..d9b464f 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -17,7 +17,7 @@ PRIVATE_LIBS_${PN}-ptest = "libaktualizr.so libaktualizr_secondary.so" PV = "1.0+git${SRCPV}" PR = "7" -GARAGE_SIGN_PV = "0.7.1-4-gf10c1da" +GARAGE_SIGN_PV = "0.7.1-10-ga0a099a" SRC_URI = " \ gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ @@ -29,10 +29,10 @@ SRC_URI = " \ ${@ d.expand("https://tuf-cli-releases.ota.here.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if not oe.types.boolean(d.getVar('GARAGE_SIGN_AUTOVERSION')) else ''} \ " -SRC_URI[garagesign.md5sum] = "5f8eea81d1559d6fcb28d49c4298727c" -SRC_URI[garagesign.sha256sum] = "8b2f5bb164f19b41972069d3377e39c2eb9edffd471777161691039e12a71738" +SRC_URI[garagesign.md5sum] = "e2354fb75ae56c2d253be26617b2bd10" +SRC_URI[garagesign.sha256sum] = "2ddb26b19090a42d7aeeda287ed40123ffa3ab55b5dcc4ea4c9320d0a0fd59a0" -SRCREV = "cf44da79555d1897115eb350cbc43db1e213db03" +SRCREV = "4169157a1874fca3fb55571c60507c1aefd4e1e5" BRANCH ?= "master" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf