summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-02-11 18:06:25 +0000
committerOlivier Blin <oblin@mandriva.com>2008-02-11 18:06:25 +0000
commit61596fc4838f41d2b488f71774077cb3581e43e2 (patch)
tree9ee23c8fd7b6f2136f91632924285b42348d0d77 /mdk-stage1
parentab173d9766d527baa7ec14c1240197ca1cb4db97 (diff)
downloaddrakx-61596fc4838f41d2b488f71774077cb3581e43e2.tar
drakx-61596fc4838f41d2b488f71774077cb3581e43e2.tar.gz
drakx-61596fc4838f41d2b488f71774077cb3581e43e2.tar.bz2
drakx-61596fc4838f41d2b488f71774077cb3581e43e2.tar.xz
drakx-61596fc4838f41d2b488f71774077cb3581e43e2.zip
factorize /modules
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/modules.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index 06165b10d..cd12f63bb 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -37,6 +37,7 @@
#include "modules.h"
+static char modules_directory = "/modules";
static struct module_deps_elem * modules_deps = NULL;
static struct module_descr_elem * modules_descr = NULL;
@@ -97,7 +98,7 @@ static void filename2modname(char * filename) {
static int load_modules_dependencies(void)
{
- char * deps_file = "/modules/modules.dep";
+ char * deps_file = asprintf_("%s/%s", modules_directory, "modules.dep");
char * buf, * ptr, * start, * end;
struct stat s;
int line, i;
@@ -162,7 +163,7 @@ static int load_modules_dependencies(void)
static int load_modules_descriptions(void)
{
- char * descr_file = "/modules/modules.description";
+ char * descr_file = asprintf_("%s/%s", modules_directory, "modules.description");
char * buf, * ptr, * start, * end;
struct stat s;
int line;
@@ -290,7 +291,7 @@ static enum insmod_return insmod_with_deps(const char * mod_name, char * options
log_message("needs %s", filename);
{
- char *file = asprintf_("/modules/%s%s", filename, kernel_module_extension());
+ char *file = asprintf_("%s/%s", modules_directory, kernel_module_extension());
return insmod_local_file(file, options);
}
}
@@ -386,7 +387,7 @@ enum return_type ask_insmod(enum driver_type type)
{
enum return_type results;
char * choice;
- char ** dlist = list_directory("/modules");
+ char ** dlist = list_directory(modules_directory);
char ** modules = alloca(sizeof(char *) * (string_array_length(dlist) + 1));
char ** descrs = alloca(sizeof(char *) * (string_array_length(dlist) + 1));
char ** p_dlist = dlist;