Commit Graph

72 Commits

Author SHA1 Message Date
Denis Vlasenko
d3d004dd35 last nail into error_msg() (de)capitalization 2006-10-27 09:02:31 +00:00
Denis Vlasenko
d18a3a20db use skip_whitespace where appropriate 2006-10-25 12:46:03 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Rob Landley
4b5827a69b Patch from Yann Morin so modprobe won't return failure if the module gets
loaded while it's running (ala multi-device hotplug).
2006-08-22 23:50:11 +00:00
Rob Landley
081e38483e Remove xcalloc() and convert its callers to xzalloc(). About half of them
were using "1" as one of the arguments anyway, and as for the rest a multiply
and a push isn't noticeably bigger than pushing two arguments on the stack.
2006-08-03 20:07:35 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
Rob Landley
bf30c69a38 Patch from Yann Morin to fix bug 941, underscores in module aliases. 2006-07-20 17:36:18 +00:00
Rob Landley
3b0cfb40a5 Patch from Yann Morin to look for modules.conf in the right place on 2.6.
Fixes http://bugs.busybox.net/view.php?id=942
2006-07-19 21:33:42 +00:00
Mike Frysinger
135cee3741 Jean Wolter writes: modprobe checks, whether a module is already loaded. The function used for this currently always returns 0. 2006-06-21 23:03:37 +00:00
Rob Landley
d760560c52 Attempt at fixing bug 836, vaguely based on patch from somebody named
clausmuus, forwarded to me by Yann E. Morin.
2006-06-14 01:51:16 +00:00
Rob Landley
c7ddefc062 Attempt at fixing bug 815 by upgrading bb_spawn() so that builtins are at
the start of the path.  (This should be under the same config option as
the standalone shell, but right now that's buried in the shell menu.)

Also add the ability to specify CONFIG_BUSYBOX_EXEC_PATH with /proc/self/exe
as an overrideable default.
2006-06-14 01:24:33 +00:00
Bernhard Reutner-Fischer
deda6a5c0d - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
- remove two supposedly superfluous newlines from ...error_msg() in modprobe
  and use shorter boilerplate while at it.
2006-06-03 19:35:15 +00:00
Bernhard Reutner-Fischer
2c351a8f98 - patch from Yann E. Morin: makes modprobe understand shell patterns
(especially '*') in module aliases, such as:
  "alias usb:v0582p0075d*dc*dsc*dp*ic*isc*ip* snd_usb_audio"

Fixes bug #889

 842162	  10244	 645924	1498330	 16dcda	busybox.old-4.1.20060603-1948
 842178	  10244	 645924	1498346	 16dcea	busybox.new-4.1.20060603-1948
2006-06-03 19:08:49 +00:00
Bernhard Reutner-Fischer
e3c150bc67 - cleanup memory if opening aliases failed and cleanup was requested. 2006-05-19 11:24:28 +00:00
Rob Landley
3afb070e6d Avoid a memory leak pointed out by Lucas C. Villa Real. 2006-05-18 20:41:43 +00:00
Rob Landley
a389651115 Remove bb_strlen() in favor of -fno-builtin-strlen. Saves as many bytes
as the old optimization did (actually does slightly better under gcc 4.0), and
simplifies the code.
2006-05-07 20:20:34 +00:00
Rob Landley
72615752db Modprobe update from Ignacio García Pérez, updating support for modprobe.conf. 2006-04-10 16:09:52 +00:00
Bernhard Reutner-Fischer
101a470068 - make append_option and multiconvert static. 2006-04-03 15:46:14 +00:00
Rob Landley
dfba741457 Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions.  (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
"Vladimir N. Oleynik"
4fc92206ed destroy bug 679, use getopt_ulflags with new feature: usage option. Removed two strdup 2006-02-02 14:48:54 +00:00
Rob Landley
199501f2a0 I screwed up the last commit: if dt is null when ENABLE_MULTIPLE_OPTIONS is
off, we'd dereference the null.  Oops.
2005-12-16 06:18:06 +00:00
Rob Landley
ae50c6d8ee Better use of the ENABLE guards. 2005-12-15 07:42:13 +00:00
Bernhard Reutner-Fischer
17d355cb3c - remove warning (thanks Yann E. MORIN) and switch to ENABLE_
- typo: s/begining/beginning/g
2005-12-14 08:32:44 +00:00
Rob Landley
3858bf18d5 Minor fix: if(CONFIG) breaks the build when that CONFIG is disabled, it has
to be if(ENABLE).  (Make allbareconfig is a good testing thing.)
2005-12-13 04:06:22 +00:00
Rob Landley
e919096271 Patch from Yann E. Morin, something to do with bugs 276 and 272. 2005-12-12 19:38:44 +00:00
Rob Landley
37310ea057 Change CONFIG_MODPROBE_MULTIPOLE_OPTIONS to
CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS.
2005-12-12 04:28:17 +00:00
Rob Landley
79e1cab0d1 Yann Morin's modprobe multiple options patch. There's more work to be done,
but let's ship 1.1 first...
2005-11-15 00:08:29 +00:00
Paul Fox
8eeb655661 applying jim bauer's patch to eliminate modprobe's dependency
on /bin/sh.  bug #8.
     0000008: modprobe applet is dependent on having a shell
2005-08-04 18:33:36 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Glenn L McGrath
bdf6319d3a Patch from Egor Duda
Attached patch prevents modprobe from trying to call 'insmod (null)'
whenever nonexistent module is either passed to modprobe via command
line or mentioned in modules.dep

this replaces cryptic error
sh: Syntax error: word unexpected (expecting ")")
with
modprobe: module some-module not found.

egor.
2004-09-24 09:18:55 +00:00
Eric Andersen
807bd846b6 Patch from Mike Castle to cleanup some modutils issues, in
particular making alias support work better.
2004-08-19 18:30:31 +00:00
Eric Andersen
e3a792c80c Only pass modprobe module params with 2.6.x kernel support.
-Erik
2004-08-16 10:22:34 +00:00
Eric Andersen
beaef16315 Christian Ostheimer writes:
Hello,

function build_dep in modprobe.c assumes that dependencies of one module
have not more than 255 chars;
that is not sufficient in kernel 2.6.7 (alsa sound modules). - Below is
a diff that solves the problem for me.

With regards, Christian Ostheimer
2004-08-14 20:57:33 +00:00
Glenn L McGrath
fcf47321d4 Patch from Mike Castle, dont print an empty line (patch modified by me to
change formatting).
2004-08-11 05:56:30 +00:00
Glenn L McGrath
d2c6f9a1f9 Patch from Phil Blundellto improve substring match 2004-08-11 02:32:18 +00:00
Glenn L McGrath
65c8c7ba27 Willian Barsse wrote
"There seems to be a slight problem with the "mod_strcmp" function in
modprobe.c, it scans for the first occurence of the module name in the
"mod_path" variable and expects it to be the last path element. ie
/lib/modules/2.4.22-debug/kernel/fs/vfat in my example. The comparison
will always fail if mod_path contains another substring matching the
module name."

Robert McQueen wrote
"Although William Barsse's patch fixed mod_strcmp for 2.4 kernels, there
was a remaining problem which prevented it from working for me. I've
just tracked it down - when you enable kernel 2.6 module support it
hard-wired the extension to .ko instead of checking at runtime like the
other places where 2.4 differs from 2.6. The attached patch fixes this
for me."
2004-08-11 02:30:30 +00:00
Eric Andersen
44b5758247 William Barsse writes:
fixes two other issues (plus the previous as well) with a 2.4 kernel :

- should be able to modprobe an already loaded module and get 0 return
code :
# modprobe <something> && modprobe <something> && echo "ok" || echo "failed"
....
failed

Well, hope this helps and that I didn't screw up again,
- William
2004-08-03 08:23:33 +00:00
Robert Griebl
36a836d564 Patch from Mike Snitzer <snitzer@gmail.com>:
Support for /etc/modprobe.conf (for 2.6 kernels) should likely be added
to bb's modprobe, see attached patch.

modprobe.conf is just a (even simpler) variant of modules.conf
2004-07-22 00:03:39 +00:00
Eric Andersen
d943837dab Patrick Huesmann writes:
Hi,

    There was some problem with busybox modprobe. For details see
    http://www.busybox.net/lists/busybox/2004-May/011507.html

    I made a patch against busybox-1.00-pre10 to fix that one.

This is a slight variant of Patrick's patch with a slightly
cleaner implementation of mod_strcmp()
 -Erik
2004-06-22 10:43:09 +00:00
Eric Andersen
7e496a71cf Michael Tokarev, mjt at tls dot msk dot ru writes:
Fix parsing of all tag-value pairs (in modules.conf in particular).
Without this fix, code chokes badly on lines where either value or
both tag+value are missing, like bare
 alias
line, or alias w/o the value like
 alias some-module
(syntactically incorrect, but no need for coredumps either).
2004-04-06 12:06:03 +00:00
Eric Andersen
d298bd1d51 Michael Tokarev, mjt at tls dot msk dot ru writes:
alias 'off' parsing fix.
It is not
 alias off module
it is
 alias module off
2004-04-06 12:05:04 +00:00
Eric Andersen
ba05e79815 Michael Tokarev, mjt at tls dot msk dot ru writes:
Initialize all fields of struct dep_t.
Without that, e.g. `busybox modprobe -v char-major-10-144' *sometimes*
fails this way (strace):

 write(1, "insmod    nvram `\213\f\10\n", 21) = 21

Note the garbage after module name which is taken from the m_options field,
which is not initialized in the alias reading/parsing part.
(Shell properly complains to this command, telling it can't find the
closing backtick)
2004-04-06 12:04:14 +00:00
Eric Andersen
716ccb2635 whitespace cleanup 2004-01-10 11:29:31 +00:00
Eric Andersen
8e2f74f5a7 Woody Suwalski writes:
I have found the problem in modprobe, so here is the promised patch
At the current stage I can use it as modprobe while switching between
2.4 and 2.6 seemlesly...(that is good!)
2004-01-10 11:25:53 +00:00
Eric Andersen
9d65ab2beb Woody Suwalski writes:
accept more then 1 dependency per modules.dep line. Also white space cleanup...
I think that parsing still breaks sometimes, but is mostly functional now.
2004-01-06 00:07:17 +00:00
Eric Andersen
3b1a74467a re-indent 2003-12-24 20:30:45 +00:00
Eric Andersen
03d8091859 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
2003-12-19 21:04:19 +00:00
Eric Andersen
61b038accc Steven Seeger writes:
Hey guys. I've found a bug in modprobe where it generates bad strings and
makes sytem calls with them. The following patch seems to have fixed the
problem. It is rather inherited elsewhere, as there seems to be incorrect
entries in the list which results in more dependencies than really exist for
a given call to mod_process. But, this patch prevents the bad text from
going to the screen. You will notice there are cases where lcmd goes
unmodified before calling system.

Please consider the following patch.

Thanks.

-Steve
2003-11-14 02:49:19 +00:00