From 3af1b32743b245be8c4e199c6a3785bc92e93ab1 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 777360f..349d8fb 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -11,8 +11,7 @@ export OSTREE_REPO export OSTREE_BRANCHNAME export GARAGE_TARGET_NAME -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 17fe4e8..362c1bd 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 1e765f0..7ff4bf1 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