util/nvmutil: remove the setchecksum command

This feature is extremely dangerous, and we should
discourage against its use.

This is part of a series of changes that I've made
to make the code safer. You should only ever run
this on a valid GbE file, and nothing else.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-09 02:19:24 +00:00
parent f7dfb0d265
commit 0c64907a9e

View File

@@ -202,7 +202,6 @@ enum {
CMD_SWAP,
CMD_COPY,
CMD_BRICK,
CMD_SETCHECKSUM
};
/*
@@ -249,6 +248,10 @@ struct commands {
* Command table, for nvmutil commands
*/
static const struct commands command[] = {
/*
* Unlike older versions, we now require
* both checksums to be valid for "dump".
*/
{ CMD_DUMP, "dump", cmd_dump, ARGC_3,
NO_INVERT, SET_MOD_OFF,
ARG_NOPART,
@@ -288,15 +291,6 @@ static const struct commands command[] = {
ARG_PART,
CHECKSUM_READ, SKIP_CHECKSUM_WRITE,
NVM_SIZE },
/*
* The non-target part will not be read.
*/
{ CMD_SETCHECKSUM, "setchecksum", NULL, ARGC_4,
NO_INVERT, SET_MOD_N,
ARG_PART,
SKIP_CHECKSUM_READ, CHECKSUM_WRITE,
NVM_SIZE },
};
#define MAX_CMD_LEN 50