diff options
| -rw-r--r-- | classes/dm-verity-img.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/dm-verity-img.bbclass b/classes/dm-verity-img.bbclass index b279fa8..e190c87 100644 --- a/classes/dm-verity-img.bbclass +++ b/classes/dm-verity-img.bbclass | |||
| @@ -34,7 +34,6 @@ DM_VERITY_IMAGE_HASH_BLOCK_SIZE ?= "4096" | |||
| 34 | # any useful info) and feed the rest to a script. | 34 | # any useful info) and feed the rest to a script. |
| 35 | process_verity() { | 35 | process_verity() { |
| 36 | local ENV="${STAGING_VERITY_DIR}/${IMAGE_BASENAME}.$TYPE.verity.env" | 36 | local ENV="${STAGING_VERITY_DIR}/${IMAGE_BASENAME}.$TYPE.verity.env" |
| 37 | install -d ${STAGING_VERITY_DIR} | ||
| 38 | rm -f $ENV | 37 | rm -f $ENV |
| 39 | 38 | ||
| 40 | # Each line contains a key and a value string delimited by ':'. Read the | 39 | # Each line contains a key and a value string delimited by ':'. Read the |
| @@ -59,6 +58,9 @@ verity_setup() { | |||
| 59 | local SIZE=$(stat --printf="%s" $INPUT) | 58 | local SIZE=$(stat --printf="%s" $INPUT) |
| 60 | local OUTPUT=$INPUT.verity | 59 | local OUTPUT=$INPUT.verity |
| 61 | local SETUP_ARGS="" | 60 | local SETUP_ARGS="" |
| 61 | local SAVED_ARGS="${STAGING_VERITY_DIR}/${IMAGE_BASENAME}.$TYPE.verity.args" | ||
| 62 | |||
| 63 | install -d ${STAGING_VERITY_DIR} | ||
| 62 | 64 | ||
| 63 | if [ ${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} -ge ${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} ]; then | 65 | if [ ${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} -ge ${DM_VERITY_IMAGE_HASH_BLOCK_SIZE} ]; then |
| 64 | align=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} | 66 | align=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} |
| @@ -75,6 +77,8 @@ verity_setup() { | |||
| 75 | --hash-offset=$SIZE format $OUTPUT $OUTPUT \ | 77 | --hash-offset=$SIZE format $OUTPUT $OUTPUT \ |
| 76 | " | 78 | " |
| 77 | 79 | ||
| 80 | echo "veritysetup $SETUP_ARGS" > $SAVED_ARGS | ||
| 81 | |||
| 78 | # Let's drop the first line of output (doesn't contain any useful info) | 82 | # Let's drop the first line of output (doesn't contain any useful info) |
| 79 | # and feed the rest to another function. | 83 | # and feed the rest to another function. |
| 80 | veritysetup $SETUP_ARGS | tail -n +2 | process_verity | 84 | veritysetup $SETUP_ARGS | tail -n +2 | process_verity |
