From fc12521b08071a56d03e3c95ea0ae3bb00f77259 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Wed, 21 Jun 2023 10:13:30 -0700 Subject: 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 Signed-off-by: Armin Kuster --- classes/dm-verity-img.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'classes') 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() { local INPUT=${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$TYPE local SIZE=$(stat --printf="%s" $INPUT) local OUTPUT=$INPUT.verity + local SETUP_ARGS="" if [ ${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} -ge ${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} ]; then align=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} @@ -68,9 +69,15 @@ verity_setup() { cp -a $INPUT $OUTPUT + SETUP_ARGS=" \ + --data-block-size=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} \ + --hash-block-size=${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} \ + --hash-offset=$SIZE format $OUTPUT $OUTPUT \ + " + # Let's drop the first line of output (doesn't contain any useful info) # and feed the rest to another function. - 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 + veritysetup $SETUP_ARGS | tail -n +2 | process_verity } VERITY_TYPES = " \ -- cgit v1.2.3-54-g00ecf