Mark all sizes in status and dump output in the correct units.

NOTE: This is possibly an incompatible change as it changes text output.

Since the support of --sector-size option, the description "sectors"
became ambiguous as it usually means 512-byte sectors (device-mapper unit).

Major confusion occurs when the sector size is 4096 bytes while units display
is in 512-bytes.

Unfortunately, there is no clear compatible way, so this patch adds
[512-byte units] marker and also additional byte size value.

All other fields that display units are changed to use the "[units]" format.

The integrity format is also unified with the common style with ':' as a separator.

Fixes: #884.
This commit is contained in:
Milan Broz
2024-12-02 16:11:43 +01:00
parent ea39aecba3
commit f8788f347e
11 changed files with 82 additions and 75 deletions

View File

@@ -742,7 +742,7 @@ int BITLK_dump(struct crypt_device *cd, struct device *device, struct bitlk_meta
log_std(cd, "Description: \t%s\n", params->description);
log_std(cd, "Cipher name: \t%s\n", params->cipher);
log_std(cd, "Cipher mode: \t%s\n", params->cipher_mode);
log_std(cd, "Cipher key: \t%u bits\n", params->key_size);
log_std(cd, "Cipher key: \t%u [bits]\n", params->key_size);
log_std(cd, "\n");