From 79968466f45ef4eae3a69089c79002cc065bf504 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 13 Feb 2001 15:54:14 +0000 Subject: - better log of nfs mount errors - don't insmod modules already present (important for bzip2 slowness) --- mdk-stage1/modules.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mdk-stage1/modules.c') 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); } -- cgit v1.2.1