2004-11-30 19:52:51

by Bebel

[permalink] [raw]
Subject: PROBLEM: misleading error message

This may be a BUG REPORT, as I see it, allthough more experienced Linux
users might think differently:

I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
legacy firewall does a "modprobe ip_tables" , I get the startling message:
"FATAL: module ip_tables not found" .
Please note that I am a Linux newbie and I think messages should help people
solve problems, but this particular message made me re-compile the kernel 2
more times ( stupid, huh ?) before I realized that iptables actually works,
though the message had me thinking it wasn't :))
The message was probably caused by modprobe trying to load ip_tables module
and not finding it, since support for it was built in the kernel (not as a
module).
So I find this message quite misleading, firstly because the error was in no
way "FATAL" (since iptables in fact WORKED) and secondly because it doesn't
tell the user that iptables was already supported by the kernel.
A message like "Module ip_tables not needed; support already built in the
kernel" would be much more helpfull, as I see it.

If it matters, I'm running Slackware 10.0 on a 500MHz Pentium 3 with 256MB
RAM and a basic iptables firewall, on which I did a kernel upgrade from
2.4.26 to 2.6.9 .
But this problem is common to many distros, as I could see on several
forums.

Best regards, Wussie .


2004-11-30 20:56:50

by Jan Engelhardt

[permalink] [raw]
Subject: Re: Misleading error message

>I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
>legacy firewall does a "modprobe ip_tables" , I get the startling message:
>"FATAL: module ip_tables not found" .
k

Linux Developers,

what would you think of say, a line added to modules' code that identifies
compiled-in components?
modprobe could then be adjusted to
1. try loading something.ko
2. looking for a component "something" within the compiled-in stuff

I'd imagine a module's init could look like:

int __init init_module(void) {
...
register_static_module("ip_tables");
...
}

Or using some linker magic to generate a table/array full with strings to
indicate their presence. (I though of kstrtab, which is, to my knowledge, also
composed of multiple single symbols into one.)

Awaiting list feedback.




>A message like "Module ip_tables not needed; support already built in the
>kernel" would be much more helpfull, as I see it.

modprobe should just return 0 as is with the case for already-loaded modules.



Jan Engelhardt
--
ENOSPC

2004-11-30 21:48:55

by Jesper Juhl

[permalink] [raw]
Subject: Re: PROBLEM: misleading error message

On Tue, 30 Nov 2004, Bebel wrote:

> This may be a BUG REPORT, as I see it, allthough more experienced Linux users
> might think differently:
>
> I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
> legacy firewall does a "modprobe ip_tables" , I get the startling message:
> "FATAL: module ip_tables not found" .

In my oppinion the message is perfectly clear. You told modprobe to load a
module, the file was not found so it is forced to give up - and that's
exactely what it told you.

modprobe knows nothing about the functionality provided by any given
module, it's only task in life is to attempt to load modules you tell it
to load. So, it cannot tell you that "I didn't find this and besides, you
don't need it since it's already build in", since modprobe does not have
that information.

All modprobe can do is try to load the module you told it to load, and
when the file is missing that *is* a fatal error from modrobes point of
view - it has absolutely no way to recover or give you any sane
diagnostics since it has no idea what the mystery module you asked it to
load that wasn't there was supposed to do.


--
Jesper Juhl


2004-11-30 22:10:43

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [RFC] misleading error message

>> This may be a BUG REPORT, as I see it, allthough more experienced Linux users
>> might think differently:
>>
>> I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
>> legacy firewall does a "modprobe ip_tables" , I get the startling message:
>> "FATAL: module ip_tables not found" .
>
>In my oppinion the message is perfectly clear. You told modprobe to load a
>module, the file was not found so it is forced to give up - and that's
>exactely what it told you.

So how would you go about finding out whether something is compiled-in?




Jan Engelhardt
--
ENOSPC

2004-11-30 22:19:32

by Jesper Juhl

[permalink] [raw]
Subject: Re: [RFC] misleading error message

On Tue, 30 Nov 2004, Jan Engelhardt wrote:

> >> This may be a BUG REPORT, as I see it, allthough more experienced Linux users
> >> might think differently:
> >>
> >> I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
> >> legacy firewall does a "modprobe ip_tables" , I get the startling message:
> >> "FATAL: module ip_tables not found" .
> >
> >In my oppinion the message is perfectly clear. You told modprobe to load a
> >module, the file was not found so it is forced to give up - and that's
> >exactely what it told you.
>
> So how would you go about finding out whether something is compiled-in?
>
Personally I'd just go check my kernels .config

--
Jesper Juhl


2004-11-30 22:27:28

by Phil Oester

[permalink] [raw]
Subject: Re: [RFC] misleading error message

On Tue, Nov 30, 2004 at 11:29:20PM +0100, Jesper Juhl wrote:
> On Tue, 30 Nov 2004, Jan Engelhardt wrote:
>
> > >> This may be a BUG REPORT, as I see it, allthough more experienced Linux users
> > >> might think differently:
> > >>
> > >> I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
> > >> legacy firewall does a "modprobe ip_tables" , I get the startling message:
> > >> "FATAL: module ip_tables not found" .
> > >
> > >In my oppinion the message is perfectly clear. You told modprobe to load a
> > >module, the file was not found so it is forced to give up - and that's
> > >exactely what it told you.
> >
> > So how would you go about finding out whether something is compiled-in?
> >
> Personally I'd just go check my kernels .config

Or adjust your (broken) firewall script to do something like:

[ -f /proc/net/ip_tables_names ] || modprobe ip_tables

Phil

2004-11-30 22:30:18

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [RFC] misleading error message

>> >> I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
>> >> legacy firewall does a "modprobe ip_tables" , I get the startling message:
>> >> "FATAL: module ip_tables not found" .
>> >
>> >In my oppinion the message is perfectly clear. You told modprobe to load a
>> >module, the file was not found so it is forced to give up - and that's
>> >exactely what it told you.
>>
>> So how would you go about finding out whether something is compiled-in?
>>
>Personally I'd just go check my kernels .config

Please, think of the newbies (tm)


2004-11-30 22:29:48

by Lee Revell

[permalink] [raw]
Subject: Re: [RFC] misleading error message

On Tue, 2004-11-30 at 23:29 +0100, Jesper Juhl wrote:
> >
> > So how would you go about finding out whether something is compiled-in?
> >
> Personally I'd just go check my kernels .config

zgrep CONFIG_FOO /proc/config.gz

This requires CONFIG_IKCONFIG_PROC. Many distros inexplicably do not
enable this by default.

Lee

2004-11-30 23:43:36

by Greg KH

[permalink] [raw]
Subject: Re: Misleading error message

On Tue, Nov 30, 2004 at 09:56:25PM +0100, Jan Engelhardt wrote:
> >I compiled built-in support for iptables in my new 2.6.9 kernel, but when my
> >legacy firewall does a "modprobe ip_tables" , I get the startling message:
> >"FATAL: module ip_tables not found" .
> k
>
> Linux Developers,
>
> what would you think of say, a line added to modules' code that identifies
> compiled-in components?

See the patches posted to lkml to have modules that are built into the
kernel show up in sysfs. Hopefully the remaining issues to that patch
are being addressed and then it will eventually make it into the main
kernel tree. That should help with this issue a lot.

thanks,

greg k-h