diff options
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); -} |