summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/dm-verity-img.bbclass24
1 files changed, 19 insertions, 5 deletions
diff --git a/classes/dm-verity-img.bbclass b/classes/dm-verity-img.bbclass
index 62c3069..7f79548 100644
--- a/classes/dm-verity-img.bbclass
+++ b/classes/dm-verity-img.bbclass
@@ -177,6 +177,24 @@ CONVERSION_CMD:verity = "verity_setup ${type}"
177CONVERSION_DEPENDS_verity = "cryptsetup-native" 177CONVERSION_DEPENDS_verity = "cryptsetup-native"
178IMAGE_CMD:vhash = "verity_hash" 178IMAGE_CMD:vhash = "verity_hash"
179 179
180def get_verity_fstypes(d):
181 verity_image = d.getVar('DM_VERITY_IMAGE')
182 verity_type = d.getVar('DM_VERITY_IMAGE_TYPE')
183 verity_hash = d.getVar('DM_VERITY_SEPARATE_HASH')
184 pn = d.getVar('PN')
185
186 fstypes = ""
187 if not pn.endswith(verity_image):
188 return fstypes # This doesn't concern this image
189
190 fstypes = verity_type + ".verity"
191 if verity_hash == "1":
192 fstypes += " vhash"
193
194 return fstypes
195
196IMAGE_FSTYPES += "${@get_verity_fstypes(d)}"
197
180python __anonymous() { 198python __anonymous() {
181 verity_image = d.getVar('DM_VERITY_IMAGE') 199 verity_image = d.getVar('DM_VERITY_IMAGE')
182 verity_type = d.getVar('DM_VERITY_IMAGE_TYPE') 200 verity_type = d.getVar('DM_VERITY_IMAGE_TYPE')
@@ -188,16 +206,12 @@ python __anonymous() {
188 bb.warn('dm-verity-img class inherited but not used') 206 bb.warn('dm-verity-img class inherited but not used')
189 return 207 return
190 208
191 if verity_image != pn: 209 if not pn.endswith(verity_image):
192 return # This doesn't concern this image 210 return # This doesn't concern this image
193 211
194 if len(verity_type.split()) != 1: 212 if len(verity_type.split()) != 1:
195 bb.fatal('DM_VERITY_IMAGE_TYPE must contain exactly one type') 213 bb.fatal('DM_VERITY_IMAGE_TYPE must contain exactly one type')
196 214
197 d.appendVar('IMAGE_FSTYPES', ' %s.verity' % verity_type)
198 if verity_hash == "1":
199 d.appendVar('IMAGE_FSTYPES', ' vhash')
200
201 # If we're using wic: we'll have to use partition images and not the rootfs 215 # If we're using wic: we'll have to use partition images and not the rootfs
202 # source plugin so add the appropriate dependency. 216 # source plugin so add the appropriate dependency.
203 if 'wic' in image_fstypes: 217 if 'wic' in image_fstypes: