diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2004-01-22 17:09:00 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2004-01-22 17:09:00 +0000 |
commit | 147317297c20ab596f239c8f3947ed3e2290282e (patch) | |
tree | 6e2a3d285addc44365d79ee305a8677bebabab7a /mdk-stage1 | |
parent | ea1ae4d01e69b2bd24896315c88eb072c3874e1d (diff) | |
download | drakx-147317297c20ab596f239c8f3947ed3e2290282e.tar drakx-147317297c20ab596f239c8f3947ed3e2290282e.tar.gz drakx-147317297c20ab596f239c8f3947ed3e2290282e.tar.bz2 drakx-147317297c20ab596f239c8f3947ed3e2290282e.tar.xz drakx-147317297c20ab596f239c8f3947ed3e2290282e.zip |
until we haven't loaded the usb interface and the keyboard usb driver, we can't allow asking for additional drivers floppy, so need another parameter to my_insmod to indicate in which situation we are
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/adsl.c | 6 | ||||
-rw-r--r-- | mdk-stage1/cdrom.c | 6 | ||||
-rw-r--r-- | mdk-stage1/disk.c | 2 | ||||
-rw-r--r-- | mdk-stage1/lomount.c | 6 | ||||
-rw-r--r-- | mdk-stage1/modules.c | 24 | ||||
-rw-r--r-- | mdk-stage1/modules.h | 2 | ||||
-rw-r--r-- | mdk-stage1/mount.c | 12 | ||||
-rw-r--r-- | mdk-stage1/network.c | 2 | ||||
-rw-r--r-- | mdk-stage1/pcmcia_/cardmgr.c | 2 | ||||
-rw-r--r-- | mdk-stage1/probing.c | 18 | ||||
-rw-r--r-- | mdk-stage1/stage1.c | 10 |
11 files changed, 46 insertions, 44 deletions
diff --git a/mdk-stage1/adsl.c b/mdk-stage1/adsl.c index d542f2f35..b3ed0f87e 100644 --- a/mdk-stage1/adsl.c +++ b/mdk-stage1/adsl.c @@ -145,9 +145,9 @@ enum return_type perform_adsl(struct interface_info * intf) intf->boot_proto = BOOTPROTO_ADSL_PPPOE; wait_message("Waiting for ADSL connection to show up..."); - my_insmod("ppp_generic", ANY_DRIVER_TYPE, NULL); - my_insmod("ppp_async", ANY_DRIVER_TYPE, NULL); - my_insmod("ppp", ANY_DRIVER_TYPE, NULL); + my_insmod("ppp_generic", ANY_DRIVER_TYPE, NULL, 1); + my_insmod("ppp_async", ANY_DRIVER_TYPE, NULL, 1); + my_insmod("ppp", ANY_DRIVER_TYPE, NULL, 1); results = adsl_connect(intf->device, answers[0], answers[1]); remove_wait_message(); diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c index 7d14cdebb..a6d0ab726 100644 --- a/mdk-stage1/cdrom.c +++ b/mdk-stage1/cdrom.c @@ -147,14 +147,14 @@ enum return_type cdrom_prepare(void) int i, count = 0; enum return_type results; - my_insmod("ide-cd", ANY_DRIVER_TYPE, NULL); + my_insmod("ide-cd", ANY_DRIVER_TYPE, NULL, 0); if (IS_AUTOMATIC) { get_medias(CDROM, &medias, &medias_models, BUS_IDE); if ((i = try_automatic(medias, medias_models)) != -1) return do_with_device(medias[i], medias_models[i]); - my_insmod("sr_mod", ANY_DRIVER_TYPE, NULL); + my_insmod("sr_mod", ANY_DRIVER_TYPE, NULL, 0); get_medias(CDROM, &medias, &medias_models, BUS_SCSI); if ((i = try_automatic(medias, medias_models)) != -1) return do_with_device(medias[i], medias_models[i]); @@ -165,7 +165,7 @@ enum return_type cdrom_prepare(void) unset_param(MODE_AUTOMATIC); } else - my_insmod("sr_mod", ANY_DRIVER_TYPE, NULL); + my_insmod("sr_mod", ANY_DRIVER_TYPE, NULL, 0); get_medias(CDROM, &medias, &medias_models, BUS_ANY); diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c index 2dcaad2b8..f22313318 100644 --- a/mdk-stage1/disk.c +++ b/mdk-stage1/disk.c @@ -318,7 +318,7 @@ static int get_disks(char *** names, char *** models) char ** ptr; int count = 0; - my_insmod("sd_mod", ANY_DRIVER_TYPE, NULL); + my_insmod("sd_mod", ANY_DRIVER_TYPE, NULL, 0); get_medias(DISK, names, models, BUS_ANY); diff --git a/mdk-stage1/lomount.c b/mdk-stage1/lomount.c index 25f72c345..1ad05cbee 100644 --- a/mdk-stage1/lomount.c +++ b/mdk-stage1/lomount.c @@ -80,7 +80,7 @@ set_loop (const char *device, const char *file, int gz) loopinfo.lo_name[LO_NAME_SIZE - 1] = 0; loopinfo.lo_offset = 0; if (gz) { - my_insmod("gzloop", ANY_DRIVER_TYPE, NULL); + my_insmod("gzloop", ANY_DRIVER_TYPE, NULL, 1); loopinfo.lo_encrypt_type = 13; /* LO_CRYPT_GZ */ } @@ -173,10 +173,10 @@ lomount(char *loopfile, char *where, char **dev, int gz) flag |= MS_RDONLY; #ifdef MANDRAKE_MOVE - my_insmod("change_loop", ANY_DRIVER_TYPE, NULL); + my_insmod("change_loop", ANY_DRIVER_TYPE, NULL, 1); chloop = 1; #else - my_insmod("loop", ANY_DRIVER_TYPE, NULL); + my_insmod("loop", ANY_DRIVER_TYPE, NULL, 1); #endif if (!(loopdev = find_free_loop(chloop))) { diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index eb3ab9363..49d8a3512 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -104,7 +104,7 @@ static enum return_type ensure_additional_modules_available(void) retry: stg1_info_message("Please insert the Additional Drivers floppy.");; - my_insmod("floppy", ANY_DRIVER_TYPE, NULL); + my_insmod("floppy", ANY_DRIVER_TYPE, NULL, 0); while (my_mount("/dev/fd0", 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" @@ -161,7 +161,7 @@ static const char * get_name_kernel_26_transition(const char * name) /* unarchive and insmod given module * WARNING: module must not contain the trailing ".o" */ -static enum insmod_return insmod_archived_file(const char * mod_name, char * options) +static enum insmod_return insmod_archived_file(const char * mod_name, char * options, int allow_modules_floppy) { char module_name[50]; char final_name[50] = "/tmp/"; @@ -175,7 +175,7 @@ static enum insmod_return insmod_archived_file(const char * mod_name, char * opt i = mar_extract_file(archive_name, module_name, "/tmp/"); if (i == 1) { static int recurse = 0; - if (allow_additional_modules_floppy && !recurse && !IS_AUTOMATIC) { + if (allow_additional_modules_floppy && allow_modules_floppy && !recurse && !IS_AUTOMATIC) { recurse = 1; if (ensure_additional_modules_available() == RETURN_OK) i = mar_extract_file(additional_archive_name, module_name, "/tmp/"); @@ -358,7 +358,7 @@ int module_already_present(const char * name) } -static enum insmod_return insmod_with_deps(const char * mod_name, char * options) +static enum insmod_return insmod_with_deps(const char * mod_name, char * options, int allow_modules_floppy) { struct module_deps_elem * dep; @@ -371,7 +371,7 @@ static enum insmod_return insmod_with_deps(const char * mod_name, char * options while (*one_dep) { /* here, we can fail but we don't care, if the error is * important, the desired module will fail also */ - insmod_with_deps(*one_dep, NULL); + insmod_with_deps(*one_dep, NULL, allow_modules_floppy); one_dep++; } } @@ -380,14 +380,14 @@ static enum insmod_return insmod_with_deps(const char * mod_name, char * options return INSMOD_OK; log_message("needs %s", mod_name); - return insmod_archived_file(mod_name, options); + return insmod_archived_file(mod_name, options, allow_modules_floppy); } #ifndef DISABLE_NETWORK -enum insmod_return my_insmod(const char * mod_name, enum driver_type type, char * options) +enum insmod_return my_insmod(const char * mod_name, enum driver_type type, char * options, int allow_modules_floppy) #else -enum insmod_return my_insmod(const char * mod_name, enum driver_type type __attribute__ ((unused)), char * options) +enum insmod_return my_insmod(const char * mod_name, enum driver_type type __attribute__ ((unused)), char * options, int allow_modules_floppy) #endif { int i; @@ -413,7 +413,7 @@ enum insmod_return my_insmod(const char * mod_name, enum driver_type type __attr if (IS_TESTING) return INSMOD_OK; - i = insmod_with_deps(mod_name, options); + i = insmod_with_deps(mod_name, options, allow_modules_floppy); if (i == 0) { log_message("\tsucceeded %s", mod_name); #ifndef DISABLE_NETWORK @@ -459,7 +459,7 @@ static enum return_type insmod_with_options(char * mod, enum driver_type type) strcat(options, " "); strcat(options, answers[0]); // because my_insmod will eventually modify the string - if (my_insmod(mod, type, answers[0]) != INSMOD_OK) { + if (my_insmod(mod, type, answers[0], 1) != INSMOD_OK) { stg1_error_message("Insmod failed."); return RETURN_ERROR; } @@ -530,7 +530,7 @@ void update_modules(void) stg1_info_message("Please insert the Update Modules floppy.");; - my_insmod("floppy", ANY_DRIVER_TYPE, NULL); + my_insmod("floppy", ANY_DRIVER_TYPE, NULL, 0); if (my_mount("/dev/fd0", 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" @@ -577,7 +577,7 @@ void update_modules(void) entry++; } if (!entry || !*entry) { - enum insmod_return ret = my_insmod(module, ANY_DRIVER_TYPE, options); + 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); diff --git a/mdk-stage1/modules.h b/mdk-stage1/modules.h index bc1e4dd7a..15a07af64 100644 --- a/mdk-stage1/modules.h +++ b/mdk-stage1/modules.h @@ -21,7 +21,7 @@ enum insmod_return { INSMOD_OK, INSMOD_FAILED, INSMOD_FAILED_FILE_NOT_FOUND }; void init_modules_insmoding(void); -enum insmod_return my_insmod(const char * mod_name, enum driver_type type, char * options); +enum insmod_return my_insmod(const char * mod_name, enum driver_type type, char * options, int allow_modules_floppy); enum return_type ask_insmod(enum driver_type); void update_modules(void); int module_already_present(const char * name); diff --git a/mdk-stage1/mount.c b/mdk-stage1/mount.c index 64ae759f9..e4fd2ddd8 100644 --- a/mdk-stage1/mount.c +++ b/mdk-stage1/mount.c @@ -185,8 +185,8 @@ int my_mount(char *dev, char *location, char *fs, int force_rw) } if (!strcmp(fs, "supermount")) { - my_insmod("supermount", ANY_DRIVER_TYPE, NULL); - my_insmod("isofs", ANY_DRIVER_TYPE, NULL); + my_insmod("supermount", ANY_DRIVER_TYPE, NULL, 1); + my_insmod("isofs", ANY_DRIVER_TYPE, NULL, 1); opts = alloca(500); sprintf(opts, "dev=%s,fs=iso9660,tray_lock=always", dev); dev = "none"; @@ -194,20 +194,20 @@ int my_mount(char *dev, char *location, char *fs, int force_rw) #ifndef DISABLE_MEDIAS if (!strcmp(fs, "vfat")) { - my_insmod("vfat", ANY_DRIVER_TYPE, NULL); + my_insmod("vfat", ANY_DRIVER_TYPE, NULL, 1); opts = "check=relaxed"; } if (!strcmp(fs, "reiserfs")) - my_insmod("reiserfs", ANY_DRIVER_TYPE, NULL); + my_insmod("reiserfs", ANY_DRIVER_TYPE, NULL, 1); #endif if (!strcmp(fs, "iso9660")) - my_insmod("isofs", ANY_DRIVER_TYPE, NULL); + my_insmod("isofs", ANY_DRIVER_TYPE, NULL, 1); #ifndef DISABLE_NETWORK if (!strcmp(fs, "nfs")) { - my_insmod("nfs", ANY_DRIVER_TYPE, NULL); + my_insmod("nfs", ANY_DRIVER_TYPE, NULL, 1); log_message("preparing nfsmount for %s", dev); rc = nfsmount_prepare(dev, &opts); if (rc != 0) diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index be451dbbf..1eb786cc8 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -518,7 +518,7 @@ static enum return_type bringup_networking(struct interface_info * intf) static struct interface_info loopback; enum return_type results = RETURN_ERROR; - my_insmod("af_packet", ANY_DRIVER_TYPE, NULL); + my_insmod("af_packet", ANY_DRIVER_TYPE, NULL, 1); while (results != RETURN_OK) { results = setup_network_interface(intf); diff --git a/mdk-stage1/pcmcia_/cardmgr.c b/mdk-stage1/pcmcia_/cardmgr.c index ea3ff127e..c989f17f3 100644 --- a/mdk-stage1/pcmcia_/cardmgr.c +++ b/mdk-stage1/pcmcia_/cardmgr.c @@ -786,7 +786,7 @@ static int load_config(void) static void install_module(char *mod, char *opts) { - my_insmod(mod, ANY_DRIVER_TYPE, opts); + my_insmod(mod, ANY_DRIVER_TYPE, opts, 1); //mdk-stage1// module_list_t *ml; //mdk-stage1// //mdk-stage1// for (ml = module_list; ml != NULL; ml = ml->next) diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index 4a1b9a0dc..483fc5586 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -134,7 +134,7 @@ void discovered_device(enum driver_type type, wait_msg = 1; } else stg1_info_message("About to load driver for SCSI adapter:\n \n%s", description); - failed = my_insmod(driver, SCSI_ADAPTERS, NULL); + failed = my_insmod(driver, SCSI_ADAPTERS, NULL, 1); if (wait_msg) remove_wait_message(); warning_insmod_failed(failed); @@ -144,14 +144,15 @@ void discovered_device(enum driver_type type, if (type == NETWORK_DEVICES) { stg1_info_message("About to load driver for network device:\n \n%s", description); prepare_intf_descr(description); - warning_insmod_failed(my_insmod(driver, NETWORK_DEVICES, NULL)); + warning_insmod_failed(my_insmod(driver, NETWORK_DEVICES, NULL, 1)); if (intf_descr_for_discover) /* for modules providing more than one net intf */ net_discovered_interface(NULL); } #endif #ifdef ENABLE_USB if (type == USB_CONTROLLERS) - my_insmod(driver, USB_CONTROLLERS, NULL); + /* we can't allow additional modules floppy since we need usbkbd for keystrokes of usb keyboards */ + my_insmod(driver, USB_CONTROLLERS, NULL, 0); #endif } @@ -289,17 +290,18 @@ void probe_that_type(enum driver_type type, enum media_bus bus __attribute__ ((u if (!already_mounted_usbdev) { already_mounted_usbdev = 1; - my_insmod("usb-storage", SCSI_ADAPTERS, NULL); + /* we can't allow additional modules floppy since we need usbkbd for keystrokes of usb keyboards */ + my_insmod("usb-storage", SCSI_ADAPTERS, NULL, 0); if (module_already_present("ieee1394")) - my_insmod("sbp2", SCSI_ADAPTERS, NULL); + my_insmod("sbp2", SCSI_ADAPTERS, NULL, 0); if (mount("/proc/bus/usb", "/proc/bus/usb", "usbdevfs", 0, NULL)) { log_message("USB: couldn't mount /proc/bus/usb"); goto end_usb_probe; } wait_message("Detecting USB devices."); sleep(4); /* sucking background work */ - my_insmod("usbkbd", ANY_DRIVER_TYPE, NULL); - my_insmod("keybdev", ANY_DRIVER_TYPE, NULL); + my_insmod("usbkbd", ANY_DRIVER_TYPE, NULL, 0); + my_insmod("keybdev", ANY_DRIVER_TYPE, NULL, 0); remove_wait_message(); } @@ -332,7 +334,7 @@ void probe_that_type(enum driver_type type, enum media_bus bus __attribute__ ((u if (type == NETWORK_DEVICES) { stg1_info_message("About to load driver for usb network device:\n \n%s", usbdb[i].name); prepare_intf_descr(usbdb[i].name); - warning_insmod_failed(my_insmod(usbdb[i].module, NETWORK_DEVICES, NULL)); + warning_insmod_failed(my_insmod(usbdb[i].module, NETWORK_DEVICES, NULL, 1)); if (intf_descr_for_discover) /* for modules providing more than one net intf */ net_discovered_interface(NULL); } diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index 28b266ed8..2e1cb0972 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -230,7 +230,7 @@ static void expert_third_party_modules(void) if (results != RETURN_OK) return; - my_insmod("floppy", ANY_DRIVER_TYPE, NULL); + my_insmod("floppy", ANY_DRIVER_TYPE, NULL, 0); if (my_mount("/dev/fd0", floppy_mount_location, "ext2", 0) == -1) { stg1_error_message("I can't find a Linux ext2 floppy in first floppy drive."); @@ -284,9 +284,9 @@ static void handle_pcmcia(char ** pcmcia_adapter) log_message("no pcmcia adapter found"); return; } - my_insmod("pcmcia_core", ANY_DRIVER_TYPE, NULL); - my_insmod(*pcmcia_adapter, ANY_DRIVER_TYPE, NULL); - my_insmod("ds", ANY_DRIVER_TYPE, NULL); + my_insmod("pcmcia_core", ANY_DRIVER_TYPE, NULL, 0); + my_insmod(*pcmcia_adapter, ANY_DRIVER_TYPE, NULL, 0); + my_insmod("ds", ANY_DRIVER_TYPE, NULL, 0); /* call to cardmgr takes time, let's use the wait message */ wait_message("Enabling PCMCIA extension cards..."); @@ -463,7 +463,7 @@ int mandrake_move_post(void) fclose(f); // in case we didn't mount any clp, because gzloop.o is not available later in /lib/modules - my_insmod("gzloop", ANY_DRIVER_TYPE, NULL); + my_insmod("gzloop", ANY_DRIVER_TYPE, NULL, 0); // hardcoded :( if (!access(TOTEM_LOCATION, R_OK)) { |