util/nvmutil: show nvm words written on writeGbe

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2025-01-27 05:26:59 +00:00
parent 38bb650f12
commit 7849f23f81
1 changed files with 11 additions and 0 deletions

View File

@ -331,6 +331,10 @@ void
cmd_dump(void)
{
for (int partnum = 0, numInvalid = 0; partnum < 2; partnum++) {
if ((cmd != cmd_dump) && (flags != O_RDONLY) &&
(!nvmPartChanged[partnum]))
continue;
if (!goodChecksum(partnum))
++numInvalid;
printf("MAC (part %d): ", partnum);
@ -437,6 +441,13 @@ writeGbe(void)
{
ssize_t tnw = 0; /* total bytes written */
if ((flags != O_RDONLY) && (cmd != cmd_dump)) {
if (nvmPartChanged[0] || nvmPartChanged[1])
printf("The following nvm words will be written:\n");
cmd_dump();
errno = 0; /* reset for cmd_brick */
}
for (int p = 0; p < 2; p++) {
if ((!nvmPartChanged[p]) || (flags == O_RDONLY))
continue;