mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 12:20:00 +01:00
Make resize action accept --device-size parameter (supports units).
Fixes #368.
This commit is contained in:
committed by
Milan Broz
parent
ecb898c7ff
commit
8b959158e3
@@ -659,6 +659,9 @@ static int action_resize(void)
|
||||
crypt_safe_free(password);
|
||||
}
|
||||
|
||||
if (opt_device_size)
|
||||
opt_size = opt_device_size / SECTOR_SIZE;
|
||||
|
||||
if (r >= 0)
|
||||
r = crypt_resize(cd, action_argv[0], opt_size);
|
||||
out:
|
||||
@@ -3827,6 +3830,10 @@ int main(int argc, const char **argv)
|
||||
usage(popt_context, EXIT_FAILURE, _("Options --reduce-device-size and --data-size cannot be combined."),
|
||||
poptGetInvocationName(popt_context));
|
||||
|
||||
if (opt_device_size && opt_size)
|
||||
usage(popt_context, EXIT_FAILURE, _("Options --device-size and --size cannot be combined."),
|
||||
poptGetInvocationName(popt_context));
|
||||
|
||||
r = run_action(action);
|
||||
poptFreeContext(popt_context);
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user