mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-10-16 02:47:01 +00:00
ti-core-initramfs: Extend with dm-verity support
Add dm-verity support to ti-core-initramfs by: - Enabling dm-verity modules and tools (cryptsetup, util-linux-mount) when DM_VERITY_IMAGE is set - Adding do_rootfs[nostamp] and do_image[nostamp] to rebuild initramfs after rootfs verity task completes - Making deploy_verity_hash gracefully handle missing .verity.env file on first pass with bbwarn Signed-off-by: Atharv Dubey <a-dubey@ti.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
This commit is contained in:
1 parent
83a99a51df
commit
96b3182a42
2 files changed
+26
-1
No files matched your search
@@ -5,7 +5,7 @@
|
||||
# TI_CORE_INITRAMFS_ENABLED = "0"
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') or bb.utils.contains('DISTRO_FEATURES', 'luks', True, False, d) else '0'}"
|
||||
TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') or bb.utils.contains('DISTRO_FEATURES', 'luks', True, False, d) or d.getVar('DM_VERITY_IMAGE') else '0'}"
|
||||
|
||||
TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
|
||||
TI_CORE_INITRAMFS_EXTRA_INSTALL ?= ""
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# Install the essential utils for dm-verity in ti-core-initramfs
|
||||
TI_CORE_INITRAMFS_EXTRA_INSTALL:append = "${@' initramfs-module-dmverity cryptsetup util-linux-mount' if d.getVar('DM_VERITY_IMAGE') else ''}"
|
||||
|
||||
# Ensure dm-verity.env is updated also when rebuilding DM_VERITY_IMAGE
|
||||
do_image[nostamp] = "1"
|
||||
do_rootfs[nostamp] = "1"
|
||||
|
||||
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
|
||||
|
||||
deploy_verity_hash() {
|
||||
# The .verity.env file is created by the DM_VERITY_IMAGE build (e.g., arago-base-image).
|
||||
# On the first pass, it won't exist yet because the initramfs is built before the rootfs
|
||||
# (due to INITRAMFS_IMAGE dependency). The do_rootfs[nostamp] = "1" causes this task
|
||||
# to re-run after the rootfs is built, at which point the file will exist.
|
||||
if [ -f ${STAGING_VERITY_DIR}/${DM_VERITY_IMAGE}.${DM_VERITY_IMAGE_TYPE}.verity.env ]; then
|
||||
install -D -m 0644 \
|
||||
${STAGING_VERITY_DIR}/${DM_VERITY_IMAGE}.${DM_VERITY_IMAGE_TYPE}.verity.env \
|
||||
${IMAGE_ROOTFS}${datadir}/misc/dm-verity.env
|
||||
else
|
||||
bbwarn "dm-verity.env not found at ${STAGING_VERITY_DIR}/${DM_VERITY_IMAGE}.${DM_VERITY_IMAGE_TYPE}.verity.env - will retry on rebuild (nostamp)"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
IMAGE_PREPROCESS_COMMAND += "deploy_verity_hash;"
|
||||
Reference in new issue
Block a user