summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-12-21 09:57:30 +0200
committerArmin Kuster <akuster808@gmail.com>2023-12-29 09:09:30 -0500
commit73e03651ef78d42577e052d7abfc13a9a36b3cbd (patch)
tree199ece4461ab580fd7fd18f8db25c89492048171
parentfd295b2c28219a0cd53087e7ff96edecd9b23d9d (diff)
downloadmeta-security-73e03651ef78d42577e052d7abfc13a9a36b3cbd.tar.gz
dm-verity-img.bbclass: add DM_VERITY_DEPLOY_DIR
If image recipe A wants to embed another image B which used dm-verity-img.bbclass and generated the .wks file, then recipe B must deploy everything to IMGDEPLOYDIR but recipe A finds the output from DM_VERITY_DEPLOY_DIR = "${DEPLOY_DIR_IMAGE}". Now both A and B images can use dm-verity-img.bbclass. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Reviewed-by: Erik Schilling <erik.schilling@linaro.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--classes/dm-verity-img.bbclass8
1 files changed, 6 insertions, 2 deletions
diff --git a/classes/dm-verity-img.bbclass b/classes/dm-verity-img.bbclass
index 7f35df5..2f212d6 100644
--- a/classes/dm-verity-img.bbclass
+++ b/classes/dm-verity-img.bbclass
@@ -33,6 +33,10 @@
33# is stored where it can be installed into associated initramfs rootfs. 33# is stored where it can be installed into associated initramfs rootfs.
34STAGING_VERITY_DIR ?= "${TMPDIR}/work-shared/${MACHINE}/dm-verity" 34STAGING_VERITY_DIR ?= "${TMPDIR}/work-shared/${MACHINE}/dm-verity"
35 35
36# location of images, default current image recipe. Set to DEPLOY_DIR_IMAGE
37# if non-verity images want to embed the .wks and verity image.
38DM_VERITY_DEPLOY_DIR ?= "${IMGDEPLOYDIR}"
39
36# Define the data block size to use in veritysetup. 40# Define the data block size to use in veritysetup.
37DM_VERITY_IMAGE_DATA_BLOCK_SIZE ?= "1024" 41DM_VERITY_IMAGE_DATA_BLOCK_SIZE ?= "1024"
38 42
@@ -107,10 +111,10 @@ process_verity() {
107 # Create wks.in fragment with build specific UUIDs for partitions. 111 # Create wks.in fragment with build specific UUIDs for partitions.
108 # Unfortunately the wks.in does not support line continuations... 112 # Unfortunately the wks.in does not support line continuations...
109 # First, the unappended filesystem data partition. 113 # First, the unappended filesystem data partition.
110 echo 'part / --source rawcopy --ondisk sda --sourceparams="file=${IMGDEPLOYDIR}/${DM_VERITY_IMAGE}-${MACHINE}.${DM_VERITY_IMAGE_TYPE}.verity" --part-name verityroot --part-type="${DM_VERITY_ROOT_GUID}"'" --uuid=\"$ROOT_UUID\"" > $WKS_INC 114 echo 'part / --source rawcopy --ondisk sda --sourceparams="file=${DM_VERITY_DEPLOY_DIR}/${DM_VERITY_IMAGE}-${MACHINE}.rootfs.${DM_VERITY_IMAGE_TYPE}.verity" --part-name verityroot --part-type="${DM_VERITY_ROOT_GUID}"'" --uuid=\"$ROOT_UUID\"" > $WKS_INC
111 115
112 # note: no default mount point for hash data partition 116 # note: no default mount point for hash data partition
113 echo 'part --source rawcopy --ondisk sda --sourceparams="file=${IMGDEPLOYDIR}/${DM_VERITY_IMAGE}-${MACHINE}.${DM_VERITY_IMAGE_TYPE}.vhash" --part-name verityhash --part-type="${DM_VERITY_RHASH_GUID}"'" --uuid=\"$RHASH_UUID\"" >> $WKS_INC 117 echo 'part --source rawcopy --ondisk sda --sourceparams="file=${DM_VERITY_DEPLOY_DIR}/${DM_VERITY_IMAGE}-${MACHINE}.${DM_VERITY_IMAGE_TYPE}.vhash" --part-name verityhash --part-type="${DM_VERITY_RHASH_GUID}"'" --uuid=\"$RHASH_UUID\"" >> $WKS_INC
114} 118}
115 119
116verity_setup() { 120verity_setup() {