summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-01-08 18:01:01 +0000
committerErik Troan <ewt@redhat.com>2001-01-08 18:01:01 +0000
commit5dd5685427b0a183509c2642bca6d7d1b321d890 (patch)
treef267c8c6dfd588e84da9f874e8dbc5d842956e5c /loader
parent487b89a11eae5cd5ceb5e7a54b9891120bb49669 (diff)
downloadanaconda-5dd5685427b0a183509c2642bca6d7d1b321d890.tar.gz
anaconda-5dd5685427b0a183509c2642bca6d7d1b321d890.tar.xz
anaconda-5dd5685427b0a183509c2642bca6d7d1b321d890.zip
1) use yenta_socket sometimes
2) pass --pcic to anaconda
Diffstat (limited to 'loader')
-rw-r--r--loader/loader.c10
-rw-r--r--loader/pcmcia.c81
-rw-r--r--loader/pcmcia.h5
3 files changed, 59 insertions, 37 deletions
diff --git a/loader/loader.c b/loader/loader.c
index c0ae4198d..75206a792 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2465,7 +2465,7 @@ static void ideSetup(moduleList modLoaded, moduleDeps modDeps,
int main(int argc, char ** argv) {
char ** argptr;
- char * anacondaArgs[40];
+ char * anacondaArgs[50];
char * arg, * url = NULL;
poptContext optCon;
int probeOnly = 0;
@@ -2482,6 +2482,7 @@ int main(int argc, char ** argv) {
struct knownDevices kd;
moduleInfoSet modInfo;
char * where;
+ char pcic[20] = "";
struct moduleInfo * mi;
char twelve = 12;
char * ksFile = NULL, * ksSource = NULL;
@@ -2597,7 +2598,7 @@ int main(int argc, char ** argv) {
startNewt(flags);
if (!continuing) {
- startPcmcia(floppyDevice, modLoaded, modDeps, modInfo, flags);
+ startPcmcia(floppyDevice, modLoaded, modDeps, modInfo, pcic, flags);
}
#endif
@@ -2861,6 +2862,11 @@ int main(int argc, char ** argv) {
*argptr++ = instClass;
}
+ if (pcic[0]) {
+ *argptr++ = "--pcic";
+ *argptr++ = pcic;
+ }
+
for (i = 0; i < modLoaded->numModules; i++) {
if (!modLoaded->mods[i].path) continue;
diff --git a/loader/pcmcia.c b/loader/pcmcia.c
index 71ada0ac3..255e6eaae 100644
--- a/loader/pcmcia.c
+++ b/loader/pcmcia.c
@@ -1,4 +1,5 @@
#include <fcntl.h>
+#include <kudzu/kudzu.h>
#include <newt.h>
#include <stdlib.h>
#include <string.h>
@@ -17,9 +18,10 @@
int probe_main (int argc, char ** argv);
int cardmgr_main (int argc, char ** argv);
-int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo, int flags) {
+int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps,
+ moduleInfoSet modInfo, char * pcicPtr, int flags) {
pid_t child;
+ struct device ** devices, ** device;
char * probeArgs[] = { "/sbin/probe", NULL };
char * cardmgrArgs[] = { "/sbin/cardmgr", "-o", "-m", "/modules", "-d",
NULL };
@@ -34,40 +36,51 @@ int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps,
logMessage("in startPcmcia()");
- pipe(p);
+ devices = probeDevices(CLASS_SOCKET, BUS_PCI, PROBE_ALL);
+ if (devices) {
+ logMessage("found cardbus pci adapter");
+ pcic = "yenta_socket";
- if (!(child = fork())) {
- close(p[0]);
- dup2(p[1], 1);
- close(p[1]);
- exit(probe_main(1, probeArgs));
- }
+ for (device = devices; *device; device++)
+ freeDevice(*device);
- close(p[1]);
-
- waitpid(child, NULL, 0);
-
- i = read(p[0], buf, sizeof(buf));
- close(p[0]);
- buf[i] = '\0';
-
- logMessage("pcmcia probe returned: |%s|", buf);
-
- /* So this is totally counter-intuitive. Just remember that probe
- stops printing output once it finds a pcic, so this is actually
- correct */
-
- line = strtok(buf, "\r\n");
-
- do {
- if (!strstr(line, "not found"))
- {
- if (strstr(line, "TCIC"))
- pcic = "tcic";
- else
- pcic = "i82365";
+ free(devices);
+ } else {
+ pipe(p);
+
+ if (!(child = fork())) {
+ close(p[0]);
+ dup2(p[1], 1);
+ close(p[1]);
+ exit(probe_main(1, probeArgs));
}
- } while((line = strtok(NULL, "\r\n")));
+
+ close(p[1]);
+
+ waitpid(child, NULL, 0);
+
+ i = read(p[0], buf, sizeof(buf));
+ close(p[0]);
+ buf[i] = '\0';
+
+ logMessage("pcmcia probe returned: |%s|", buf);
+
+ /* So this is totally counter-intuitive. Just remember that probe
+ stops printing output once it finds a pcic, so this is actually
+ correct */
+
+ line = strtok(buf, "\r\n");
+
+ do {
+ if (!strstr(line, "not found"))
+ {
+ if (strstr(line, "TCIC"))
+ pcic = "tcic";
+ else
+ pcic = "i82365";
+ }
+ } while((line = strtok(NULL, "\r\n")));
+ }
if (!pcic)
{
@@ -157,6 +170,8 @@ int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps,
newtPopWindow();
umount("/modules");
+
+ strcpy(pcicPtr, pcic);
return 0;
}
diff --git a/loader/pcmcia.h b/loader/pcmcia.h
index 6ca3015e8..8c05224bf 100644
--- a/loader/pcmcia.h
+++ b/loader/pcmcia.h
@@ -1,7 +1,8 @@
#ifndef H_LOADER_PCMCIA
#define H_LOADER_PCMCIA
-int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo, int flags);
+/* pcic should point to a space 20 characters long */
+int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps,
+ moduleInfoSet modInfo, char * pcic, int flags);
#endif