diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-08 15:20:26 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-08 15:20:26 +0000 |
| commit | 74224e3dc61a6fb91e556b33f7ccbfdf5e0af46d (patch) | |
| tree | 8d5716a19f0e0a2d74a6a53a12b8bbe02afa63ed /util | |
| parent | 08de8d98e90ce25e2e525cd8462ab420d82b26dc (diff) | |
util/nvmutil: print rmac method in setmac
get it out of main(), it's bloat there
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 7095246a..369ae8c2 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -270,18 +270,13 @@ main(int argc, char *argv[]) } #endif -#ifdef HAVE_ARC4RANDOM_BUF - if (cmd_index == CMD_SETMAC) - printf("Randomisation method: arc4random_buf\n"); -#else -#if defined(__OpenBSD__) || defined(__FreeBSD__) || \ +#ifndef HAVE_ARC4RANDOM_BUF + open_dev_urandom(); +#elif defined(__OpenBSD__) || defined(__FreeBSD__) || \ defined(__NetBSD__) || defined(__APPLE__) || \ defined(__DragonFly__) err(ECANCELED, "Maintainer error: arc4random disabled on BSD/MacOS"); #endif - if (cmd_index == CMD_SETMAC) - open_dev_urandom(); -#endif open_gbe_file(); @@ -505,8 +500,6 @@ open_dev_urandom(void) { struct stat st_urandom_fd; - printf("Randomisation method: %s\n", newrandom); - /* * Try /dev/urandom first */ @@ -598,6 +591,12 @@ cmd_setmac(void) size_t partnum; uint8_t mac_updated = 0; + #ifdef HAVE_ARC4RANDOM_BUF + printf("Randomisation method: arc4random_buf\n"); + #else + printf("Randomisation method: %s\n", rname); + #endif + printf("MAC address to be written: %s\n", mac_str); parse_mac_string(); |
