Add --force-offline-reencrypt option.

It can be used to enforce offline reencryption
in batch mode when data_device is regular file
and therefore cryptsetup cannot detect properly
active device dm name.

Also it may be useful when active device
auto-detection fails for some reason and user
has no other choice but inspect device holders
manually.
This commit is contained in:
Ondrej Kozina
2022-04-06 19:09:10 +02:00
parent 496a0e37c4
commit 31c4afbc17
7 changed files with 23 additions and 35 deletions

View File

@@ -2787,6 +2787,9 @@ static const char *verify_reencrypt(void)
if (isLUKS1(luksType(device_type)) && ARG_SET(OPT_ACTIVE_NAME_ID))
return _("Option --active-name can be set only for LUKS2 device.");
if (ARG_SET(OPT_ACTIVE_NAME_ID) && ARG_SET(OPT_FORCE_OFFLINE_REENCRYPT_ID))
return _("Options --active-name and --force-offline-reencrypt cannot be combined.");
return NULL;
}