From 66c0d3afa91d2683728065a0b00de43ad25c3d6f Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Mon, 20 Nov 2017 15:37:31 +0800 Subject: image_types_ostree.bbclass: change the systemd detecting logic It can not determine the init manager is systemd by checking if DISTRO_FEATURES contains 'systemd', change it to check VIRTUAL-RUNTIME_init_manager instead. Signed-off-by: Ming Liu --- classes/image_types_ostree.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 8143b67..ba09ab7 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -15,7 +15,7 @@ RAMDISK_EXT_arm ?= ".ext4.gz.u-boot" OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" -export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" +export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" IMAGE_CMD_ostree () { if [ -z "$OSTREE_REPO" ]; then -- cgit v1.2.3-54-g00ecf From 3163e1d6baacb9c456a58a547b8136ff1942e803 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Mon, 20 Nov 2017 16:45:32 +0800 Subject: sota: introduce INITRAMFS_FSTYPES RAMDISK_EXT and IMAGE_FSTYPES of initramfs-ostree-image should not be defined separately, because they are representing the same fstype of a same initramfs image, or else, they turn out to be inconsistent if the users change one of them. So we use INITRAMFS_FSTYPES already defined in bitbake.conf, to be able to set fstype for initramfs. And it should default to ext4.gz.u-boot or ext4.gz depending on what OSTREE_BOOTLOADER is being set. Signed-off-by: Ming Liu --- classes/image_types_ostree.bbclass | 3 +-- classes/image_types_ota.bbclass | 2 -- classes/sota.bbclass | 4 +++- recipes-core/images/initramfs-ostree-image.bb | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index ba09ab7..dc8474c 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -10,8 +10,7 @@ IMAGE_DEPENDS_ostree = "ostree-native:do_populate_sysroot \ export OSTREE_REPO export OSTREE_BRANCHNAME -RAMDISK_EXT ?= ".ext4.gz" -RAMDISK_EXT_arm ?= ".ext4.gz.u-boot" +RAMDISK_EXT ?= ".${INITRAMFS_FSTYPES}" OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index ae217e3..9443987 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -7,8 +7,6 @@ # boot scripts, kernel and initramfs images # -OSTREE_BOOTLOADER ??= 'u-boot' - do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \ ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}" diff --git a/classes/sota.bbclass b/classes/sota.bbclass index f5a42c1..7e9adca 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -20,13 +20,15 @@ WKS_FILE_sota ?= "sdimage-sota.wks" EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" +INITRAMFS_FSTYPES = "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" + # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" # For UPTANE operation, OSTREE_BRANCHNAME must start with "${MACHINE}-" OSTREE_BRANCHNAME ?= "${MACHINE}" OSTREE_OSNAME ?= "poky" OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" - +OSTREE_BOOTLOADER ??= 'u-boot' GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" GARAGE_SIGN_KEYNAME ?= "garage-key" diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb index 4ab9da8..e77499e 100644 --- a/recipes-core/images/initramfs-ostree-image.bb +++ b/recipes-core/images/initramfs-ostree-image.bb @@ -13,8 +13,7 @@ IMAGE_LINGUAS = "" LICENSE = "MIT" -IMAGE_FSTYPES = "ext4.gz" -IMAGE_FSTYPES_append_arm = " ext4.gz.u-boot" +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" inherit core-image -- cgit v1.2.3-54-g00ecf