diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-03-16 21:20:56 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-03-16 21:20:56 +0000 |
commit | 5724d47cdd4a75af6ea347cecef43ed47b45a6d8 (patch) | |
tree | d0e855eb307b6441be4bcbff9137369ec4a9f162 /mdk-stage1/modules.c | |
parent | 46ad4d816ac306866fbe2b9a1cb083e796204eac (diff) | |
download | drakx-5724d47cdd4a75af6ea347cecef43ed47b45a6d8.tar drakx-5724d47cdd4a75af6ea347cecef43ed47b45a6d8.tar.gz drakx-5724d47cdd4a75af6ea347cecef43ed47b45a6d8.tar.bz2 drakx-5724d47cdd4a75af6ea347cecef43ed47b45a6d8.tar.xz drakx-5724d47cdd4a75af6ea347cecef43ed47b45a6d8.zip |
- merge update_modules stuff in third-party module
- add "thirdparty" as an alias for the "updatemodules" option
- allow to specify thirdparty device using automatic "thirdparty" option
- try to mount as iso9660 too in try_mount
Diffstat (limited to 'mdk-stage1/modules.c')
-rw-r--r-- | mdk-stage1/modules.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index 01b342cd1..11e118030 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -556,69 +556,3 @@ enum return_type ask_insmod(enum driver_type type) } else return results; } - - -void update_modules(void) -{ - FILE * f; - char ** disk_contents; - char final_name[500]; - char floppy_mount_location[] = "/tmp/floppy"; - - stg1_info_message("Please insert the Update Modules floppy.");; - - if (my_mount(floppy_device(), floppy_mount_location, "ext2", 0) == -1) { - enum return_type results = ask_yes_no("I can't find a Linux ext2 floppy in first floppy drive.\n" - "Retry?"); - if (results == RETURN_OK) - return update_modules(); - return; - } - - disk_contents = list_directory(floppy_mount_location); - - if (!(f = fopen("/tmp/floppy/to_load", "rb"))) { - stg1_error_message("I can't find \"to_load\" file."); - umount(floppy_mount_location); - return update_modules(); - } - while (1) { - char module[500]; - char * options; - char ** entry = disk_contents; - - if (!fgets(module, sizeof(module), f)) break; - if (module[0] == '#' || strlen(module) == 0) - continue; - - while (module[strlen(module)-1] == '\n') - module[strlen(module)-1] = '\0'; - options = strchr(module, ' '); - if (options) { - options[0] = '\0'; - options++; - } - - log_message("updatemodules: (%s) (%s)", module, options); - while (entry && *entry) { - if (!strncmp(*entry, module, strlen(module)) && (*entry)[strlen(module)] == '.') { - sprintf(final_name, "%s/%s", floppy_mount_location, *entry); - if (insmod_local_file(final_name, options)) { - log_message("\t%s (floppy): failed", *entry); - stg1_error_message("Insmod %s (floppy) failed.", *entry); - } - break; - } - entry++; - } - if (!entry || !*entry) { - enum insmod_return ret = my_insmod(module, ANY_DRIVER_TYPE, options, 0); - if (ret != INSMOD_OK) { - log_message("\t%s (marfile): failed", module); - stg1_error_message("Insmod %s (marfile) failed.", module); - } - } - } - fclose(f); - umount(floppy_mount_location); -} |