summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-02-13 15:17:50 +0000
committerOlivier Blin <oblin@mandriva.org>2006-02-13 15:17:50 +0000
commit32eae85faedb125bea5e99b576c8157394d7cf7d (patch)
tree5793aa5a67f3c3a2d3b4739b11d0066352b4e4e1
parentc95c2ff2abf1c5be7481c83064f1de659ac9dd96 (diff)
downloaddrakx-backup-do-not-use-32eae85faedb125bea5e99b576c8157394d7cf7d.tar
drakx-backup-do-not-use-32eae85faedb125bea5e99b576c8157394d7cf7d.tar.gz
drakx-backup-do-not-use-32eae85faedb125bea5e99b576c8157394d7cf7d.tar.bz2
drakx-backup-do-not-use-32eae85faedb125bea5e99b576c8157394d7cf7d.tar.xz
drakx-backup-do-not-use-32eae85faedb125bea5e99b576c8157394d7cf7d.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) {