diff options
author | antznin <agodard@witekio.com> | 2020-05-29 09:59:15 +0200 |
---|---|---|
committer | antznin <agodard@witekio.com> | 2020-05-29 09:59:15 +0200 |
commit | c5f81d59191ddfbf601b0110143a38a056fa886d (patch) | |
tree | 5870d47ef361b7451dcdfebbf7f7d66961f34290 /classes | |
parent | ae495e3e8f32934679cc412d83aa6cdc57815a8a (diff) | |
download | meta-updater-c5f81d59191ddfbf601b0110143a38a056fa886d.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>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index bab4ed7..a03643f 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -10,6 +10,7 @@ OSTREE_COMMIT_BODY ??= "" | |||
10 | OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" | 10 | OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" |
11 | OSTREE_UPDATE_SUMMARY ??= "0" | 11 | OSTREE_UPDATE_SUMMARY ??= "0" |
12 | OSTREE_DEPLOY_DEVICETREE ??= "0" | 12 | OSTREE_DEPLOY_DEVICETREE ??= "0" |
13 | OSTREE_DEVICETREE ??= "${KERNEL_DEVICETREE}" | ||
13 | 14 | ||
14 | BUILD_OSTREE_TARBALL ??= "1" | 15 | BUILD_OSTREE_TARBALL ??= "1" |
15 | 16 | ||
@@ -141,9 +142,9 @@ IMAGE_CMD_ostree () { | |||
141 | checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") | 142 | checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") |
142 | touch boot/initramfs-${checksum} | 143 | touch boot/initramfs-${checksum} |
143 | else | 144 | else |
144 | if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${KERNEL_DEVICETREE}" ]; then | 145 | if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then |
145 | checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") | 146 | checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${OSTREE_DEVICETREE} | sha256sum | cut -f 1 -d " ") |
146 | for DTS_FILE in ${KERNEL_DEVICETREE}; do | 147 | for DTS_FILE in ${OSTREE_DEVICETREE}; do |
147 | DTS_FILE_BASENAME=$(basename ${DTS_FILE}) | 148 | DTS_FILE_BASENAME=$(basename ${DTS_FILE}) |
148 | cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} | 149 | cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} |
149 | done | 150 | done |