summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantznin <agodard@witekio.com>2020-05-29 09:59:15 +0200
committerMing Liu <ming.liu@toradex.com>2020-06-27 10:38:10 +0200
commit4fcf797368139cb42ced99fc3b14bd543b37108d (patch)
treea589d035fe0376d6d9e9f3e40a0b3c400f00a726
parent1739961a0a52c10e2839a99ff67f619128bff921 (diff)
downloadmeta-updater-4fcf797368139cb42ced99fc3b14bd543b37108d.tar.gz
image_types_ostree: allow specifying a device tree to deploy
When setting `OSTREE_DEPLOY_DEVICETREE` to 1, it will by default deploy all the device tree blobs present in `KERNEL_DEVICETREE`. Adding `OSTREE_DEVICETREE` would allow specifying a specific device tree blob (or several dtbs), thus resulting in only the specified ones in the image. This is particularely useful because ostree selects the first device tree it finds in /boot, and discards the remaining ones. Signed-off-by: antznin <agodard@witekio.com>
-rw-r--r--classes/image_types_ostree.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 8d68b5a..c95aa5e 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -8,6 +8,7 @@ OSTREE_COMMIT_BODY ??= ""
8OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" 8OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}"
9OSTREE_UPDATE_SUMMARY ??= "0" 9OSTREE_UPDATE_SUMMARY ??= "0"
10OSTREE_DEPLOY_DEVICETREE ??= "0" 10OSTREE_DEPLOY_DEVICETREE ??= "0"
11OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}"
11 12
12BUILD_OSTREE_TARBALL ??= "1" 13BUILD_OSTREE_TARBALL ??= "1"
13 14
@@ -140,9 +141,9 @@ IMAGE_CMD_ostree () {
140 checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") 141 checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ")
141 touch boot/initramfs-${checksum} 142 touch boot/initramfs-${checksum}
142 else 143 else
143 if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${KERNEL_DEVICETREE}" ]; then 144 if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then
144 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") 145 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${OSTREE_DEVICETREE} | sha256sum | cut -f 1 -d " ")
145 for DTS_FILE in ${KERNEL_DEVICETREE}; do 146 for DTS_FILE in ${OSTREE_DEVICETREE}; do
146 DTS_FILE_BASENAME=$(basename ${DTS_FILE}) 147 DTS_FILE_BASENAME=$(basename ${DTS_FILE})
147 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} 148 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum}
148 done 149 done