summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/modules.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-04-30 17:23:04 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-04-30 17:23:04 +0000
commit324ebed124c5b0f78a1e343fbbd6ee41c2814b49 (patch)
treea7ef301fd2b693090efc71ad725bd33ecfc589f4 /mdk-stage1/modules.c
parenta0252e4b88e646f21e649a64124870f265b7c45c (diff)
downloaddrakx-backup-do-not-use-324ebed124c5b0f78a1e343fbbd6ee41c2814b49.tar
drakx-backup-do-not-use-324ebed124c5b0f78a1e343fbbd6ee41c2814b49.tar.gz
drakx-backup-do-not-use-324ebed124c5b0f78a1e343fbbd6ee41c2814b49.tar.bz2
drakx-backup-do-not-use-324ebed124c5b0f78a1e343fbbd6ee41c2814b49.tar.xz
drakx-backup-do-not-use-324ebed124c5b0f78a1e343fbbd6ee41c2814b49.zip
Provide some description of the drivers
Diffstat (limited to 'mdk-stage1/modules.c')
-rw-r--r--mdk-stage1/modules.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index f3d43bd32..51e2b6902 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -30,6 +30,7 @@
#include "log.h"
#include "mar/mar-extract-only.h"
#include "frontend.h"
+#include "modules_descr.h"
#include "modules.h"
@@ -346,7 +347,24 @@ enum return_type ask_insmod(enum driver_type type)
snprintf(msg, sizeof(msg), "Which driver should I try to gain %s access?", mytype);
- results = ask_from_list(msg, mar_list_contents(archive_name), &choice);
+ {
+ char ** drivers = mar_list_contents(archive_name);
+ char ** descrs = malloc(sizeof(char *) * string_array_length(drivers));
+ char ** p_drivers = drivers;
+ char ** p_descrs = descrs;
+ while (p_drivers && *p_drivers) {
+ int i;
+ *p_descrs = NULL;
+ for (i = 0 ; i < modules_descriptions_num ; i++) {
+ if (!strncmp(*p_drivers, modules_descriptions[i].module, strlen(modules_descriptions[i].module))
+ && (*p_drivers)[strlen(modules_descriptions[i].module)] == '.') /* one contains '.o' not the other */
+ *p_descrs = modules_descriptions[i].descr;
+ }
+ p_drivers++;
+ p_descrs++;
+ }
+ results = ask_from_list_comments(msg, drivers, descrs, &choice);
+ }
if (results == RETURN_OK) {
choice[strlen(choice)-2] = '\0'; /* remove trailing .o */