From 68ad02b6a17b8be25f3f1761906f6257d8bc3813 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 13 Feb 2006 15:25:46 +0000 Subject: try to find modules in a sub-directory named by the kernel release --- mdk-stage1/thirdparty.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 #include #include +#include #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) { -- cgit v1.2.1