Add a function driverFloppyCheck() that asks the user if they would like to

load drivers from the driver floppy if the "driver_floppy" variable is set
in the kernel environment and call this function after probing devices but
before displaying the main menu.

X-MFC after:	as soon as I finish committing to current
Approved by:	re@ (blanket)
This commit is contained in:
John Baldwin 2003-01-15 21:47:36 +00:00
parent 3df3bb12fb
commit 0a10e2868e
5 changed files with 24 additions and 0 deletions

View File

@ -127,6 +127,12 @@ main(int argc, char **argv)
/* Probe for all relevant devices on the system */
deviceGetAll();
/* Prompt for the driver floppy if appropriate. */
if (!pvariable_get("driverFloppyCheck")) {
driverFloppyCheck();
pvariable_set("driverFloppyCheck=1");
}
/* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */
if (!RunningAsInit) {
int i, start_arg;

View File

@ -757,6 +757,7 @@ extern void restorescr(WINDOW *w);
extern char *sstrncpy(char *dst, const char *src, int size);
/* modules.c */
extern void driverFloppyCheck(void);
extern void moduleInitialize(void);
extern int kldBrowser(dialogMenuItem *self);

View File

@ -127,6 +127,12 @@ main(int argc, char **argv)
/* Probe for all relevant devices on the system */
deviceGetAll();
/* Prompt for the driver floppy if appropriate. */
if (!pvariable_get("driverFloppyCheck")) {
driverFloppyCheck();
pvariable_set("driverFloppyCheck=1");
}
/* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */
if (!RunningAsInit) {
int i, start_arg;

View File

@ -36,6 +36,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <kenv.h>
/* Prototypes */
static int kldModuleFire(dialogMenuItem *self);
@ -96,6 +97,15 @@ moduleInitialize(void)
}
}
void
driverFloppyCheck(void)
{
/* Prompt for the driver floppy if requested. */
if (kenv(KENV_GET, "driver_floppy", NULL, 0) >= 0 &&
!msgYesNo("Would you like to load kernel modules from the driver floppy?"))
(void)kldBrowser(NULL);
}
int
kldBrowser(dialogMenuItem *self)
{

View File

@ -757,6 +757,7 @@ extern void restorescr(WINDOW *w);
extern char *sstrncpy(char *dst, const char *src, int size);
/* modules.c */
extern void driverFloppyCheck(void);
extern void moduleInitialize(void);
extern int kldBrowser(dialogMenuItem *self);