summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/modules.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-01-26 17:52:48 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-01-26 17:52:48 +0000
commita4881f694ad7396181d836767edc0f4761667237 (patch)
treead2c16aca6858dbcb34ea6e898955d3da35f4c7b /mdk-stage1/modules.c
parente40f378821be25ae4667d311cf3bf3374fe63e0d (diff)
downloaddrakx-a4881f694ad7396181d836767edc0f4761667237.tar
drakx-a4881f694ad7396181d836767edc0f4761667237.tar.gz
drakx-a4881f694ad7396181d836767edc0f4761667237.tar.bz2
drakx-a4881f694ad7396181d836767edc0f4761667237.tar.xz
drakx-a4881f694ad7396181d836767edc0f4761667237.zip
- use bzlib instead of zlib to reduce overall size
- take home my own bzlib code to (1) reduce code size with good compile options (2) make it compile and link against dietlibc
Diffstat (limited to 'mdk-stage1/modules.c')
-rw-r--r--mdk-stage1/modules.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index 3db4ed713..c6bdb4afb 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -19,7 +19,12 @@
*/
#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
#include "insmod-busybox/insmod.h"
#include "stage1.h"
#include "log.h"
@@ -31,7 +36,6 @@
static struct module_deps_elem * modules_deps = NULL;
static char * archive_name = "/modules/modules.mar";
-static struct mar_stream s = { 0, NULL, NULL };
static int disable_modules = 0;
@@ -46,7 +50,7 @@ static int insmod_archived_file(const char * mod_name, char * options)
strncpy(module_name, mod_name, sizeof(module_name));
strcat(module_name, ".o");
- i = mar_extract_file(&s, module_name, "/tmp/");
+ i = mar_extract_file(archive_name, module_name, "/tmp/");
if (i == 1) {
log_message("file-not-found-in-archive %s", module_name);
return -1;
@@ -155,7 +159,7 @@ static int load_modules_dependencies(void)
void init_modules_insmoding(void)
{
- if (load_modules_dependencies() || mar_open_file(archive_name, &s)) {
+ if (load_modules_dependencies()) {
log_message("warning, error initing modules stuff, modules loading disabled");
disable_modules = 1;
}
@@ -321,7 +325,7 @@ enum return_type ask_insmod(enum driver_type type)
snprintf(msg, sizeof(msg), "Which driver should I try to gain %s access?", mytype);
- results = ask_from_list(msg, mar_list_contents(&s), &choice);
+ results = ask_from_list(msg, mar_list_contents(archive_name), &choice);
if (results == RETURN_OK) {
choice[strlen(choice)-2] = '\0'; /* remove trailing .o */