summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/image_types_ostree.bbclass24
-rw-r--r--classes/sota.bbclass8
2 files changed, 7 insertions, 25 deletions
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
3 3
4REQUIRED_DISTRO_FEATURES = "usrmerge" 4REQUIRED_DISTRO_FEATURES = "usrmerge"
5 5
6OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
7OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs" 6OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs"
8OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" 7OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
9OSTREE_COMMIT_BODY ??= "" 8OSTREE_COMMIT_BODY ??= ""
10OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" 9OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}"
11OSTREE_UPDATE_SUMMARY ??= "0" 10OSTREE_UPDATE_SUMMARY ??= "0"
12OSTREE_DEPLOY_DEVICETREE ??= "0"
13OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}"
14 11
15BUILD_OSTREE_TARBALL ??= "1" 12BUILD_OSTREE_TARBALL ??= "1"
16 13
@@ -135,27 +132,6 @@ IMAGE_CMD_ostree () {
135 132
136 ln -sf ../var/usrlocal usr/local 133 ln -sf ../var/usrlocal usr/local
137 134
138 if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then
139 # this is a hack for ostree not to override init= in kernel cmdline -
140 # make it think that the initramfs is present (while it is in FIT image)
141 # since initramfs is fake file, it does not need to be included in checksum
142 checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ")
143 touch boot/initramfs-${checksum}
144 else
145 if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then
146 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${OSTREE_DEVICETREE} | sha256sum | cut -f 1 -d " ")
147 for DTS_FILE in ${OSTREE_DEVICETREE}; do
148 DTS_FILE_BASENAME=$(basename ${DTS_FILE})
149 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum}
150 done
151 else
152 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} | sha256sum | cut -f 1 -d " ")
153 fi
154 cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum}
155 fi
156
157 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum}
158
159 # Copy image manifest 135 # Copy image manifest
160 cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest 136 cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest
161} 137}
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"
5SOTA_DEPLOY_CREDENTIALS ?= "1" 5SOTA_DEPLOY_CREDENTIALS ?= "1"
6SOTA_HARDWARE_ID ??= "${MACHINE}" 6SOTA_HARDWARE_ID ??= "${MACHINE}"
7 7
8IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
9IMAGE_CLASSES += " image_types_ostree image_types_ota image_repo_manifest" 8IMAGE_CLASSES += " image_types_ostree image_types_ota image_repo_manifest"
9IMAGE_INSTALL_append_sota = " ${SOTA_CLIENT} ${SOTA_CLIENT_PROV} \
10 ostree os-release ostree-kernel \
11 ${@'ostree-initramfs' if d.getVar('KERNEL_IMAGETYPE') != 'fitImage' else ''} \
12 ${@'ostree-devicetrees' if oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}') else ''}"
10 13
11IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" 14IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}"
12IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}" 15IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}"
@@ -27,6 +30,9 @@ OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
27OSTREE_OSNAME ?= "poky" 30OSTREE_OSNAME ?= "poky"
28OSTREE_BOOTLOADER ??= 'u-boot' 31OSTREE_BOOTLOADER ??= 'u-boot'
29OSTREE_BOOT_PARTITION ??= "/boot" 32OSTREE_BOOT_PARTITION ??= "/boot"
33OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
34OSTREE_DEPLOY_DEVICETREE ??= "0"
35OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}"
30 36
31INITRAMFS_IMAGE ?= "initramfs-ostree-image" 37INITRAMFS_IMAGE ?= "initramfs-ostree-image"
32 38