diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-12-19 21:04:19 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-12-19 21:04:19 +0000 |
commit | 03d8091859f45a6bb5e3aadc110b279e789399f2 (patch) | |
tree | 54c744aab1045bb9fa1348b108bb479cf84017bd /modutils/modprobe.c | |
parent | 514aeabc366d8763cb1e2437be80f3f13d135ec3 (diff) | |
download | busybox-w32-03d8091859f45a6bb5e3aadc110b279e789399f2.tar.gz busybox-w32-03d8091859f45a6bb5e3aadc110b279e789399f2.tar.bz2 busybox-w32-03d8091859f45a6bb5e3aadc110b279e789399f2.zip |
Patch from Woody Suwalski:
Erik, I think we have met online some time ago when I was in Corel/Rebel
Netwinder project....
Anyway, I would like to use BB on 2.6.0 initrd. 1.00-pre4 works OK, if
insmod is actually presented with a full path to the module. Otherwise -
problems (not to mention conflicts when 2.4 modutil is enabled)
Here are some patches for insmod and modprobe which try to walk around
the default ".o" module format for 2.2/2.4 modules (you have probably
noticed it is now .ko in 2.6 ;-)) Trying to steal as little space as
possible if 2.6 not enabled...
The modprobe is still not perfect on 2.6 - seems to be jamming on some
dependencies, but works with some (to be debugged). Anyway after the
patches it at least tries to work....
Will there be a 1.00-pre5 coming any time soon?
Thanks, Woody
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r-- | modutils/modprobe.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index d48f36ed1..6b4405a44 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -57,6 +57,7 @@ struct mod_list_t { | |||
57 | 57 | ||
58 | static struct dep_t *depend; | 58 | static struct dep_t *depend; |
59 | static int autoclean, show_only, quiet, do_syslog, verbose; | 59 | static int autoclean, show_only, quiet, do_syslog, verbose; |
60 | static int k_version; | ||
60 | 61 | ||
61 | int parse_tag_value ( char *buffer, char **ptag, char **pvalue ) | 62 | int parse_tag_value ( char *buffer, char **ptag, char **pvalue ) |
62 | { | 63 | { |
@@ -116,6 +117,7 @@ static struct dep_t *build_dep ( void ) | |||
116 | char *filename = buffer; | 117 | char *filename = buffer; |
117 | int continuation_line = 0; | 118 | int continuation_line = 0; |
118 | 119 | ||
120 | k_version = 0; | ||
119 | if ( uname ( &un )) | 121 | if ( uname ( &un )) |
120 | return 0; | 122 | return 0; |
121 | 123 | ||
@@ -123,6 +125,9 @@ static struct dep_t *build_dep ( void ) | |||
123 | if ( bb_strlen ( un.release ) > ( sizeof( buffer ) - 64 )) { | 125 | if ( bb_strlen ( un.release ) > ( sizeof( buffer ) - 64 )) { |
124 | return 0; | 126 | return 0; |
125 | } | 127 | } |
128 | if (un.release[0] == '2') { | ||
129 | k_version = un.release[2] - '0'; | ||
130 | } | ||
126 | 131 | ||
127 | strcpy ( filename, "/lib/modules/" ); | 132 | strcpy ( filename, "/lib/modules/" ); |
128 | strcat ( filename, un.release ); | 133 | strcat ( filename, un.release ); |
@@ -166,6 +171,12 @@ static struct dep_t *build_dep ( void ) | |||
166 | else | 171 | else |
167 | mods++; | 172 | mods++; |
168 | 173 | ||
174 | #if defined(CONFIG_FEATURE_2_6_MODULES) | ||
175 | if ((k_version > 4) && ( *(col-3) == '.' ) && | ||
176 | ( *(col-2) == 'k' ) && ( *(col-1) == 'o' )) | ||
177 | ext = 3; | ||
178 | else | ||
179 | #endif | ||
169 | if (( *(col-2) == '.' ) && ( *(col-1) == 'o' )) | 180 | if (( *(col-2) == '.' ) && ( *(col-1) == 'o' )) |
170 | ext = 2; | 181 | ext = 2; |
171 | 182 | ||
@@ -215,6 +226,12 @@ static struct dep_t *build_dep ( void ) | |||
215 | else | 226 | else |
216 | deps++; | 227 | deps++; |
217 | 228 | ||
229 | #if defined(CONFIG_FEATURE_2_6_MODULES) | ||
230 | if ((k_version > 4) && ( *(end-2) == '.' ) && *(end-1) == 'k' && | ||
231 | ( *end == 'o' )) | ||
232 | ext = 3; | ||
233 | else | ||
234 | #endif | ||
218 | if (( *(end-1) == '.' ) && ( *end == 'o' )) | 235 | if (( *(end-1) == '.' ) && ( *end == 'o' )) |
219 | ext = 2; | 236 | ext = 2; |
220 | 237 | ||
@@ -383,6 +400,13 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t * | |||
383 | 400 | ||
384 | // remove .o extension | 401 | // remove .o extension |
385 | lm = bb_strlen ( mod ); | 402 | lm = bb_strlen ( mod ); |
403 | |||
404 | #if defined(CONFIG_FEATURE_2_6_MODULES) | ||
405 | if ((k_version > 4) && ( mod [lm-3] == '.' ) && | ||
406 | ( mod [lm-2] == 'k' ) && ( mod [lm-1] == 'o' )) | ||
407 | mod [lm-3] = 0; | ||
408 | else | ||
409 | #endif | ||
386 | if (( mod [lm-2] == '.' ) && ( mod [lm-1] == 'o' )) | 410 | if (( mod [lm-2] == '.' ) && ( mod [lm-1] == 'o' )) |
387 | mod [lm-2] = 0; | 411 | mod [lm-2] = 0; |
388 | 412 | ||