Introduce crypt_init_data_device and crypt_get_metadata_device_name.

For some formats we need to separate metadata and data device before
format is called.
This commit is contained in:
Milan Broz
2018-11-07 16:31:39 +01:00
parent ce60fe04cb
commit 0fed68dd16
8 changed files with 172 additions and 45 deletions

View File

@@ -1130,7 +1130,7 @@ static int action_open_luks(void)
activated_name = opt_test_passphrase ? NULL : action_argv[1];
if ((r = crypt_init(&cd, header_device)))
if ((r = crypt_init_data_device(&cd, header_device, data_device)))
goto out;
if ((r = crypt_load(cd, luksType(opt_type), NULL))) {
@@ -1139,10 +1139,6 @@ static int action_open_luks(void)
goto out;
}
if (data_device &&
(r = crypt_set_data_device(cd, data_device)))
goto out;
if (!data_device && (crypt_get_data_offset(cd) < 8)) {
log_err(_("Reduced data offset is allowed only for detached LUKS header."));
r = -EINVAL;