summaryrefslogtreecommitdiffstats
path: root/loader2/driverselect.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-01-03 06:47:00 +0000
committerJeremy Katz <katzj@redhat.com>2003-01-03 06:47:00 +0000
commitbd6b73ddd298f271507e0c429c417bb37f74feca (patch)
tree8f95a7cfb1a74066c42ae64665a14f043398020d /loader2/driverselect.c
parent88d9465be1285f32b628a5b677688a0476b93698 (diff)
downloadanaconda-bd6b73ddd298f271507e0c429c417bb37f74feca.tar.gz
anaconda-bd6b73ddd298f271507e0c429c417bb37f74feca.tar.xz
anaconda-bd6b73ddd298f271507e0c429c417bb37f74feca.zip
if you get to manual device selectoin and don't have any devices of
the required type, we now ask if you want to load a driver disk. (#80222) also fix the load driver from driver disk action for the manual driver selection screen
Diffstat (limited to 'loader2/driverselect.c')
-rw-r--r--loader2/driverselect.c66
1 files changed, 42 insertions, 24 deletions
diff --git a/loader2/driverselect.c b/loader2/driverselect.c
index 9e3564af9..9e88b8da3 100644
--- a/loader2/driverselect.c
+++ b/loader2/driverselect.c
@@ -28,6 +28,7 @@
#include "log.h"
#include "lang.h"
#include "hardware.h"
+#include "driverdisk.h"
struct sortModuleList {
int index;
@@ -139,14 +140,17 @@ static int getManualModuleArgs(struct moduleInfo * mod, char *** moduleArgs) {
return LOADER_OK;
}
-int chooseManualDriver(int class, moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo, struct knownDevices * kd,
- int flags) {
+int chooseManualDriver(int class, moduleList modLoaded,
+ moduleDeps * modDepsPtr, moduleInfoSet modInfo,
+ struct knownDevices * kd, int flags) {
int i, numSorted, num = 0, done = 0;
enum driverMajor type;
struct sortModuleList * sortedOrder;
char giveArgs = ' ';
char ** moduleArgs = NULL;
+ moduleDeps modDeps;
+
+ modDeps = *modDepsPtr;
newtComponent text, f, ok, back, argcheckbox, listbox;
newtGrid grid, buttons;
@@ -165,24 +169,35 @@ int chooseManualDriver(int class, moduleList modLoaded, moduleDeps modDeps,
return LOADER_ERROR;
}
- sortedOrder = malloc(sizeof(*sortedOrder) * modInfo->numModules);
- numSorted = 0;
-
- for (i = 0; i < modInfo->numModules; i++) {
- if (mlModuleInList(modInfo->moduleList[i].moduleName, modLoaded) ||
- !modInfo->moduleList[i].description ||
- ((type >= 0) && (type != modInfo->moduleList[i].major)))
+ do {
+ sortedOrder = malloc(sizeof(*sortedOrder) * modInfo->numModules);
+ numSorted = 0;
+
+ for (i = 0; i < modInfo->numModules; i++) {
+ if (mlModuleInList(modInfo->moduleList[i].moduleName, modLoaded) ||
+ !modInfo->moduleList[i].description ||
+ ((type >= 0) && (type != modInfo->moduleList[i].major)))
+ continue;
+ sortedOrder[numSorted].index = i;
+ sortedOrder[numSorted++].modInfo = modInfo;
+ }
+
+ if (numSorted == 0) {
+ i = newtWinChoice(_("No drivers found"), _("Load driver disk"),
+ _("Back"), _("No drivers were found to manually "
+ "insert. Would you like to use "
+ "a driver disk?"));
+ if (i != 1)
+ return LOADER_BACK;
+
+ loadDriverFromMedia(class, modLoaded, modDepsPtr, modInfo, kd,
+ flags, 1);
continue;
- sortedOrder[numSorted].index = i;
- sortedOrder[numSorted++].modInfo = modInfo;
- }
-
- if (numSorted == 0) {
- /* JKFIXME: if no drivers to load, should we ask about driver disk? */
- logMessage("no drivers to load");
- return LOADER_BACK;
- }
-
+ } else {
+ break;
+ }
+ } while (1);
+
qsort(sortedOrder, numSorted, sizeof(*sortedOrder), sortDrivers);
f = newtForm(NULL, NULL, 0);
@@ -228,9 +243,7 @@ int chooseManualDriver(int class, moduleList modLoaded, moduleDeps modDeps,
if (es.reason == NEWT_EXIT_COMPONENT && es.u.co == back) {
done = -1;
} else if (es.reason == NEWT_EXIT_HOTKEY && es.u.key == NEWT_KEY_F2) {
- logMessage("need to go to load a driver disk here");
- /* JKFIXME: ^^^ */
- done = -1;
+ done = -2;
} else {
if (giveArgs != ' ') {
i = getManualModuleArgs(&(modInfo->moduleList[num]),
@@ -251,7 +264,12 @@ int chooseManualDriver(int class, moduleList modLoaded, moduleDeps modDeps,
if (done == -1)
return LOADER_BACK;
-
+ if (done == -2) {
+ loadDriverFromMedia(class, modLoaded, modDepsPtr, modInfo, kd,
+ flags, 1);
+ return chooseManualDriver(class, modLoaded, modDepsPtr, modInfo,
+ kd, flags);
+ }
mlLoadModule(modInfo->moduleList[num].moduleName, modLoaded, modDeps,
modInfo, moduleArgs, flags);