mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-20 07:10:08 +01:00
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:
@@ -126,7 +126,7 @@ static int reencrypt_get_active_name(struct crypt_device *cd, const char *data_d
|
||||
assert(cd);
|
||||
assert(r_active_name);
|
||||
|
||||
if (ARG_SET(OPT_INIT_ONLY_ID)) {
|
||||
if (ARG_SET(OPT_INIT_ONLY_ID) || ARG_SET(OPT_FORCE_OFFLINE_REENCRYPT_ID)) {
|
||||
*r_active_name = NULL;
|
||||
return 0;
|
||||
}
|
||||
@@ -870,6 +870,9 @@ static int reencrypt_luks2_resume(struct crypt_device *cd)
|
||||
.device = tools_get_device_name(crypt_get_device_name(cd), &backing_file)
|
||||
};
|
||||
|
||||
if (ARG_SET(OPT_FORCE_OFFLINE_REENCRYPT_ID) && !ARG_SET(OPT_BATCH_MODE_ID))
|
||||
log_std(_("Resuming LUKS reencryption in forced offline mode.\n"));
|
||||
|
||||
set_int_handler(0);
|
||||
r = crypt_reencrypt_run(cd, tools_progress, &prog_parms);
|
||||
free(backing_file);
|
||||
|
||||
Reference in New Issue
Block a user