diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-09 02:23:22 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-09 02:23:22 +0000 |
| commit | aeb076b30e62c50b64ba4d100d0b54dd16abcacd (patch) | |
| tree | bcf834377c90354be36f4fa08e6dd78c955f8b29 | |
| parent | 0c64907a9eee975f60fd6b77a0c43365a089c846 (diff) | |
util/nvmutil: remove cmd_brick
this is an extremely dangerous feature, and serves
no purpose to the user.
this change is part of a series of extreme safety
improvements, part of a larger nvmutil audit.
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 13a4d9db..522bc82b 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -85,7 +85,6 @@ static void write_mac_part(size_t partnum); static void cmd_dump(void); static void print_mac_from_nvm(size_t partnum); static void hexdump(size_t partnum); -static void cmd_brick(void); static void write_gbe_file(void); static void override_part_modified(void); static void set_checksum(size_t part); @@ -201,7 +200,6 @@ enum { CMD_SETMAC, CMD_SWAP, CMD_COPY, - CMD_BRICK, }; /* @@ -282,15 +280,6 @@ static const struct commands command[] = { ARG_PART, CHECKSUM_READ, SKIP_CHECKSUM_WRITE, GBE_PART_SIZE }, - - /* - * The non-target part will not be read. - */ - { CMD_BRICK, "brick", cmd_brick, ARGC_4, - NO_INVERT, SET_MOD_OFF, - ARG_PART, - CHECKSUM_READ, SKIP_CHECKSUM_WRITE, - NVM_SIZE }, }; #define MAX_CMD_LEN 50 @@ -1036,13 +1025,6 @@ hexdump(size_t partnum) } static void -cmd_brick(void) -{ - uint16_t checksum_word = nvm_word(NVM_CHECKSUM_WORD, part); - set_nvm_word(NVM_CHECKSUM_WORD, part, checksum_word ^ 1); -} - -static void write_gbe_file(void) { size_t p; @@ -1342,10 +1324,8 @@ usage(uint8_t usage_exit) "\t%s FILE # same as setmac without [MAC]\n" "\t%s FILE setmac [MAC]\n" "\t%s FILE swap\n" - "\t%s FILE copy 0|1\n" - "\t%s FILE brick 0|1\n" - "\t%s FILE setchecksum 0|1\n", - util, util, util, util, util, util, util); + "\t%s FILE copy 0|1\n", + util, util, util, util, util); if (usage_exit) err(ECANCELED, "Too few arguments"); |
