mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-21 19:26:22 +02:00
util/nvmutil: allow ./nvm gbe MAC
previously, if the user ran: ./nvm GBE [MAC address] it would error, treating the MAC as a command now if only 3 arguments are provided, and the 3rd argument ins't a valid command, it's treated as a MAC address and validated accordingly. this should make nvmutil easier to use, because I imagine a lot of users forget to use setmac there's no reason we should be so pedantic. we should allow it to be used flexibly like this Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -149,7 +149,10 @@ main(int argc, char *argv[])
|
|||||||
cmd = cmd_setmac;
|
cmd = cmd_setmac;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd == cmd_setmac) {
|
if ((cmd == NULL) && (argc > 2)) { /* nvm gbe [MAC] */
|
||||||
|
strMac = COMMAND;
|
||||||
|
cmd = cmd_setmac;
|
||||||
|
} else if (cmd == cmd_setmac) { /* nvm gbe setmac [MAC] */
|
||||||
strMac = strRMac; /* random MAC */
|
strMac = strRMac; /* random MAC */
|
||||||
if (argc > 3) /* user-supplied MAC (can be random) */
|
if (argc > 3) /* user-supplied MAC (can be random) */
|
||||||
strMac = MAC_ADDRESS;
|
strMac = MAC_ADDRESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user