summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorChrister Fletcher <christer.fletcher@inter.ikea.com>2021-09-01 16:18:01 +0200
committerArmin Kuster <akuster808@gmail.com>2021-09-06 15:53:00 -0700
commite0fca90835169e21ffabe6f2e4b901678236d36e (patch)
treebe82f102420d5c4062c09a0fbdbed7bbe9f189b9 /classes
parent1f18c623e94d85ef23f0a3970ff359880bd0caf5 (diff)
downloadmeta-security-e0fca90835169e21ffabe6f2e4b901678236d36e.tar.gz
dm-verity-img.bbclass: Expose --data-block-size for configuration
Add DM_VERITY_IMAGE_DATA_BLOCK_SIZE to be able to set the --data-block-size used in veritysetup. Tuning this value effects the performance and size of the resulting image. Signed-off-by: Christer Fletcher <christer.fletcher@inter.ikea.com> Signed-off-by: Paulo Neves <paulo.neves1@inter.ikea.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/dm-verity-img.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/classes/dm-verity-img.bbclass b/classes/dm-verity-img.bbclass
index a0950da..0b6d053 100644
--- a/classes/dm-verity-img.bbclass
+++ b/classes/dm-verity-img.bbclass
@@ -22,6 +22,9 @@
22# is stored where it can be installed into associated initramfs rootfs. 22# is stored where it can be installed into associated initramfs rootfs.
23STAGING_VERITY_DIR ?= "${TMPDIR}/work-shared/${MACHINE}/dm-verity" 23STAGING_VERITY_DIR ?= "${TMPDIR}/work-shared/${MACHINE}/dm-verity"
24 24
25# Define the data block size to use in veritysetup.
26DM_VERITY_IMAGE_DATA_BLOCK_SIZE ?= "1024"
27
25# Process the output from veritysetup and generate the corresponding .env 28# Process the output from veritysetup and generate the corresponding .env
26# file. The output from veritysetup is not very machine-friendly so we need to 29# file. The output from veritysetup is not very machine-friendly so we need to
27# convert it to some better format. Let's drop the first line (doesn't contain 30# convert it to some better format. Let's drop the first line (doesn't contain
@@ -57,7 +60,7 @@ verity_setup() {
57 60
58 # Let's drop the first line of output (doesn't contain any useful info) 61 # Let's drop the first line of output (doesn't contain any useful info)
59 # and feed the rest to another function. 62 # and feed the rest to another function.
60 veritysetup --data-block-size=1024 --hash-offset=$SIZE format $OUTPUT $OUTPUT | tail -n +2 | process_verity 63 veritysetup --data-block-size=${DM_VERITY_IMAGE_DATA_BLOCK_SIZE} --hash-offset=$SIZE format $OUTPUT $OUTPUT | tail -n +2 | process_verity
61} 64}
62 65
63VERITY_TYPES = "ext2.verity ext3.verity ext4.verity btrfs.verity" 66VERITY_TYPES = "ext2.verity ext3.verity ext4.verity btrfs.verity"