summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/cdrom.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c
index eb5977153..73ccc273e 100644
--- a/mdk-stage1/cdrom.c
+++ b/mdk-stage1/cdrom.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <stdio.h>
#include <sys/mount.h>
#include "stage1.h"
#include "frontend.h"
@@ -34,29 +35,35 @@
-static enum return_type try_with_device(char *dev_name)
+static enum return_type try_with_device(char *dev_name, char * dev_model)
{
char device_fullname[50];
strcpy(device_fullname, "/dev/");
strcat(device_fullname, dev_name);
+ wait_message("Trying to access a CDROM disc (drive %s)", dev_model);
+
if (my_mount(device_fullname, IMAGE_LOCATION, "iso9660") == -1) {
enum return_type results;
+ char msg[500];
unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
+ remove_wait_message();
- results = ask_yes_no("I can't access a CDROM disc in your drive.\nRetry?");
+ sprintf(msg, "I can't access a CDROM disc (drive %s).\nRetry?", dev_model);
+ results = ask_yes_no(msg);
if (results == RETURN_OK)
- return try_with_device(dev_name);
+ return try_with_device(dev_name, dev_model);
return results;
}
+ remove_wait_message();
if (access(IMAGE_LOCATION LIVE_LOCATION, R_OK)) {
enum return_type results;
umount(IMAGE_LOCATION);
results = ask_yes_no("That CDROM disc does not seem to be a " DISTRIB_NAME " Installation CDROM.\nRetry with another disc?");
if (results == RETURN_OK)
- return try_with_device(dev_name);
+ return try_with_device(dev_name, dev_model);
return results;
}
@@ -99,7 +106,7 @@ enum return_type cdrom_prepare(void)
}
if (count == 1) {
- results = try_with_device(*medias);
+ results = try_with_device(*medias, *medias_models);
if (results == RETURN_OK)
return RETURN_OK;
i = ask_insmod(SCSI_ADAPTERS);
@@ -109,16 +116,24 @@ enum return_type cdrom_prepare(void)
}
if (IS_AUTOMATIC) {
- results = try_with_device(*medias);
+ results = try_with_device(*medias, *medias_models);
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);
- if (results == RETURN_OK)
- results = try_with_device(choice);
- else
+ if (results == RETURN_OK) {
+ char ** model = medias_models;
+ ptr = medias;
+ while (ptr && *ptr && model && *model) {
+ if (!strcmp(*ptr, choice))
+ break;
+ ptr++;
+ model++;
+ }
+ results = try_with_device(choice, *model);
+ } else
return results;
}