stand: One more trivial consolidation (setting environment from howto)

This commit is contained in:
Kyle Evans 2018-06-09 15:52:29 +00:00
parent 28ee318d9c
commit 3db6d179e8
5 changed files with 15 additions and 14 deletions

View File

@ -174,6 +174,16 @@ bootenv_flags()
return (howto);
}
void
bootenv_set(int howto)
{
int i;
for (i = 0; howto_names[i].ev != NULL; i++)
if (howto & howto_names[i].mask)
setenv(howto_names[i].ev, "YES", 1);
}
static int
autoboot(int timeout, char *prompt)
{

View File

@ -64,6 +64,7 @@ int parse(int *argc, char ***argv, const char *str);
void autoboot_maybe(void);
int getrootmount(char *rootdev);
int bootenv_flags(void);
void bootenv_set(int);
/* misc.c */
char *unargv(int argc, char *argv[]);

View File

@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
#include <sys/disk.h>
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/boot.h>
#include <stdint.h>
#include <stand.h>
#include <string.h>
@ -549,9 +548,8 @@ main(int argc, CHAR16 *argv[])
}
}
}
for (i = 0; howto_names[i].ev != NULL; i++)
if (howto & howto_names[i].mask)
setenv(howto_names[i].ev, "YES", 1);
bootenv_set(howto);
/*
* XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables

View File

@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <sys/boot.h>
#include "bootstrap.h"
#include "libi386.h"
#include "btxv86.h"
@ -130,11 +129,8 @@ bi_getboothowto(char *kargs)
void
bi_setboothowto(int howto)
{
int i;
for (i = 0; howto_names[i].ev != NULL; i++)
if (howto & howto_names[i].mask)
setenv(howto_names[i].ev, "YES", 1);
bootenv_set(howto);
}
/*

View File

@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <sys/boot.h>
#include "bootstrap.h"
#include "libuserboot.h"
@ -131,11 +130,8 @@ bi_getboothowto(char *kargs)
void
bi_setboothowto(int howto)
{
int i;
for (i = 0; howto_names[i].ev != NULL; i++)
if (howto & howto_names[i].mask)
setenv(howto_names[i].ev, "YES", 1);
bootenv_set(howto);
}
/*