util/nvmutil: print mac before setting

this way, if a user does e.g.

./nvm gbe.bin bullshit

It will say: bullshit

Right now, it just says invalid length. This
means if the user wanted to type e.g.

./nvm gbe.bin copy 0

but they typed:

./nvm gbe.bin coyp 0

Now it will tell them that it's trying
to set the MAC address "coyp".

This is because if an invalid command is given,
it's treated as a MAC address instead. This is
by design, to allow e.g.

./nvm gbe.bin xx:1x:1x:xx:xx:xx

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-08 00:56:56 +00:00
parent 698d39dd06
commit 6203f3ae61

View File

@@ -462,8 +462,8 @@ cmd_setmac(void)
size_t partnum;
uint8_t mac_updated = 0;
parse_mac_string();
printf("MAC address to be written: %s\n", mac_str);
parse_mac_string();
for (partnum = 0; partnum < 2; partnum++)
mac_updated |= write_mac_part(partnum);