summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1')
-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.c29
3 files changed, 17 insertions, 18 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 61908b07a..6f3b592e4 100644
--- a/mdk-stage1/insmod-busybox/insmod.c
+++ b/mdk-stage1/insmod-busybox/insmod.c
@@ -677,10 +677,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;
/*======================================================================*/
@@ -3411,6 +3411,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;
@@ -3478,10 +3479,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;
@@ -3521,6 +3524,7 @@ static void check_tainted_module(struct obj_file *f, char *m_name)
if (fd >= 0)
close(fd);
+#endif
}
void my_usage(void)
@@ -3670,17 +3674,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);