From bd7215d1eb74895103fb481d4b258419344e121b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 27 Jan 2025 05:26:59 +0000 Subject: util/nvmutil: show nvm words written on writeGbe Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 4eecebe6..98003795 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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; -- cgit v1.2.1