util/nvmutil: verbosely print the written MAC

This is for user friendliness. Otherwise, many users
might try to dump afterward if they specified a random
MAC address.

This saves the user from having to re-run with the dump
command, thus saving time for the user.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2025-01-27 05:36:25 +00:00
parent bbdd985bea
commit 5540713d16
1 changed files with 5 additions and 0 deletions

View File

@ -249,6 +249,8 @@ cmd_setmac(void)
int mac_updated = 0;
parseMacString(strMac, mac);
printf("MAC address to be written: %s\n", strMac);
for (int partnum = 0; partnum < 2; partnum++) {
if (!goodChecksum(part = partnum))
continue;
@ -257,6 +259,9 @@ cmd_setmac(void)
for (int w = 0; w < 3; w++) /* write MAC to gbe part */
setWord(w, partnum, mac[w]);
printf("Wrote MAC address to part %d: ", partnum);
macf(partnum);
cmd_setchecksum(); /* MAC updated; need valid checksum */
}