summaryrefslogtreecommitdiffstats
path: root/classes/sota.bbclass
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2018-11-20 09:03:25 +0100
committerMing Liu <liu.ming50@gmail.com>2018-11-24 14:24:26 +0100
commite97975d6113ca1ffa6cbe9b005bd518bd146fd9c (patch)
tree0c1df1f626bfd3d1819661dda5fb6ff7c4877210 /classes/sota.bbclass
parentf4cf0698a88631af150782dce9b3dafcb0dbc5d5 (diff)
downloadmeta-updater-e97975d6113ca1ffa6cbe9b005bd518bd146fd9c.tar.gz
image_types_ostree/ota.bbclass: refactor ostree task
There are several flaws with ostree tasks, as follows: - ${IMAGE_NAME}.rootfs.ostree.tar.bz2 is generated, but it's not being used during ostree commit, so it should be removed if it's just a intermittent artifact. Or if we intend to deploy this tar.bz2 file, it should be tracked by sstate cache, that is to day, it should be generated in ${IMGDEPLOYDIR} rather than in ${DEPLOY_DIR_IMAGE}. - There are quite a few redundant code like mktemp/cd/rm a directory, which can be replaced by setting 'dirs', 'cleandirs' varflags. - There are some redundant variable check logic in image_types_ostree and image_types_ota bbclass. To fix the above, we make the following changes: - Introduce a new conversion image type 'tar', it could convert ostree and ota to ostree.tar, ota.tar, hence we can drop the code generating ostree.tar.bz2 in image_types_ostree.bbclass, and also drop the do_image_ota-tar task. To let this conversion type take effect, the otasetup task needs to be changed to ota. - Introduce BUILD_OSTREE_TARBALL variable, when being set to 1, a ostree.tar.bz2 tarball would be built, BUILD_OSTREE_TARBALL defaults to be 1, to be consistent with original behavior. - Replace 'ota-tar ota-tar.xz' with ota.tar.xz in IMAGE_FSTYPES. - Add a sanity check bbclass sota_sanity.bbclass, to ensure ostree or ota is not in OVERRIDES, this is to prevent potential naming pollution with other meta layers, and also check the required variables are not empty. This sota_sanity.bbclass is a common class that could be extended easily in furture, and one of its most advantages is that all the check are done in bb.event.SanityCheck event handler, so the end users could get the error message at very beginning of the recipe parsing time. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Diffstat (limited to 'classes/sota.bbclass')
-rw-r--r--classes/sota.bbclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index e654071..7118807 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -16,7 +16,8 @@ IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PRO
16IMAGE_CLASSES += " image_types_ostree image_types_ota" 16IMAGE_CLASSES += " image_types_ostree image_types_ota"
17 17
18IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" 18IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}"
19IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OTA_TARBALL', '1', 'ota-tar ota-tar.xz', ' ', d)}" 19IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}"
20IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OTA_TARBALL', '1', 'ota.tar.xz', ' ', d)}"
20 21
21PACKAGECONFIG_append_pn-curl = " ssl" 22PACKAGECONFIG_append_pn-curl = " ssl"
22PACKAGECONFIG_remove_pn-curl = "gnutls" 23PACKAGECONFIG_remove_pn-curl = "gnutls"
@@ -50,6 +51,7 @@ SOTA_MACHINE_intel-corei7-64 ?= "minnowboard"
50SOTA_MACHINE_qemux86-64 ?= "qemux86-64" 51SOTA_MACHINE_qemux86-64 ?= "qemux86-64"
51SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi" 52SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
52 53
53inherit sota_${SOTA_MACHINE} 54SOTA_OVERRIDES_BLACKLIST = "ostree ota"
55SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME"
54 56
55inherit image_repo_manifest 57inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest