mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 04:22:15 +02:00
util/nvmutil: print rmac method in setmac
get it out of main(), it's bloat there Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+9
-10
@@ -270,18 +270,13 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ARC4RANDOM_BUF
|
#ifndef HAVE_ARC4RANDOM_BUF
|
||||||
if (cmd_index == CMD_SETMAC)
|
open_dev_urandom();
|
||||||
printf("Randomisation method: arc4random_buf\n");
|
#elif defined(__OpenBSD__) || defined(__FreeBSD__) || \
|
||||||
#else
|
|
||||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || \
|
|
||||||
defined(__NetBSD__) || defined(__APPLE__) || \
|
defined(__NetBSD__) || defined(__APPLE__) || \
|
||||||
defined(__DragonFly__)
|
defined(__DragonFly__)
|
||||||
err(ECANCELED, "Maintainer error: arc4random disabled on BSD/MacOS");
|
err(ECANCELED, "Maintainer error: arc4random disabled on BSD/MacOS");
|
||||||
#endif
|
#endif
|
||||||
if (cmd_index == CMD_SETMAC)
|
|
||||||
open_dev_urandom();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
open_gbe_file();
|
open_gbe_file();
|
||||||
|
|
||||||
@@ -505,8 +500,6 @@ open_dev_urandom(void)
|
|||||||
{
|
{
|
||||||
struct stat st_urandom_fd;
|
struct stat st_urandom_fd;
|
||||||
|
|
||||||
printf("Randomisation method: %s\n", newrandom);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try /dev/urandom first
|
* Try /dev/urandom first
|
||||||
*/
|
*/
|
||||||
@@ -598,6 +591,12 @@ cmd_setmac(void)
|
|||||||
size_t partnum;
|
size_t partnum;
|
||||||
uint8_t mac_updated = 0;
|
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);
|
printf("MAC address to be written: %s\n", mac_str);
|
||||||
parse_mac_string();
|
parse_mac_string();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user