diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-03-17 13:44:04 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-03-17 13:44:04 +0000 |
commit | 735e0d9043904556ff267a5ba0f2d6a4a896bad7 (patch) | |
tree | b5a651bd810f14b9dc07a0b3bdda211448f36fb9 | |
parent | 31591e97e99f2c0d44827c86ccf2a5c5f6dae616 (diff) | |
download | drakx-backup-do-not-use-735e0d9043904556ff267a5ba0f2d6a4a896bad7.tar drakx-backup-do-not-use-735e0d9043904556ff267a5ba0f2d6a4a896bad7.tar.gz drakx-backup-do-not-use-735e0d9043904556ff267a5ba0f2d6a4a896bad7.tar.bz2 drakx-backup-do-not-use-735e0d9043904556ff267a5ba0f2d6a4a896bad7.tar.xz drakx-backup-do-not-use-735e0d9043904556ff267a5ba0f2d6a4a896bad7.zip |
probe in automatic mode to create devices (and really check for mount return code)
-rw-r--r-- | mdk-stage1/thirdparty.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mdk-stage1/thirdparty.c b/mdk-stage1/thirdparty.c index 5bdab55ad..cd4e6b83c 100644 --- a/mdk-stage1/thirdparty.c +++ b/mdk-stage1/thirdparty.c @@ -32,7 +32,7 @@ #define THIRDPARTY_MOUNT_LOCATION "/tmp/thirdparty" #define THIRDPARTY_DIRECTORY "/install/thirdparty" -static enum return_type third_party_choose_device(char ** device) +static enum return_type third_party_choose_device(char ** device, int probe_only) { char ** medias, ** medias_models; char ** ptr, ** ptr_models; @@ -76,6 +76,17 @@ static enum return_type third_party_choose_device(char ** device) return RETURN_BACK; } + if (probe_only) { +#ifndef DISABLE_DISK + free(disk_medias); + free(disk_medias_models); +#endif +#ifndef DISABLE_CDROM + free(cdrom_medias); + free(cdrom_medias_models); +#endif + return RETURN_OK; + } ptr = medias = malloc((count + 1) * sizeof(char *)); ptr_models =medias_models = malloc((count + 1) * sizeof(char *)); @@ -161,7 +172,7 @@ static enum return_type third_party_choose_device(char ** device) static enum return_type thirdparty_mount_device(char * device) { log_message("third party: trying to mount device %s", device); - if (!try_mount(device, THIRDPARTY_MOUNT_LOCATION)) { + if (try_mount(device, THIRDPARTY_MOUNT_LOCATION) != 0) { stg1_error_message("I can't mount the selected device (%s).", device); return RETURN_ERROR; } @@ -256,13 +267,14 @@ void thirdparty_load_modules(void) device = NULL; if (IS_AUTOMATIC) { device = get_auto_value("thirdparty"); + third_party_choose_device(NULL, 1); /* probe only to create devices */ log_message("third party: trying automatic device %s", device); if (thirdparty_mount_device(device) != RETURN_OK) device = NULL; } while (!device || streq(device, "")) { - results = third_party_choose_device(&device); + results = third_party_choose_device(&device, 0); if (results == RETURN_BACK) return; if (thirdparty_mount_device(device) != RETURN_OK) |