Add a new variable 'skipPCCARD'. This variable will cause sysinstall

to ignore all PC Card devices.

Submitted by: Anders Nordby
PR: bin/37650

MFC After: 2 weeks
This commit is contained in:
Warner Losh 2003-08-20 06:24:12 +00:00
parent 130112f793
commit 4cd54ca658
8 changed files with 26 additions and 2 deletions

View File

@ -1157,6 +1157,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE, 0);
variable_set2(VAR_INSTALL_ROOT, "/", 0);
variable_set2(VAR_INSTALL_CFG, "install.cfg", 0);
variable_set2(VAR_SKIP_PCCARD, "NO", 0);
cp = getenv("EDITOR");
if (!cp)
cp = "/usr/bin/ee";

View File

@ -112,7 +112,9 @@ main(int argc, char **argv)
/* Initialize PC-card, if we haven't already done so. */
#ifdef PCCARD_ARCH
if (!pvariable_get("pccardInitialize")) {
if (!variable_cmp(VAR_SKIP_PCCARD, "YES") &&
variable_get(VAR_SKIP_PCCARD)!=1 &&
!pvariable_get("pccardInitialize")) {
pccardInitialize();
pvariable_set("pccardInitialize=1");
}

View File

@ -194,6 +194,7 @@
#define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
#define VAR_TRY_DHCP "tryDHCP"
#define VAR_TRY_RTSOL "tryRTSOL"
#define VAR_SKIP_PCCARD "skipPCCARD"
#define VAR_UFS_PATH "ufs"
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"

View File

@ -1157,6 +1157,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE, 0);
variable_set2(VAR_INSTALL_ROOT, "/", 0);
variable_set2(VAR_INSTALL_CFG, "install.cfg", 0);
variable_set2(VAR_SKIP_PCCARD, "NO", 0);
cp = getenv("EDITOR");
if (!cp)
cp = "/usr/bin/ee";

View File

@ -112,7 +112,9 @@ main(int argc, char **argv)
/* Initialize PC-card, if we haven't already done so. */
#ifdef PCCARD_ARCH
if (!pvariable_get("pccardInitialize")) {
if (!variable_cmp(VAR_SKIP_PCCARD, "YES") &&
variable_get(VAR_SKIP_PCCARD)!=1 &&
!pvariable_get("pccardInitialize")) {
pccardInitialize();
pvariable_set("pccardInitialize=1");
}

View File

@ -92,6 +92,20 @@ moduleInitialize(void)
msgConfirm("Loading module %s failed", dp->d_name);
}
}
if (strcmp(dp->d_name + dp->d_namlen - (sizeof(".ko.gz") - 1), ".ko.gz") == 0) {
snprintf(module, sizeof(module), "/tmp/%s", dp->d_name);
module[strlen(module) - sizeof(".gz")] = '\0';
snprintf(desc, sizeof(desc), "zcat < %s/%s > %s", MODULESDIR,
dp->d_name, module);
system(desc);
if (kldload(module) < 0 && errno != EEXIST) {
if (desc_str[0])
msgConfirm("Loading module %s failed\n%s", dp->d_name, desc_str);
else
msgConfirm("Loading module %s failed", dp->d_name);
}
unlink(module);
}
}
closedir(dirp);
}

View File

@ -122,6 +122,8 @@ static Option Options[] = {
OPT_IS_VAR, NULL, VAR_TRY_DHCP, varCheck },
{ "IPv6", "Attempt IPv6 configuration of interfaces",
OPT_IS_VAR, NULL, VAR_TRY_RTSOL, varCheck },
{ "Skip PCCARD", "Skip PC-card probing, do not use PC-card devices for installation",
OPT_IS_VAR, NULL, VAR_SKIP_PCCARD, varCheck },
{ "FTP username", "Username and password to use instead of anonymous",
OPT_IS_FUNC, mediaSetFTPUserPass, VAR_FTP_USER, varCheck },
{ "Editor", "Which text editor to use during installation",

View File

@ -194,6 +194,7 @@
#define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
#define VAR_TRY_DHCP "tryDHCP"
#define VAR_TRY_RTSOL "tryRTSOL"
#define VAR_SKIP_PCCARD "skipPCCARD"
#define VAR_UFS_PATH "ufs"
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"