Skip to content

veritysetup: print hash blocks and the final device size in header dump

Figuring out the size of the block device is not obvious. It's useful to print information about hash blocks, and the final device size.

If FEC blocks are located on the same device, an effort it made to print the total size, but afaics, some metadata is not available from struct crypt_device.

$ build/veritysetup format img img.hash --data-block-size 512
VERITY header information for img.hash
UUID:             	44195a7b-0dcb-45a5-adc4-669ea5f7518a
Hash type:        	1
Data blocks:      	262144
Data block size:  	512
Hash blocks:      	2065
Hash block size:  	4096
Hash algorithm:   	sha256
Hash device size: 	8462336
Salt:            	65e28b7e073e9ac87082926e4bb2306971736aef21bb76ece4af2db9ef522250
Root hash:      	b9433242b96dae71b832ab05a01a703a1440690b2ac69bd8f2c7e71f0310496a

$ ls -l img.hash
-rw------- 1 zbyszek zbyszek 8462336 Aug  3 09:24 img.hash

Merge request reports