summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-01-22 11:29:42 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-01-22 11:29:42 +0000
commit3c7720281fc9c4e2515f2a78e8aee21e9ed639c6 (patch)
treec8d573db7e98871700457e16c208555f65b3830c /mdk-stage1
parent9ac0a90242249ad09219a06f4e9bfe41470e65da (diff)
downloaddrakx-3c7720281fc9c4e2515f2a78e8aee21e9ed639c6.tar
drakx-3c7720281fc9c4e2515f2a78e8aee21e9ed639c6.tar.gz
drakx-3c7720281fc9c4e2515f2a78e8aee21e9ed639c6.tar.bz2
drakx-3c7720281fc9c4e2515f2a78e8aee21e9ed639c6.tar.xz
drakx-3c7720281fc9c4e2515f2a78e8aee21e9ed639c6.zip
nice kernel guys like to change modules names for no reasons when they have a break
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/modules.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index efa3b96a0..6e754c892 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -129,6 +129,35 @@ static enum return_type ensure_additional_modules_available(void)
return RETURN_OK;
}
+static const char * get_name_kernel_26_transition(const char * name)
+{
+ struct kernel_24_26_mapping {
+ const char * name_24;
+ const char * name_26;
+ };
+ static struct kernel_24_26_mapping mappings[] = {
+ { "usb-ohci", "ohci-hcd" },
+ { "usb-uhci", "uhci-hcd" },
+ { "uhci", "uhci-hcd" },
+// { "printer", "usblp" },
+ { "bcm4400", "b44" },
+ { "3c559", "3c359" },
+ { "3c90x", "3c59x" },
+ { "dc395x_trm", "dc395x" },
+// { "audigy", "snd-emu10k1" },
+ };
+ int mappings_nb = sizeof(mappings) / sizeof(struct kernel_24_26_mapping);
+ int i;
+
+ /* pcitable contains 2.4 names. this will need to change if/when it contains 2.6 names! */
+ if (kernel_version() > 4)
+ for (i=0; i<mappings_nb; i++) {
+ if (streq(name, mappings[i].name_24))
+ return mappings[i].name_26;
+ }
+ return name;
+}
+
/* unarchive and insmod given module
* WARNING: module must not contain the trailing ".o"
*/
@@ -138,7 +167,7 @@ static enum insmod_return insmod_archived_file(const char * mod_name, char * opt
char final_name[50] = "/tmp/";
int i, rc;
- strncpy(module_name, mod_name, sizeof(module_name));
+ strncpy(module_name, get_name_kernel_26_transition(mod_name), sizeof(module_name));
if (kernel_version() <= 4)
strcat(module_name, ".o");
else