summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Clouser <ben.clouser@toradex.com>2018-07-10 17:27:57 -0700
committerBen Clouser <ben.clouser@toradex.com>2018-07-10 17:28:40 -0700
commitfef98227e6ff5c97593697fe6c382ddd3ee8dfa8 (patch)
tree962aca8378b7f68b8bc590b8a069972278815f1c
parent850801c59cbe49e841650489508ae78fbe5a9e82 (diff)
downloadmeta-updater-fef98227e6ff5c97593697fe6c382ddd3ee8dfa8.tar.gz
Add support for building ota-tar.xz, and fixes from review comments
-rw-r--r--classes/image_types_ota.bbclass13
-rw-r--r--classes/sota.bbclass2
2 files changed, 7 insertions, 8 deletions
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 99a2b63..0b2f7a1 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -7,13 +7,8 @@
7# boot scripts, kernel and initramfs images 7# boot scripts, kernel and initramfs images
8# 8#
9 9
10do_image_ota_ext4[depends] += "e2fsprogs-native:do_populate_sysroot \
11 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \
12 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}"
13 10
14do_image_ota_tar[depends] += "e2fsprogs-native:do_populate_sysroot \ 11do_image_ota_ext4[depends] += "e2fsprogs-native:do_populate_sysroot"
15 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \
16 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}"
17 12
18calculate_size () { 13calculate_size () {
19 BASE=$1 14 BASE=$1
@@ -152,6 +147,8 @@ create_ota () {
152 tar -cf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg.tar -C ${OTA_SYSROOT} . 147 tar -cf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg.tar -C ${OTA_SYSROOT} .
153 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar 148 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar
154 ln -s ${IMAGE_NAME}.otaimg.tar ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar 149 ln -s ${IMAGE_NAME}.otaimg.tar ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar
150 # To fit in with the rest of yocto's image utils, we create a rootfs.ota-tar in the deploy dir
151 cp ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ota-tar
155 else 152 else
156 rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg* 153 rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg*
157 bbfatal "create_ota Function called with unknown or unspecified FS_TYPE of ${FS_TYPE}. Failing!" 154 bbfatal "create_ota Function called with unknown or unspecified FS_TYPE of ${FS_TYPE}. Failing!"
@@ -174,7 +171,9 @@ IMAGE_CMD_ota-tar () {
174} 171}
175 172
176do_otasetup[doc] = "Sets up the base ota rootfs used for subsequent image generation" 173do_otasetup[doc] = "Sets up the base ota rootfs used for subsequent image generation"
177do_otasetup[depends] += "virtual/fakeroot-native:do_populate_sysroot" 174do_otasetup[depends] += "virtual/fakeroot-native:do_populate_sysroot \
175 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \
176 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}"
178 177
179addtask do_otasetup after do_image_ostree before do_image_ota_ext4 do_image_ota_tar 178addtask do_otasetup after do_image_ostree before do_image_ota_ext4 do_image_ota_tar
180 179
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index f86a589..3aca92c 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -14,7 +14,7 @@ IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PRO
14IMAGE_CLASSES += " image_types_ostree image_types_ota" 14IMAGE_CLASSES += " image_types_ostree image_types_ota"
15 15
16IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" 16IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}"
17IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OTA_TARBALL', '1', 'ota-tar', ' ', d)}" 17IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OTA_TARBALL', '1', 'ota-tar ota-tar.xz', ' ', d)}"
18 18
19PACKAGECONFIG_append_pn-curl = " ssl" 19PACKAGECONFIG_append_pn-curl = " ssl"
20PACKAGECONFIG_remove_pn-curl = "gnutls" 20PACKAGECONFIG_remove_pn-curl = "gnutls"