mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 12:20:00 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user