summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-02-13 15:25:46 +0000
committerOlivier Blin <oblin@mandriva.org>2006-02-13 15:25:46 +0000
commit68ad02b6a17b8be25f3f1761906f6257d8bc3813 (patch)
treed4b2bdf09c7dd58c91c1e44a2c1bd9338922c273
parent0e7a787af13e954ecff8d0190b659195aadcb1ff (diff)
downloaddrakx-backup-do-not-use-68ad02b6a17b8be25f3f1761906f6257d8bc3813.tar
drakx-backup-do-not-use-68ad02b6a17b8be25f3f1761906f6257d8bc3813.tar.gz
drakx-backup-do-not-use-68ad02b6a17b8be25f3f1761906f6257d8bc3813.tar.bz2
drakx-backup-do-not-use-68ad02b6a17b8be25f3f1761906f6257d8bc3813.tar.xz
drakx-backup-do-not-use-68ad02b6a17b8be25f3f1761906f6257d8bc3813.zip
try to find modules in a sub-directory named by the kernel release
-rw-r--r--mdk-stage1/thirdparty.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/mdk-stage1/thirdparty.c b/mdk-stage1/thirdparty.c
index 176a24f1c..f6b694707 100644
--- a/mdk-stage1/thirdparty.c
+++ b/mdk-stage1/thirdparty.c
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>
+#include <sys/utsname.h>
#include "stage1.h"
#include "log.h"
@@ -312,9 +313,11 @@ static enum return_type thirdparty_autoload_modules(const char *modules_location
static enum return_type thirdparty_try_directory(char * root_directory, int interactive) {
char modules_location[100];
+ char modules_location_release[100];
char list_filename[50];
FILE *f_load, *f_detect;
- char **modules_list;
+ char **modules_list, **modules_list_release;
+ struct utsname kernel_uname;
/* look first in the specific third-party directory */
strcpy(modules_location, root_directory);
@@ -332,6 +335,19 @@ static enum return_type thirdparty_try_directory(char * root_directory, int inte
add_to_env("THIRDPARTY_DIR", THIRDPARTY_DIRECTORY);
}
+ if (uname(&kernel_uname)) {
+ log_perror("uname failed");
+ return RETURN_ERROR;
+ }
+ strcpy(modules_location_release, modules_location);
+ strcat(modules_location_release, "/");
+ strcat(modules_location_release, kernel_uname.release);
+ modules_list_release = list_directory(modules_location_release);
+ if (modules_list_release && modules_list_release[0]) {
+ strcpy(modules_location, modules_location_release);
+ modules_list = modules_list_release;
+ }
+
log_message("third party: using modules location %s", modules_location);
if (!modules_list || !*modules_list) {