diff options
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/cdrom.c | 14 | ||||
-rw-r--r-- | mdk-stage1/tools.c | 9 | ||||
-rw-r--r-- | mdk-stage1/tools.h | 1 |
3 files changed, 12 insertions, 12 deletions
diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c index c3cee97c8..c6f8455f7 100644 --- a/mdk-stage1/cdrom.c +++ b/mdk-stage1/cdrom.c @@ -49,21 +49,11 @@ static int mount_that_cd_device(char * dev_name) } -static int test_that_cd() -{ -#ifdef MANDRAKE_MOVE - return access(IMAGE_LOCATION "/live_tree.clp", R_OK); -#else - return access(IMAGE_LOCATION LIVE_LOCATION, R_OK); -#endif -} - - static enum return_type try_with_device(char * dev_name, char * dev_model); static enum return_type do_with_device(char * dev_name, char * dev_model) { - if (test_that_cd()) { + if (!image_has_stage2()) { 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?"); @@ -123,7 +113,7 @@ int try_automatic(char ** medias, char ** medias_models) wait_message("Trying to access " DISTRIB_NAME " CDROM disc (drive %s)", *model); if (mount_that_cd_device(*ptr) != -1) { - if (!test_that_cd()) { + if (image_has_stage2()) { remove_wait_message(); return i; } diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c index 182e64130..a89edf613 100644 --- a/mdk-stage1/tools.c +++ b/mdk-stage1/tools.c @@ -222,6 +222,15 @@ int total_memory(void) } +int image_has_stage2() +{ +#ifdef MANDRAKE_MOVE + return access(IMAGE_LOCATION "/live_tree.clp", R_OK) == 0; +#else + return access(IMAGE_LOCATION LIVE_LOCATION, R_OK) == 0; +#endif +} + int ramdisk_possible(void) { if (total_memory() > (IS_RESCUE ? MEM_LIMIT_RESCUE : MEM_LIMIT_DRAKX)) diff --git a/mdk-stage1/tools.h b/mdk-stage1/tools.h index 61d8c2725..df2910a73 100644 --- a/mdk-stage1/tools.h +++ b/mdk-stage1/tools.h @@ -31,6 +31,7 @@ void unset_param(int i); int charstar_to_int(const char * s); off_t file_size(const char * path); int total_memory(void); +int image_has_stage2(); int ramdisk_possible(void); enum return_type copy_file(char * from, char * to, void (*callback_func)(int overall)); #ifndef MANDRAKE_MOVE |