Merging upstream version 2.12.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
078c0dbcc0
commit
635faa7346
571 changed files with 10718 additions and 2738 deletions
|
@ -23,6 +23,12 @@ OPT_ARGS(no_opts) = {
|
|||
OPT_END()
|
||||
};
|
||||
|
||||
OPT_ARGS(init_opts) = {
|
||||
OPT_FLAG("read-only", 'r', &sedopal_lock_ro,
|
||||
"Set locking range to read-only"),
|
||||
OPT_END()
|
||||
};
|
||||
|
||||
OPT_ARGS(key_opts) = {
|
||||
OPT_FLAG("ask-key", 'k', &sedopal_ask_key,
|
||||
"prompt for SED authentication key"),
|
||||
|
@ -36,6 +42,21 @@ OPT_ARGS(revert_opts) = {
|
|||
OPT_END()
|
||||
};
|
||||
|
||||
OPT_ARGS(lock_opts) = {
|
||||
OPT_FLAG("read-only", 'r', &sedopal_lock_ro,
|
||||
"Set locking range to read-only"),
|
||||
OPT_FLAG("ask-key", 'k', &sedopal_ask_key,
|
||||
"prompt for SED authentication key"),
|
||||
OPT_END()
|
||||
};
|
||||
|
||||
OPT_ARGS(discovery_opts) = {
|
||||
OPT_FLAG("verbose", 'v', &sedopal_discovery_verbose,
|
||||
"Print extended discovery information"),
|
||||
OPT_FLAG("udev", 'u', &sedopal_discovery_udev,
|
||||
"Print locking information in form suitable for udev rules"),
|
||||
OPT_END()
|
||||
};
|
||||
|
||||
/*
|
||||
* Open the NVMe device specified on the command line. It must be the
|
||||
|
@ -67,7 +88,7 @@ static int sed_opal_discover(int argc, char **argv, struct command *cmd,
|
|||
const char *desc = "Query SED device and display locking features";
|
||||
struct nvme_dev *dev;
|
||||
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, no_opts);
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, discovery_opts);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@ -84,12 +105,12 @@ static int sed_opal_initialize(int argc, char **argv, struct command *cmd,
|
|||
const char *desc = "Initialize a SED device for locking";
|
||||
struct nvme_dev *dev;
|
||||
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, no_opts);
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, init_opts);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = sedopal_cmd_initialize(dev->direct.fd);
|
||||
if (err != 0)
|
||||
if ((err != 0) && (err != -EOPNOTSUPP))
|
||||
fprintf(stderr, "initialize: SED error - %s\n",
|
||||
sedopal_error_to_text(err));
|
||||
|
||||
|
@ -109,7 +130,7 @@ static int sed_opal_revert(int argc, char **argv, struct command *cmd,
|
|||
return err;
|
||||
|
||||
err = sedopal_cmd_revert(dev->direct.fd);
|
||||
if (err != 0)
|
||||
if ((err != 0) && (err != -EOPNOTSUPP))
|
||||
fprintf(stderr, "revert: SED error - %s\n",
|
||||
sedopal_error_to_text(err));
|
||||
|
||||
|
@ -124,12 +145,12 @@ static int sed_opal_lock(int argc, char **argv, struct command *cmd,
|
|||
const char *desc = "Lock a SED device";
|
||||
struct nvme_dev *dev;
|
||||
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, key_opts);
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, lock_opts);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = sedopal_cmd_lock(dev->direct.fd);
|
||||
if (err != 0)
|
||||
if ((err != 0) && (err != -EOPNOTSUPP))
|
||||
fprintf(stderr, "lock: SED error - %s\n",
|
||||
sedopal_error_to_text(err));
|
||||
|
||||
|
@ -144,12 +165,12 @@ static int sed_opal_unlock(int argc, char **argv, struct command *cmd,
|
|||
const char *desc = "Unlock a SED device";
|
||||
struct nvme_dev *dev;
|
||||
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, key_opts);
|
||||
err = sed_opal_open_device(&dev, argc, argv, desc, lock_opts);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = sedopal_cmd_unlock(dev->direct.fd);
|
||||
if (err != 0)
|
||||
if ((err != 0) && (err != -EOPNOTSUPP))
|
||||
fprintf(stderr, "unlock: SED error - %s\n",
|
||||
sedopal_error_to_text(err));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue