diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-02-13 15:54:14 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-02-13 15:54:14 +0000 |
commit | 79968466f45ef4eae3a69089c79002cc065bf504 (patch) | |
tree | 4d7f0e6b37fd78901db27a2f5dd0f2cd024437f6 /mdk-stage1/modules.c | |
parent | 108fd442c49a81f688af8c473288864fa1d17d94 (diff) | |
download | drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar.gz drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar.bz2 drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar.xz drakx-79968466f45ef4eae3a69089c79002cc065bf504.zip |
- better log of nfs mount errors
- don't insmod modules already present (important for bzip2 slowness)
Diffstat (limited to 'mdk-stage1/modules.c')
-rw-r--r-- | mdk-stage1/modules.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index fe55ff15f..8194a7576 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -192,6 +192,22 @@ static void add_modules_conf(char * str) } +static int module_already_present(const char * name) +{ + FILE * f; + int answ = 0; + f = fopen("/proc/modules", "rb"); + while (1) { + char buf[500]; + if (!fgets(buf, sizeof(buf), f)) break; + if (!strncmp(name, buf, strlen(name))) + answ = 1; + } + fclose(f); + return answ; +} + + static int insmod_with_deps(const char * mod_name, char * options) { struct module_deps_elem * dep; @@ -210,6 +226,9 @@ static int insmod_with_deps(const char * mod_name, char * options) } } + if (module_already_present(mod_name)) + return 0; + log_message("needs %s", mod_name); return insmod_archived_file(mod_name, options); } |