diff options
author | Arnaud Patard <rtp@mageia.org> | 2011-03-18 21:21:26 +0000 |
---|---|---|
committer | Arnaud Patard <rtp@mageia.org> | 2011-03-18 21:21:26 +0000 |
commit | fc56c220e2f73ad852c2507d4aee26e37b8b2ed1 (patch) | |
tree | a3507f3b193fde9731ecbc49b984faf0da4651e6 /mdk-stage1/modules.c | |
parent | d244ccf9730dd4e860734d0ff4115ed3613ac195 (diff) | |
download | drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar.gz drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar.bz2 drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar.xz drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.zip |
- try to handle the built-in module case before trying to load a module.
Diffstat (limited to 'mdk-stage1/modules.c')
-rw-r--r-- | mdk-stage1/modules.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index 5f02d2a6d..9cbb43598 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -30,6 +30,7 @@ #include <string.h> #include <stdio.h> #include <errno.h> +#include <time.h> #include <sys/utsname.h> #include "log.h" #include "utils.h" @@ -287,6 +288,8 @@ static void add_modules_conf(char * str) int module_already_present(const char * name) { FILE * f; + struct stat sb; + char *path; int answ = 0; if ((f = fopen("/proc/modules", "rb"))) { @@ -298,6 +301,14 @@ int module_already_present(const char * name) } fclose(f); } + + /* built-in module case. try to find them through sysfs */ + if (!answ) { + asprintf(&path, "/sys/module/%s", name); + if (!stat(path, &sb)) + answ = 1; + free(path); + } return answ; } |