diff options
author | Mikko Rapeli <mikko.rapeli@linaro.org> | 2023-12-21 09:57:30 +0200 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2023-12-29 09:09:30 -0500 |
commit | 73e03651ef78d42577e052d7abfc13a9a36b3cbd (patch) | |
tree | 199ece4461ab580fd7fd18f8db25c89492048171 | |
parent | fd295b2c28219a0cd53087e7ff96edecd9b23d9d (diff) | |
download | meta-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.bbclass | 8 |
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. |
34 | STAGING_VERITY_DIR ?= "${TMPDIR}/work-shared/${MACHINE}/dm-verity" | 34 | STAGING_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. | ||
38 | DM_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. |
37 | DM_VERITY_IMAGE_DATA_BLOCK_SIZE ?= "1024" | 41 | DM_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 | ||
116 | verity_setup() { | 120 | verity_setup() { |