aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-01-24 23:34:48 +0000
committerEric Andersen <andersen@codepoet.org>2001-01-24 23:34:48 +0000
commitf5d5e77321ad32b3952dcdf21d14fd0ef3d4c1a9 (patch)
treebc91a3dbedbdfc52a5ade52815d241d2f1100082
parent26439a2991f81b52c93b1e81d16f328f359a6611 (diff)
downloadbusybox-w32-f5d5e77321ad32b3952dcdf21d14fd0ef3d4c1a9.tar.gz
busybox-w32-f5d5e77321ad32b3952dcdf21d14fd0ef3d4c1a9.tar.bz2
busybox-w32-f5d5e77321ad32b3952dcdf21d14fd0ef3d4c1a9.zip
more bugs fixed -- found doing regression testing
-Erik
-rw-r--r--Config.h30
-rw-r--r--applets/busybox.c63
-rw-r--r--busybox.c63
-rw-r--r--coreutils/ls.c8
-rw-r--r--insmod.c22
-rw-r--r--ls.c8
-rw-r--r--lsmod.c10
-rw-r--r--modutils/insmod.c22
-rw-r--r--modutils/lsmod.c10
-rwxr-xr-xtests/busybox.REGRESS.shbin4068 -> 4078 bytes
-rw-r--r--utility.c6
11 files changed, 115 insertions, 127 deletions
diff --git a/Config.h b/Config.h
index 22882b6c2..1df72f301 100644
--- a/Config.h
+++ b/Config.h
@@ -258,17 +258,11 @@
258//Turn on fbset readmode support 258//Turn on fbset readmode support
259//#define BB_FEATURE_FBSET_READMODE 259//#define BB_FEATURE_FBSET_READMODE
260// 260//
261// You must enable one or both of these features 261// Support insmod/lsmod/rmmod for post 2.1 kernels
262// Support installing modules from pre 2.1 kernels 262//#define BB_FEATURE_NEW_MODULE_INTERFACE
263//#define BB_FEATURE_INSMOD_OLD_KERNEL 263//
264// Support installing modules from kernel versions after 2.1.18 264// Support insmod/lsmod/rmmod for pre 2.1 kernels
265#define BB_FEATURE_INSMOD_NEW_KERNEL 265//#define BB_FEATURE_OLD_MODULE_INTERFACE
266//
267// You must enable one or both of these features
268// Support modules status from pre 2.1 kernels
269//#define BB_FEATURE_LSMOD_OLD_KERNEL
270// Support modules status from kernel versions after 2.1.18
271#define BB_FEATURE_LSMOD_NEW_KERNEL
272// 266//
273// Support module version checking 267// Support module version checking
274//#define BB_FEATURE_INSMOD_VERSION_CHECKING 268//#define BB_FEATURE_INSMOD_VERSION_CHECKING
@@ -308,7 +302,9 @@
308#ifdef BB_FEATURE_MOUNT_MTAB_SUPPORT 302#ifdef BB_FEATURE_MOUNT_MTAB_SUPPORT
309#define BB_MTAB 303#define BB_MTAB
310#endif 304#endif
311#endif 305#else
306#undef BB_MTAB
307#endif
312// 308//
313#if defined BB_FEATURE_SH_COMMAND_EDITING && defined BB_SH 309#if defined BB_FEATURE_SH_COMMAND_EDITING && defined BB_SH
314#define BB_CMDEDIT 310#define BB_CMDEDIT
@@ -320,12 +316,14 @@
320#endif 316#endif
321#endif 317#endif
322// 318//
323#ifdef BB_FEATURE_LINUXRC 319#if defined BB_FEATURE_LINUXRC || defined BB_LINUXRC
324#ifndef BB_INIT 320#ifndef BB_INIT
325#define BB_INIT 321#define BB_INIT
326#endif 322#endif
323#ifndef BB_LINUXRC
327#define BB_LINUXRC 324#define BB_LINUXRC
328#endif 325#endif
326#endif
329// 327//
330#ifdef BB_GZIP 328#ifdef BB_GZIP
331#ifndef BB_GUNZIP 329#ifndef BB_GUNZIP
@@ -369,8 +367,8 @@
369#endif 367#endif
370#endif 368#endif
371// 369//
372#if defined BB_INSMOD 370#if defined BB_INSMOD || defined BB_LSMOD
373#ifndef BB_FEATURE_INSMOD_OLD_KERNEL 371#ifndef BB_FEATURE_NEW_MODULE_INTERFACE
374#define BB_FEATURE_INSMOD_NEW_KERNEL 372#define BB_FEATURE_NEW_MODULE_INTERFACE
375#endif 373#endif
376#endif 374#endif
diff --git a/applets/busybox.c b/applets/busybox.c
index 0439fb566..5eb9dfa64 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -89,37 +89,6 @@ int main(int argc, char **argv)
89{ 89{
90 struct BB_applet search_applet, *applet; 90 struct BB_applet search_applet, *applet;
91 const char *s; 91 const char *s;
92 applet_name = "busybox";
93
94#ifdef BB_FEATURE_INSTALLER
95 /*
96 * This style of argument parsing doesn't scale well
97 * in the event that busybox starts wanting more --options.
98 * If someone has a cleaner approach, by all means implement it.
99 */
100 if (argc > 1 && (strcmp(argv[1], "--install") == 0)) {
101 int use_symbolic_links = 0;
102 int rc = 0;
103 char *busybox;
104
105 /* to use symlinks, or not to use symlinks... */
106 if (argc > 2) {
107 if ((strcmp(argv[2], "-s") == 0)) {
108 use_symbolic_links = 1;
109 }
110 }
111
112 /* link */
113 busybox = busybox_fullpath();
114 if (busybox) {
115 install_links(busybox, use_symbolic_links);
116 free(busybox);
117 } else {
118 rc = 1;
119 }
120 return rc;
121 }
122#endif /* BB_FEATURE_INSTALLER */
123 92
124 for (s = applet_name = argv[0]; *s != '\0';) { 93 for (s = applet_name = argv[0]; *s != '\0';) {
125 if (*s++ == '/') 94 if (*s++ == '/')
@@ -144,7 +113,7 @@ int main(int argc, char **argv)
144 exit((*(applet->main)) (argc, argv)); 113 exit((*(applet->main)) (argc, argv));
145 } 114 }
146 115
147 return(busybox_main(argc, argv)); 116 error_msg_and_die("applet not found\n");
148} 117}
149 118
150 119
@@ -152,6 +121,36 @@ int busybox_main(int argc, char **argv)
152{ 121{
153 int col = 0, len, i; 122 int col = 0, len, i;
154 123
124#ifdef BB_FEATURE_INSTALLER
125 /*
126 * This style of argument parsing doesn't scale well
127 * in the event that busybox starts wanting more --options.
128 * If someone has a cleaner approach, by all means implement it.
129 */
130 if (argc > 1 && (strcmp(argv[1], "--install") == 0)) {
131 int use_symbolic_links = 0;
132 int rc = 0;
133 char *busybox;
134
135 /* to use symlinks, or not to use symlinks... */
136 if (argc > 2) {
137 if ((strcmp(argv[2], "-s") == 0)) {
138 use_symbolic_links = 1;
139 }
140 }
141
142 /* link */
143 busybox = busybox_fullpath();
144 if (busybox) {
145 install_links(busybox, use_symbolic_links);
146 free(busybox);
147 } else {
148 rc = 1;
149 }
150 return rc;
151 }
152#endif /* BB_FEATURE_INSTALLER */
153
155 argc--; 154 argc--;
156 155
157 /* If we've already been here once, exit now */ 156 /* If we've already been here once, exit now */
diff --git a/busybox.c b/busybox.c
index 0439fb566..5eb9dfa64 100644
--- a/busybox.c
+++ b/busybox.c
@@ -89,37 +89,6 @@ int main(int argc, char **argv)
89{ 89{
90 struct BB_applet search_applet, *applet; 90 struct BB_applet search_applet, *applet;
91 const char *s; 91 const char *s;
92 applet_name = "busybox";
93
94#ifdef BB_FEATURE_INSTALLER
95 /*
96 * This style of argument parsing doesn't scale well
97 * in the event that busybox starts wanting more --options.
98 * If someone has a cleaner approach, by all means implement it.
99 */
100 if (argc > 1 && (strcmp(argv[1], "--install") == 0)) {
101 int use_symbolic_links = 0;
102 int rc = 0;
103 char *busybox;
104
105 /* to use symlinks, or not to use symlinks... */
106 if (argc > 2) {
107 if ((strcmp(argv[2], "-s") == 0)) {
108 use_symbolic_links = 1;
109 }
110 }
111
112 /* link */
113 busybox = busybox_fullpath();
114 if (busybox) {
115 install_links(busybox, use_symbolic_links);
116 free(busybox);
117 } else {
118 rc = 1;
119 }
120 return rc;
121 }
122#endif /* BB_FEATURE_INSTALLER */
123 92
124 for (s = applet_name = argv[0]; *s != '\0';) { 93 for (s = applet_name = argv[0]; *s != '\0';) {
125 if (*s++ == '/') 94 if (*s++ == '/')
@@ -144,7 +113,7 @@ int main(int argc, char **argv)
144 exit((*(applet->main)) (argc, argv)); 113 exit((*(applet->main)) (argc, argv));
145 } 114 }
146 115
147 return(busybox_main(argc, argv)); 116 error_msg_and_die("applet not found\n");
148} 117}
149 118
150 119
@@ -152,6 +121,36 @@ int busybox_main(int argc, char **argv)
152{ 121{
153 int col = 0, len, i; 122 int col = 0, len, i;
154 123
124#ifdef BB_FEATURE_INSTALLER
125 /*
126 * This style of argument parsing doesn't scale well
127 * in the event that busybox starts wanting more --options.
128 * If someone has a cleaner approach, by all means implement it.
129 */
130 if (argc > 1 && (strcmp(argv[1], "--install") == 0)) {
131 int use_symbolic_links = 0;
132 int rc = 0;
133 char *busybox;
134
135 /* to use symlinks, or not to use symlinks... */
136 if (argc > 2) {
137 if ((strcmp(argv[2], "-s") == 0)) {
138 use_symbolic_links = 1;
139 }
140 }
141
142 /* link */
143 busybox = busybox_fullpath();
144 if (busybox) {
145 install_links(busybox, use_symbolic_links);
146 free(busybox);
147 } else {
148 rc = 1;
149 }
150 return rc;
151 }
152#endif /* BB_FEATURE_INSTALLER */
153
155 argc--; 154 argc--;
156 155
157 /* If we've already been here once, exit now */ 156 /* If we've already been here once, exit now */
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 080768027..64e5bf828 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -171,6 +171,8 @@ static unsigned short column = 0;
171static unsigned short terminal_width; 171static unsigned short terminal_width;
172static unsigned short column_width; 172static unsigned short column_width;
173static unsigned short tabstops; 173static unsigned short tabstops;
174#else
175# define column_width COLUMN_WIDTH
174#endif 176#endif
175 177
176static int status = EXIT_SUCCESS; 178static int status = EXIT_SUCCESS;
@@ -236,7 +238,7 @@ static void nexttabstop( void )
236 column++; 238 column++;
237 } 239 }
238 } 240 }
239 nexttab= column + column_width + COLUMN_GAP ; 241 nexttab= column + column_width + COLUMN_GAP;
240} 242}
241 243
242/*----------------------------------------------------------------------*/ 244/*----------------------------------------------------------------------*/
@@ -429,8 +431,10 @@ void showfiles(struct dnode **dn, int nfiles)
429 ; 431 ;
430 if (column_width < len) column_width= len; 432 if (column_width < len) column_width= len;
431 } 433 }
432#endif
433 ncols= (int)(terminal_width / (column_width + COLUMN_GAP)); 434 ncols= (int)(terminal_width / (column_width + COLUMN_GAP));
435#else
436 ncols= TERMINAL_WIDTH;
437#endif
434 switch (style_fmt) { 438 switch (style_fmt) {
435 case STYLE_LONG: /* one record per line, extended info */ 439 case STYLE_LONG: /* one record per line, extended info */
436 case STYLE_SINGLE: /* one record per line */ 440 case STYLE_SINGLE: /* one record per line */
diff --git a/insmod.c b/insmod.c
index a134fea87..e52da91e4 100644
--- a/insmod.c
+++ b/insmod.c
@@ -78,7 +78,7 @@
78#ifndef MODUTILS_MODULE_H 78#ifndef MODUTILS_MODULE_H
79static const int MODUTILS_MODULE_H = 1; 79static const int MODUTILS_MODULE_H = 1;
80 80
81#ident "$Id: insmod.c,v 1.37 2001/01/24 19:07:09 andersen Exp $" 81#ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $"
82 82
83/* This file contains the structures used by the 2.0 and 2.1 kernels. 83/* This file contains the structures used by the 2.0 and 2.1 kernels.
84 We do not use the kernel headers directly because we do not wish 84 We do not use the kernel headers directly because we do not wish
@@ -284,7 +284,7 @@ int delete_module(const char *);
284#ifndef MODUTILS_OBJ_H 284#ifndef MODUTILS_OBJ_H
285static const int MODUTILS_OBJ_H = 1; 285static const int MODUTILS_OBJ_H = 1;
286 286
287#ident "$Id: insmod.c,v 1.37 2001/01/24 19:07:09 andersen Exp $" 287#ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $"
288 288
289/* The relocatable object is manipulated using elfin types. */ 289/* The relocatable object is manipulated using elfin types. */
290 290
@@ -519,10 +519,6 @@ int arch_init_module (struct obj_file *f, struct new_module *);
519#define _PATH_MODULES "/lib/modules" 519#define _PATH_MODULES "/lib/modules"
520static const int STRVERSIONLEN = 32; 520static const int STRVERSIONLEN = 32;
521 521
522#if !defined(BB_FEATURE_INSMOD_NEW_KERNEL) && !defined(BB_FEATURE_INSMOD_OLD_KERNEL)
523#error "Must have ether BB_FEATURE_INSMOD_NEW_KERNEL or BB_FEATURE_INSMOD_OLD_KERNEL defined"
524#endif
525
526/*======================================================================*/ 522/*======================================================================*/
527 523
528int flag_force_load = 0; 524int flag_force_load = 0;
@@ -615,7 +611,7 @@ extern int delete_module(const char *);
615 611
616 -- Bryan Rittmeyer <bryan@ixiacom.com> */ 612 -- Bryan Rittmeyer <bryan@ixiacom.com> */
617 613
618#ifdef BB_FEATURE_INSMOD_OLD_KERNEL 614#ifdef BB_FEATURE_OLD_MODULE_INTERFACE
619_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks) 615_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks)
620#endif 616#endif
621 617
@@ -1549,7 +1545,7 @@ old_get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
1549 1545
1550#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */ 1546#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */
1551 1547
1552#ifdef BB_FEATURE_INSMOD_OLD_KERNEL 1548#ifdef BB_FEATURE_OLD_MODULE_INTERFACE
1553 1549
1554/* Fetch all the symbols and divvy them up as appropriate for the modules. */ 1550/* Fetch all the symbols and divvy them up as appropriate for the modules. */
1555 1551
@@ -1757,7 +1753,7 @@ old_init_module(const char *m_name, struct obj_file *f,
1757#define old_create_mod_use_count(x) TRUE 1753#define old_create_mod_use_count(x) TRUE
1758#define old_init_module(x, y, z) TRUE 1754#define old_init_module(x, y, z) TRUE
1759 1755
1760#endif /* BB_FEATURE_INSMOD_OLD_KERNEL */ 1756#endif /* BB_FEATURE_OLD_MODULE_INTERFACE */
1761 1757
1762 1758
1763 1759
@@ -2036,7 +2032,7 @@ new_get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
2036#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */ 2032#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */
2037 2033
2038 2034
2039#ifdef BB_FEATURE_INSMOD_NEW_KERNEL 2035#ifdef BB_FEATURE_NEW_MODULE_INTERFACE
2040 2036
2041/* Fetch the loaded modules, and all currently exported symbols. */ 2037/* Fetch the loaded modules, and all currently exported symbols. */
2042 2038
@@ -2310,7 +2306,7 @@ new_init_module(const char *m_name, struct obj_file *f,
2310#define new_create_module_ksymtab(x) 2306#define new_create_module_ksymtab(x)
2311#define query_module(v, w, x, y, z) -1 2307#define query_module(v, w, x, y, z) -1
2312 2308
2313#endif /* BB_FEATURE_INSMOD_NEW_KERNEL */ 2309#endif /* BB_FEATURE_NEW_MODULE_INTERFACE */
2314 2310
2315 2311
2316/*======================================================================*/ 2312/*======================================================================*/
@@ -2997,7 +2993,7 @@ extern int insmod_main( int argc, char **argv)
2997 k_new_syscalls = !query_module(NULL, 0, NULL, 0, NULL); 2993 k_new_syscalls = !query_module(NULL, 0, NULL, 0, NULL);
2998 2994
2999 if (k_new_syscalls) { 2995 if (k_new_syscalls) {
3000#ifdef BB_FEATURE_INSMOD_NEW_KERNEL 2996#ifdef BB_FEATURE_NEW_MODULE_INTERFACE
3001 if (!new_get_kernel_symbols()) 2997 if (!new_get_kernel_symbols())
3002 goto out; 2998 goto out;
3003 k_crcs = new_is_kernel_checksummed(); 2999 k_crcs = new_is_kernel_checksummed();
@@ -3006,7 +3002,7 @@ extern int insmod_main( int argc, char **argv)
3006 goto out; 3002 goto out;
3007#endif 3003#endif
3008 } else { 3004 } else {
3009#ifdef BB_FEATURE_INSMOD_OLD_KERNEL 3005#ifdef BB_FEATURE_OLD_MODULE_INTERFACE
3010 if (!old_get_kernel_symbols(m_name)) 3006 if (!old_get_kernel_symbols(m_name))
3011 goto out; 3007 goto out;
3012 k_crcs = old_is_kernel_checksummed(); 3008 k_crcs = old_is_kernel_checksummed();
diff --git a/ls.c b/ls.c
index 080768027..64e5bf828 100644
--- a/ls.c
+++ b/ls.c
@@ -171,6 +171,8 @@ static unsigned short column = 0;
171static unsigned short terminal_width; 171static unsigned short terminal_width;
172static unsigned short column_width; 172static unsigned short column_width;
173static unsigned short tabstops; 173static unsigned short tabstops;
174#else
175# define column_width COLUMN_WIDTH
174#endif 176#endif
175 177
176static int status = EXIT_SUCCESS; 178static int status = EXIT_SUCCESS;
@@ -236,7 +238,7 @@ static void nexttabstop( void )
236 column++; 238 column++;
237 } 239 }
238 } 240 }
239 nexttab= column + column_width + COLUMN_GAP ; 241 nexttab= column + column_width + COLUMN_GAP;
240} 242}
241 243
242/*----------------------------------------------------------------------*/ 244/*----------------------------------------------------------------------*/
@@ -429,8 +431,10 @@ void showfiles(struct dnode **dn, int nfiles)
429 ; 431 ;
430 if (column_width < len) column_width= len; 432 if (column_width < len) column_width= len;
431 } 433 }
432#endif
433 ncols= (int)(terminal_width / (column_width + COLUMN_GAP)); 434 ncols= (int)(terminal_width / (column_width + COLUMN_GAP));
435#else
436 ncols= TERMINAL_WIDTH;
437#endif
434 switch (style_fmt) { 438 switch (style_fmt) {
435 case STYLE_LONG: /* one record per line, extended info */ 439 case STYLE_LONG: /* one record per line, extended info */
436 case STYLE_SINGLE: /* one record per line */ 440 case STYLE_SINGLE: /* one record per line */
diff --git a/lsmod.c b/lsmod.c
index 586920d63..41575585f 100644
--- a/lsmod.c
+++ b/lsmod.c
@@ -40,11 +40,7 @@
40 40
41 41
42 42
43#if !defined(BB_FEATURE_LSMOD_NEW_KERNEL) && !defined(BB_FEATURE_LSMOD_OLD_KERNEL) 43#ifdef BB_FEATURE_NEW_MODULE_INTERFACE
44#error "Must have ether BB_FEATURE_LSMOD_NEW_KERNEL or BB_FEATURE_LSMOD_OLD_KERNEL defined"
45#endif
46
47#ifdef BB_FEATURE_LSMOD_NEW_KERNEL
48 44
49struct module_info 45struct module_info
50{ 46{
@@ -132,7 +128,7 @@ extern int lsmod_main(int argc, char **argv)
132 return( 0); 128 return( 0);
133} 129}
134 130
135#else /*BB_FEATURE_LSMOD_OLD_KERNEL*/ 131#else /*BB_FEATURE_OLD_MODULE_INTERFACE*/
136 132
137#if ! defined BB_FEATURE_USE_PROCFS 133#if ! defined BB_FEATURE_USE_PROCFS
138#error Sorry, I depend on the /proc filesystem right now. 134#error Sorry, I depend on the /proc filesystem right now.
@@ -157,4 +153,4 @@ extern int lsmod_main(int argc, char **argv)
157 return 1; 153 return 1;
158} 154}
159 155
160#endif /*BB_FEATURE_LSMOD_OLD_KERNEL*/ 156#endif /*BB_FEATURE_OLD_MODULE_INTERFACE*/
diff --git a/modutils/insmod.c b/modutils/insmod.c
index a134fea87..e52da91e4 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -78,7 +78,7 @@
78#ifndef MODUTILS_MODULE_H 78#ifndef MODUTILS_MODULE_H
79static const int MODUTILS_MODULE_H = 1; 79static const int MODUTILS_MODULE_H = 1;
80 80
81#ident "$Id: insmod.c,v 1.37 2001/01/24 19:07:09 andersen Exp $" 81#ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $"
82 82
83/* This file contains the structures used by the 2.0 and 2.1 kernels. 83/* This file contains the structures used by the 2.0 and 2.1 kernels.
84 We do not use the kernel headers directly because we do not wish 84 We do not use the kernel headers directly because we do not wish
@@ -284,7 +284,7 @@ int delete_module(const char *);
284#ifndef MODUTILS_OBJ_H 284#ifndef MODUTILS_OBJ_H
285static const int MODUTILS_OBJ_H = 1; 285static const int MODUTILS_OBJ_H = 1;
286 286
287#ident "$Id: insmod.c,v 1.37 2001/01/24 19:07:09 andersen Exp $" 287#ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $"
288 288
289/* The relocatable object is manipulated using elfin types. */ 289/* The relocatable object is manipulated using elfin types. */
290 290
@@ -519,10 +519,6 @@ int arch_init_module (struct obj_file *f, struct new_module *);
519#define _PATH_MODULES "/lib/modules" 519#define _PATH_MODULES "/lib/modules"
520static const int STRVERSIONLEN = 32; 520static const int STRVERSIONLEN = 32;
521 521
522#if !defined(BB_FEATURE_INSMOD_NEW_KERNEL) && !defined(BB_FEATURE_INSMOD_OLD_KERNEL)
523#error "Must have ether BB_FEATURE_INSMOD_NEW_KERNEL or BB_FEATURE_INSMOD_OLD_KERNEL defined"
524#endif
525
526/*======================================================================*/ 522/*======================================================================*/
527 523
528int flag_force_load = 0; 524int flag_force_load = 0;
@@ -615,7 +611,7 @@ extern int delete_module(const char *);
615 611
616 -- Bryan Rittmeyer <bryan@ixiacom.com> */ 612 -- Bryan Rittmeyer <bryan@ixiacom.com> */
617 613
618#ifdef BB_FEATURE_INSMOD_OLD_KERNEL 614#ifdef BB_FEATURE_OLD_MODULE_INTERFACE
619_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks) 615_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks)
620#endif 616#endif
621 617
@@ -1549,7 +1545,7 @@ old_get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
1549 1545
1550#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */ 1546#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */
1551 1547
1552#ifdef BB_FEATURE_INSMOD_OLD_KERNEL 1548#ifdef BB_FEATURE_OLD_MODULE_INTERFACE
1553 1549
1554/* Fetch all the symbols and divvy them up as appropriate for the modules. */ 1550/* Fetch all the symbols and divvy them up as appropriate for the modules. */
1555 1551
@@ -1757,7 +1753,7 @@ old_init_module(const char *m_name, struct obj_file *f,
1757#define old_create_mod_use_count(x) TRUE 1753#define old_create_mod_use_count(x) TRUE
1758#define old_init_module(x, y, z) TRUE 1754#define old_init_module(x, y, z) TRUE
1759 1755
1760#endif /* BB_FEATURE_INSMOD_OLD_KERNEL */ 1756#endif /* BB_FEATURE_OLD_MODULE_INTERFACE */
1761 1757
1762 1758
1763 1759
@@ -2036,7 +2032,7 @@ new_get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
2036#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */ 2032#endif /* BB_FEATURE_INSMOD_VERSION_CHECKING */
2037 2033
2038 2034
2039#ifdef BB_FEATURE_INSMOD_NEW_KERNEL 2035#ifdef BB_FEATURE_NEW_MODULE_INTERFACE
2040 2036
2041/* Fetch the loaded modules, and all currently exported symbols. */ 2037/* Fetch the loaded modules, and all currently exported symbols. */
2042 2038
@@ -2310,7 +2306,7 @@ new_init_module(const char *m_name, struct obj_file *f,
2310#define new_create_module_ksymtab(x) 2306#define new_create_module_ksymtab(x)
2311#define query_module(v, w, x, y, z) -1 2307#define query_module(v, w, x, y, z) -1
2312 2308
2313#endif /* BB_FEATURE_INSMOD_NEW_KERNEL */ 2309#endif /* BB_FEATURE_NEW_MODULE_INTERFACE */
2314 2310
2315 2311
2316/*======================================================================*/ 2312/*======================================================================*/
@@ -2997,7 +2993,7 @@ extern int insmod_main( int argc, char **argv)
2997 k_new_syscalls = !query_module(NULL, 0, NULL, 0, NULL); 2993 k_new_syscalls = !query_module(NULL, 0, NULL, 0, NULL);
2998 2994
2999 if (k_new_syscalls) { 2995 if (k_new_syscalls) {
3000#ifdef BB_FEATURE_INSMOD_NEW_KERNEL 2996#ifdef BB_FEATURE_NEW_MODULE_INTERFACE
3001 if (!new_get_kernel_symbols()) 2997 if (!new_get_kernel_symbols())
3002 goto out; 2998 goto out;
3003 k_crcs = new_is_kernel_checksummed(); 2999 k_crcs = new_is_kernel_checksummed();
@@ -3006,7 +3002,7 @@ extern int insmod_main( int argc, char **argv)
3006 goto out; 3002 goto out;
3007#endif 3003#endif
3008 } else { 3004 } else {
3009#ifdef BB_FEATURE_INSMOD_OLD_KERNEL 3005#ifdef BB_FEATURE_OLD_MODULE_INTERFACE
3010 if (!old_get_kernel_symbols(m_name)) 3006 if (!old_get_kernel_symbols(m_name))
3011 goto out; 3007 goto out;
3012 k_crcs = old_is_kernel_checksummed(); 3008 k_crcs = old_is_kernel_checksummed();
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 586920d63..41575585f 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -40,11 +40,7 @@
40 40
41 41
42 42
43#if !defined(BB_FEATURE_LSMOD_NEW_KERNEL) && !defined(BB_FEATURE_LSMOD_OLD_KERNEL) 43#ifdef BB_FEATURE_NEW_MODULE_INTERFACE
44#error "Must have ether BB_FEATURE_LSMOD_NEW_KERNEL or BB_FEATURE_LSMOD_OLD_KERNEL defined"
45#endif
46
47#ifdef BB_FEATURE_LSMOD_NEW_KERNEL
48 44
49struct module_info 45struct module_info
50{ 46{
@@ -132,7 +128,7 @@ extern int lsmod_main(int argc, char **argv)
132 return( 0); 128 return( 0);
133} 129}
134 130
135#else /*BB_FEATURE_LSMOD_OLD_KERNEL*/ 131#else /*BB_FEATURE_OLD_MODULE_INTERFACE*/
136 132
137#if ! defined BB_FEATURE_USE_PROCFS 133#if ! defined BB_FEATURE_USE_PROCFS
138#error Sorry, I depend on the /proc filesystem right now. 134#error Sorry, I depend on the /proc filesystem right now.
@@ -157,4 +153,4 @@ extern int lsmod_main(int argc, char **argv)
157 return 1; 153 return 1;
158} 154}
159 155
160#endif /*BB_FEATURE_LSMOD_OLD_KERNEL*/ 156#endif /*BB_FEATURE_OLD_MODULE_INTERFACE*/
diff --git a/tests/busybox.REGRESS.sh b/tests/busybox.REGRESS.sh
index a5a31ad77..00deaf26f 100755
--- a/tests/busybox.REGRESS.sh
+++ b/tests/busybox.REGRESS.sh
Binary files differ
diff --git a/utility.c b/utility.c
index 6b637de04..50bf507b8 100644
--- a/utility.c
+++ b/utility.c
@@ -137,7 +137,7 @@ extern void perror_msg_and_die(const char *s, ...)
137 exit(EXIT_FAILURE); 137 exit(EXIT_FAILURE);
138} 138}
139 139
140#if defined BB_INIT || defined BB_MKSWAP || defined BB_MOUNT 140#if defined BB_INIT || defined BB_MKSWAP || defined BB_MOUNT || defined BB_NFSMOUNT
141/* Returns kernel version encoded as major*65536 + minor*256 + patch, 141/* Returns kernel version encoded as major*65536 + minor*256 + patch,
142 * so, for example, to check if the kernel is greater than 2.2.11: 142 * so, for example, to check if the kernel is greater than 2.2.11:
143 * if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> } 143 * if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> }
@@ -1386,7 +1386,7 @@ extern void *xcalloc(size_t nmemb, size_t size)
1386} 1386}
1387#endif 1387#endif
1388 1388
1389#if defined BB_FEATURE_NFSMOUNT || defined BB_LS || defined BB_SH || defined BB_WGET 1389#if defined BB_NFSMOUNT || defined BB_LS || defined BB_SH || defined BB_WGET
1390# ifndef DMALLOC 1390# ifndef DMALLOC
1391extern char * xstrdup (const char *s) { 1391extern char * xstrdup (const char *s) {
1392 char *t; 1392 char *t;
@@ -1404,7 +1404,7 @@ extern char * xstrdup (const char *s) {
1404# endif 1404# endif
1405#endif 1405#endif
1406 1406
1407#if defined BB_FEATURE_NFSMOUNT 1407#if defined BB_NFSMOUNT
1408extern char * xstrndup (const char *s, int n) { 1408extern char * xstrndup (const char *s, int n) {
1409 char *t; 1409 char *t;
1410 1410