luks: Show the JSON information for LUKSv2

Extract the full information for version 2, which is JSON format. Show
this with the 'luks info' command.

Use the mmc12 disk to check this.

Require the JSON for LUKS.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-23 13:22:56 +01:00
parent eb2ae89f55
commit 22826bf21f
4 changed files with 165 additions and 6 deletions

View File

@@ -106,6 +106,35 @@ Display LUKS header information for a LUKS2 partition::
Label:
Checksum alg: sha256
JSON metadata (12288 bytes):
{
"keyslots": {
"0": {
"type": "luks2",
"key_size": 64,
"kdf": {
"type": "argon2id",
"time": 6,
"memory": 1048576,
"cpus": 4,
...
},
...
}
},
"tokens": {},
"segments": {
"0": {
"type": "crypt",
"offset": "16777216",
"encryption": "aes-xts-plain64",
...
}
},
"digests": { ... },
"config": { ... }
}
Display LUKS header information for a LUKS1 partition::
=> luks info mmc 1:1