summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/automatic.c4
-rw-r--r--mdk-stage1/cdrom.c15
-rw-r--r--mdk-stage1/modules.c2
-rw-r--r--mdk-stage1/newt-frontend.c2
-rw-r--r--mdk-stage1/stage1.c11
-rw-r--r--mdk-stage1/stage1.h10
-rw-r--r--mdk-stage1/stdio-frontend.c2
-rw-r--r--mdk-stage1/tools.c7
-rw-r--r--mdk-stage1/tools.h1
9 files changed, 24 insertions, 30 deletions
diff --git a/mdk-stage1/automatic.c b/mdk-stage1/automatic.c
index 3571614a0..1305b696a 100644
--- a/mdk-stage1/automatic.c
+++ b/mdk-stage1/automatic.c
@@ -85,7 +85,7 @@ char * get_auto_value(char * auto_param)
enum return_type ask_from_list_auto(char *msg, char ** elems, char ** choice, char * auto_param, char ** elems_auto)
{
- if (!IS_AUTOMATIC || IS_AUTOMATIC_ERROR_OCCURED)
+ if (!IS_AUTOMATIC)
return ask_from_list(msg, elems, choice);
else {
char * tmp = get_auto_value(auto_param);
@@ -104,7 +104,7 @@ enum return_type ask_from_list_auto(char *msg, char ** elems, char ** choice, ch
enum return_type ask_from_entries_auto(char *msg, char ** questions, char *** answers, int entry_size, char ** questions_auto)
{
- if (!IS_AUTOMATIC || IS_AUTOMATIC_ERROR_OCCURED)
+ if (!IS_AUTOMATIC)
return ask_from_entries(msg, questions, answers, entry_size);
else {
char * tmp_answers[50];
diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c
index ba985f563..44e0b85fc 100644
--- a/mdk-stage1/cdrom.c
+++ b/mdk-stage1/cdrom.c
@@ -106,14 +106,21 @@ enum return_type cdrom_prepare(void)
return cdrom_prepare();
}
- results = ask_from_list_comments("Please choose the CDROM drive to use for the installation.", medias, medias_models, &choice);
-
- if (results != RETURN_OK)
+ if (IS_AUTOMATIC) {
+ results = try_with_device(*medias);
+ if (results != RETURN_OK)
+ unset_param(MODE_AUTOMATIC);
return results;
-
+ }
+ else
+ results = ask_from_list_comments("Please choose the CDROM drive to use for the installation.", medias, medias_models, &choice);
+
results = try_with_device(choice);
if (results == RETURN_OK)
return RETURN_OK;
+ if (results == RETURN_BACK)
+ return cdrom_prepare();
+
i = ask_insmod(SCSI_ADAPTERS);
if (i == RETURN_BACK)
return RETURN_BACK;
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index b3376520d..14069d9dc 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -213,6 +213,8 @@ enum return_type ask_insmod(enum driver_type type)
enum return_type results;
char * choice;
+ unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
+
if (type == SCSI_ADAPTERS)
mytype = "SCSI";
else if (type == NETWORK_DEVICES)
diff --git a/mdk-stage1/newt-frontend.c b/mdk-stage1/newt-frontend.c
index cae1c1c1a..d44911c61 100644
--- a/mdk-stage1/newt-frontend.c
+++ b/mdk-stage1/newt-frontend.c
@@ -60,7 +60,7 @@ void error_message(char *msg, ...)
va_start(args, msg);
va_end(args);
newtWinMessagev("Error", "Ok", msg, args);
- set_param(MODE_AUTOMATIC_ERROR_OCCURED);
+ unset_param(MODE_AUTOMATIC);
}
void info_message(char *msg, ...)
diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c
index 528132ace..50f04ad53 100644
--- a/mdk-stage1/stage1.c
+++ b/mdk-stage1/stage1.c
@@ -194,16 +194,7 @@ int main(int argc, char **argv)
fatal_error("could not open and parse modules dependencies");
init_frontend();
-#ifndef DISABLE_CDROM
- if (IS_CDROM) {
- /* try as automatic as possible with cdrom bootdisk */
- ret = cdrom_prepare();
- if (ret != RETURN_OK)
- ret = method_select_and_prepare();
- }
- else
-#endif
- ret = method_select_and_prepare();
+ ret = method_select_and_prepare();
finish_frontend();
close_log();
diff --git a/mdk-stage1/stage1.h b/mdk-stage1/stage1.h
index 01620c266..210664074 100644
--- a/mdk-stage1/stage1.h
+++ b/mdk-stage1/stage1.h
@@ -34,25 +34,15 @@ extern char * method_name;
#define MODE_TESTING (1 << 0)
#define MODE_EXPERT (1 << 1)
-#define MODE_TEXT (1 << 2)
#define MODE_RESCUE (1 << 3)
#define MODE_AUTOMATIC (1 << 4)
-#define MODE_PCMCIA (1 << 5)
-#define MODE_CDROM (1 << 6)
-#define MODE_LIVE (1 << 7)
#define MODE_SPECIAL_STAGE2 (1 << 8)
#define MODE_RAMDISK (1 << 9)
-#define MODE_AUTOMATIC_ERROR_OCCURED (1 << 10)
#define IS_TESTING (get_param(MODE_TESTING))
#define IS_EXPERT (get_param(MODE_EXPERT))
-#define IS_TEXT (get_param(MODE_TEXT))
#define IS_RESCUE (get_param(MODE_RESCUE))
#define IS_AUTOMATIC (get_param(MODE_AUTOMATIC))
-#define IS_AUTOMATIC_ERROR_OCCURED (get_param(MODE_AUTOMATIC_ERROR_OCCURED))
-#define IS_PCMCIA (get_param(MODE_PCMCIA))
-#define IS_CDROM (get_param(MODE_CDROM))
-#define IS_LIVE (get_param(MODE_LIVE))
#define IS_SPECIAL_STAGE2 (get_param(MODE_SPECIAL_STAGE2))
#define IS_RAMDISK (get_param(MODE_RAMDISK))
diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c
index 8f8b68c17..0c435e186 100644
--- a/mdk-stage1/stdio-frontend.c
+++ b/mdk-stage1/stdio-frontend.c
@@ -87,7 +87,7 @@ void error_message(char *msg, ...)
va_start(args, msg);
va_end(args);
blocking_msg("> Error! ", msg, args);
- set_param(MODE_AUTOMATIC_ERROR_OCCURED);
+ unset_param(MODE_AUTOMATIC);
}
void info_message(char *msg, ...)
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index f4da3b50b..6a4b938ed 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -81,8 +81,6 @@ void process_cmdline(void)
tmp_params[p].value = value;
if (!strcmp(name, "expert")) set_param(MODE_EXPERT);
if (!strcmp(name, "rescue")) set_param(MODE_RESCUE);
- if (!strcmp(name, "pcmcia")) set_param(MODE_PCMCIA);
- if (!strcmp(name, "cdrom")) set_param(MODE_CDROM);
if (!strcmp(name, "special_stage2")) set_param(MODE_SPECIAL_STAGE2);
if (!strcmp(name, "automatic")) {
set_param(MODE_AUTOMATIC);
@@ -134,6 +132,11 @@ void set_param(int i)
stage1_mode |= i;
}
+void unset_param(int i)
+{
+ stage1_mode &= ~i;
+}
+
int total_memory(void)
{
diff --git a/mdk-stage1/tools.h b/mdk-stage1/tools.h
index 7f34c8c5d..e91c4acf5 100644
--- a/mdk-stage1/tools.h
+++ b/mdk-stage1/tools.h
@@ -27,6 +27,7 @@
void process_cmdline(void);
int get_param(int i);
void set_param(int i);
+void unset_param(int i);
int total_memory(void);
int ramdisk_possible(void);
enum return_type load_ramdisk(void);