summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2023-06-21 10:13:30 -0700
committerArmin Kuster <akuster808@gmail.com>2023-06-25 15:05:28 -0400
commitfc12521b08071a56d03e3c95ea0ae3bb00f77259 (patch)
treecf62da8b433d85ebf2533dd5916517ee900ed736
parentb6ec838e8ff9f80f4f368a5f6b1fef27072e8489 (diff)
downloadmeta-security-fc12521b08071a56d03e3c95ea0ae3bb00f77259.tar.gz
dm-verity: restructure the veritysetup arg parsing
In making changes to the existing veritysetup arg list, it is harder to see what the proposed change is since they are are glued together on one long line. Break them up so reviewing future unified diffs will be more easy to visually parse. This also makes it easier to temp. dump the args to a file for debugging. In theory this should have no functional change. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--classes/dm-verity-img.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/classes/dm-verity-img.bbclass b/classes/dm-verity-img.bbclass
index d809985..b279fa8 100644
--- a/classes/dm-verity-img.bbclass
+++ b/classes/dm-verity-img.bbclass
@@ -58,6 +58,7 @@ verity_setup() {
58 local INPUT=${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$TYPE 58 local INPUT=${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$TYPE
59 local SIZE=$(stat --printf="%s" $INPUT) 59 local SIZE=$(stat --printf="%s" $INPUT)
60 local OUTPUT=$INPUT.verity 60 local OUTPUT=$INPUT.verity
61 local SETUP_ARGS=""
61 62
62 if [ ${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} -ge ${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} ]; then 63 if [ ${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} -ge ${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} ]; then
63 align=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} 64 align=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE}
@@ -68,9 +69,15 @@ verity_setup() {
68 69
69 cp -a $INPUT $OUTPUT 70 cp -a $INPUT $OUTPUT
70 71
72 SETUP_ARGS=" \
73 --data-block-size=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} \
74 --hash-block-size=${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} \
75 --hash-offset=$SIZE format $OUTPUT $OUTPUT \
76 "
77
71 # Let's drop the first line of output (doesn't contain any useful info) 78 # Let's drop the first line of output (doesn't contain any useful info)
72 # and feed the rest to another function. 79 # and feed the rest to another function.
73 veritysetup --data-block-size=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} --hash-block-size=${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} --hash-offset=$SIZE format $OUTPUT $OUTPUT | tail -n +2 | process_verity 80 veritysetup $SETUP_ARGS | tail -n +2 | process_verity
74} 81}
75 82
76VERITY_TYPES = " \ 83VERITY_TYPES = " \