summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-04-16 21:37:05 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-04-16 21:37:05 +0000
commitda420aa56a702dde224d968626bc77e0cf54d705 (patch)
treeb683c754ff0cd1ba2a12e04ec74304ac263b699a
parentabe9d9277308a9dad0d386a7d6af4820c14ed625 (diff)
downloaddrakx-da420aa56a702dde224d968626bc77e0cf54d705.tar
drakx-da420aa56a702dde224d968626bc77e0cf54d705.tar.gz
drakx-da420aa56a702dde224d968626bc77e0cf54d705.tar.bz2
drakx-da420aa56a702dde224d968626bc77e0cf54d705.tar.xz
drakx-da420aa56a702dde224d968626bc77e0cf54d705.zip
Merge back fixes from HEAD but don't use the init_module() et al. tricks
since correct dietlibc 0.22 is used on the branch.
-rw-r--r--mdk-stage1/insmod-busybox/Config.h4
-rw-r--r--mdk-stage1/insmod-busybox/busybox.h2
-rw-r--r--mdk-stage1/insmod-busybox/insmod.c35
3 files changed, 22 insertions, 19 deletions
diff --git a/mdk-stage1/insmod-busybox/Config.h b/mdk-stage1/insmod-busybox/Config.h
index 04685f6d7..f02ac0253 100644
--- a/mdk-stage1/insmod-busybox/Config.h
+++ b/mdk-stage1/insmod-busybox/Config.h
@@ -127,7 +127,7 @@
#endif
//
#if defined BB_INSMOD
-#ifndef BB_FEATURE_INSMOD_OLD_KERNEL
-#define BB_FEATURE_INSMOD_NEW_KERNEL
+#if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
+#define BB_FEATURE_NEW_MODULE_INTERFACE
#endif
#endif
diff --git a/mdk-stage1/insmod-busybox/busybox.h b/mdk-stage1/insmod-busybox/busybox.h
index e01ff76f5..9e6052fce 100644
--- a/mdk-stage1/insmod-busybox/busybox.h
+++ b/mdk-stage1/insmod-busybox/busybox.h
@@ -464,7 +464,7 @@ extern int sysinfo (struct sysinfo* info);
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
#endif
-/* Merge from busybox 0.65.0 */
+/* Merge from busybox 0.60.5 */
#define error_msg errorMsg
#define perror_msg(FORMAT,...) error_msg(FORMAT ": %s", ## __VA_ARGS__, strerror(errno))
#define recursive_action recursiveAction
diff --git a/mdk-stage1/insmod-busybox/insmod.c b/mdk-stage1/insmod-busybox/insmod.c
index 52900fbeb..e86054f97 100644
--- a/mdk-stage1/insmod-busybox/insmod.c
+++ b/mdk-stage1/insmod-busybox/insmod.c
@@ -3,7 +3,7 @@
* Mini insmod implementation for busybox
*
* This version of insmod supports x86, ARM, SH3/4, powerpc, m68k,
- * and MIPS.
+ * MIPS, and x86-64.
*
*
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
@@ -637,10 +637,10 @@ static const int STRVERSIONLEN = 32;
/*======================================================================*/
-static int flag_force_load = 1;
-static int flag_autoclean = 0;
-static int flag_quiet = 0;
-static int flag_export = 1;
+static const int flag_force_load = 1;
+static const int flag_autoclean = 0;
+static const int flag_quiet = 0;
+static const int flag_export = 1;
/*======================================================================*/
@@ -721,6 +721,10 @@ static int n_ext_modules;
static int n_ext_modules_used;
extern int delete_module(const char *);
+#ifndef FILENAME_MAX
+#define FILENAME_MAX 4095
+#endif
+
static char m_filename[FILENAME_MAX];
static char m_fullName[FILENAME_MAX];
@@ -3367,6 +3371,7 @@ static void hide_special_symbols(struct obj_file *f)
ELFW(ST_INFO) (STB_LOCAL, ELFW(ST_TYPE) (sym->info));
}
+#ifdef BB_FEATURE_INSMOD_CHECK_TAINTED
static int obj_gpl_license(struct obj_file *f, const char **license)
{
struct obj_section *sec;
@@ -3434,10 +3439,12 @@ static void set_tainted(struct obj_file *f, int fd, char *m_name,
write(fd, buf, strlen(buf));
}
}
+#endif
/* Check if loading this module will taint the kernel. */
static void check_tainted_module(struct obj_file *f, char *m_name)
{
+#ifdef BB_FEATURE_INSMOD_CHECK_TAINTED
static const char tainted_file[] = TAINT_FILENAME;
int fd, kernel_has_tainted;
const char *ptr;
@@ -3477,6 +3484,7 @@ static void check_tainted_module(struct obj_file *f, char *m_name)
if (fd >= 0)
close(fd);
+#endif
}
void my_usage(void)
@@ -3626,17 +3634,12 @@ extern int insmod_main( int argc, char **argv)
obj_allocate_commons(f);
check_tainted_module(f, m_name);
- /* done with the module name, on to the optional var=value arguments */
- ++optind;
-
- if (optind < argc) {
- if (m_has_modinfo
- ? !new_process_module_arguments(f, argc - optind, argv + optind)
- : !old_process_module_arguments(f, argc - optind, argv + optind))
- {
- goto out;
- }
- }
+ if (m_has_modinfo
+ ? !new_process_module_arguments(f, argc - 1, argv + 1)
+ : !old_process_module_arguments(f, argc - 1, argv + 1))
+ {
+ goto out;
+ }
arch_create_got(f);
hide_special_symbols(f);