diff options
author | Erik Troan <ewt@redhat.com> | 2000-05-09 16:53:34 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2000-05-09 16:53:34 +0000 |
commit | b605b985cebd1c3de35d1de364a6e0abfeaaff4c (patch) | |
tree | db57147b21a009740d2523086183aad8034d1ed7 | |
parent | 39cebd1dd0360319d5a2a73411773bba74ba8d7a (diff) | |
download | anaconda-b605b985cebd1c3de35d1de364a6e0abfeaaff4c.tar.gz anaconda-b605b985cebd1c3de35d1de364a6e0abfeaaff4c.tar.xz anaconda-b605b985cebd1c3de35d1de364a6e0abfeaaff4c.zip |
use device code tags to let us write ONBOOT=no for pcmcia devices
-rw-r--r-- | loader/cdrom.c | 2 | ||||
-rw-r--r-- | loader/loader.c | 30 | ||||
-rw-r--r-- | loader/loader.h | 3 | ||||
-rw-r--r-- | loader/net.c | 14 | ||||
-rw-r--r-- | loader/net.h | 4 |
5 files changed, 35 insertions, 18 deletions
diff --git a/loader/cdrom.c b/loader/cdrom.c index e4470c651..a71a06fac 100644 --- a/loader/cdrom.c +++ b/loader/cdrom.c @@ -59,7 +59,7 @@ int setupCDdevice(struct knownDevices * kd, moduleInfoSet modInfo, rc = devDeviceMenu(DRIVER_SCSI, modInfo, modLoaded, modDepsPtr, flags, NULL); if (!rc) { - kdFindScsiList(kd); + kdFindScsiList(kd, 0); /* we'll get called again if the scsi bus doesn't have a CDROM drive on it */ done = 1; diff --git a/loader/loader.c b/loader/loader.c index 266a63e12..0de0e3e4a 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -383,8 +383,8 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, } } - kdFindScsiList(kd); - kdFindNetList(kd); + kdFindScsiList(kd, 0); + kdFindNetList(kd, 0); } else logMessage("found nothing"); } @@ -621,7 +621,7 @@ static char * mountHardDrive(struct installMethod * method, devDeviceMenu(DRIVER_SCSI, modInfo, modLoaded, modDepsPtr, flags, NULL); - kdFindScsiList(kd); + kdFindScsiList(kd, 0); continue; } @@ -690,7 +690,7 @@ static char * mountHardDrive(struct installMethod * method, } else if (es.reason == NEWT_EXIT_HOTKEY && es.u.key == NEWT_KEY_F2) { devDeviceMenu(DRIVER_SCSI, modInfo, modLoaded, modDepsPtr, flags, NULL); - kdFindScsiList(kd); + kdFindScsiList(kd, 0); continue; } @@ -828,7 +828,7 @@ static int ensureNetDevice(struct knownDevices * kd, rc = devDeviceMenu(DRIVER_NET, modInfo, modLoaded, modDepsPtr, flags, NULL); if (rc) return rc; - kdFindNetList(kd); + kdFindNetList(kd, 0); } devices = alloca((kd->numKnown + 1) * sizeof(*devices)); @@ -944,7 +944,7 @@ static char * mountNfsImage(struct installMethod * method, } } - writeNetInfo("/tmp/netinfo", &netDev); + writeNetInfo("/tmp/netinfo", &netDev, kd); free(host); free(dir); @@ -1069,7 +1069,7 @@ static char * mountUrlImage(struct installMethod * method, ui.protocol == URL_METHOD_FTP ? "ftp" : "http", login, ui.address, ui.prefix); - writeNetInfo("/tmp/netinfo", &netDev); + writeNetInfo("/tmp/netinfo", &netDev, kd); return url; } @@ -1349,8 +1349,8 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo, logMessage("module %s inserted successfully", device); } - kdFindScsiList(kd); - kdFindNetList(kd); + kdFindScsiList(kd, 0); + kdFindNetList(kd, 0); return 0; } @@ -1470,7 +1470,7 @@ static char * setupKickstart(char * location, struct knownDevices * kd, if (ksType == KS_CMD_NFS || ksType == KS_CMD_URL) { startNewt(flags); if (kickstartNetwork(&netDevice, &netDev, NULL, flags)) return NULL; - writeNetInfo("/tmp/netinfo", &netDev); + writeNetInfo("/tmp/netinfo", &netDev, kd); } #endif @@ -1709,7 +1709,7 @@ int kickstartFromNfs(struct knownDevices * kd, char * location, return 1; } - writeNetInfo("/tmp/netinfo", &netDev); + writeNetInfo("/tmp/netinfo", &netDev, kd); if (!(netDev.dev.set & PUMP_INTFINFO_HAS_NEXTSERVER)) { logMessage("no bootserver was found"); @@ -2113,14 +2113,14 @@ int main(int argc, char ** argv) { if (!continuing) { winStatus(40, 3, _("PC Card"), _("Initializing PC Card Devices...")); - startPcmcia(modLoaded, &modDeps, modInfo, flags); + startPcmcia(modLoaded, modDeps, modInfo, flags); newtPopWindow(); } #endif - kdFindIdeList(&kd); - kdFindScsiList(&kd); - kdFindNetList(&kd); + kdFindIdeList(&kd, CODE_PCMCIA); + kdFindScsiList(&kd, CODE_PCMCIA); + kdFindNetList(&kd, CODE_PCMCIA); if (!continuing) { if (((access("/proc/bus/pci/devices", X_OK) && diff --git a/loader/loader.h b/loader/loader.h index 1d16a608b..32d3e4ab5 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -36,3 +36,6 @@ #define FL_KSCDROM(a) ((a) & LOADER_FLAGS_KSCDROM) #define FL_MCHECK(a) ((a) & LOADER_FLAGS_MCHECK) #define FL_KSNFS(a) ((a) & LOADER_FLAGS_KSNFS) + +#define CODE_PCMCIA 1 + diff --git a/loader/net.c b/loader/net.c index 0fb2b0fe1..33c1fa9d3 100644 --- a/loader/net.c +++ b/loader/net.c @@ -430,12 +430,23 @@ int configureNetwork(struct networkDeviceConfig * dev) { return 0; } -int writeNetInfo(const char * fn, struct networkDeviceConfig * dev) { +int writeNetInfo(const char * fn, struct networkDeviceConfig * dev, + struct knownDevices * kd) { FILE * f; + int i; + + for (i = 0; i < kd->numKnown; i++) + if (!strcmp(kd->known[i].name, fn)) break; if (!(f = fopen(fn, "w"))) return -1; fprintf(f, "DEVICE=%s\n", dev->dev.device); + + if (i < kd->numKnown && kd->known[i].code == CODE_PCMCIA) + fprintf(f, "ONBOOT=no\n"); + else + fprintf(f, "ONBOOT=yes\n"); + if (dev->isDynamic) { fprintf(f, "BOOTPROTO=dhcp\n"); } else { @@ -445,6 +456,7 @@ int writeNetInfo(const char * fn, struct networkDeviceConfig * dev) { if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY) fprintf(f, "GATEWAY=%s\n", inet_ntoa(dev->dev.gateway)); } + if (dev->dev.set & PUMP_NETINFO_HAS_HOSTNAME) fprintf(f, "HOSTNAME=%s\n", dev->dev.hostname); if (dev->dev.set & PUMP_NETINFO_HAS_DOMAIN) diff --git a/loader/net.h b/loader/net.h index 0f078bac1..a117fae7c 100644 --- a/loader/net.h +++ b/loader/net.h @@ -1,6 +1,7 @@ #ifndef H_LOADER_NET #define H_LOADER_NET +#include "../isys/probe.h" #include "pump.h" struct networkDeviceConfig { @@ -11,7 +12,8 @@ struct networkDeviceConfig { int readNetConfig(char * device, struct networkDeviceConfig * dev, int flags); int configureNetwork(struct networkDeviceConfig * dev); -int writeNetInfo(const char * fn, struct networkDeviceConfig * dev); +int writeNetInfo(const char * fn, struct networkDeviceConfig * dev, + struct knownDevices * kd); int findHostAndDomain(struct networkDeviceConfig * dev, int flags); int writeResolvConf(struct networkDeviceConfig * net); #ifndef __STANDALONE__ |