Skip to contentSkip to conversation

PROBLEM: misleading error message

DISCUSSION Bebel 9 participants 13 messages Nov 30, 2004 – Dec 5, 2004

lore
Share & tools
lore

Bebel

author
#0 lore raw

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 .

#1 lore raw

Re: Misleading error message

Quoted 3 lines

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.

Quoted 2 lines

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

Signature · 1 line
ENOSPC
#2 lore raw

Re: Misleading error message

Quoted 9 lines · Jan Engelhardt
Quoted 3 lines

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

#3 lore raw
In reply to Bebel
Quoted 6 lines · Bebel

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.

Signature · 1 line
Jesper Juhl
#4 lore raw

Re: [RFC] misleading error message

Quoted 10 lines
Quoted 6 lines

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

Signature · 1 line
ENOSPC
#5 lore raw

Re: [RFC] misleading error message

Quoted 7 lines · Jan Engelhardt
Quoted 7 lines
Quoted 6 lines

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" .

Quoted 6 lines
Quoted 3 lines

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

Signature · 1 line
Jesper Juhl
#6 lore raw

Re: [RFC] misleading error message

Quoted 9 lines · Jesper Juhl
Quoted 7 lines · Jan Engelhardt
Quoted 7 lines
Quoted 6 lines

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" .

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

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

#7 lore raw

Re: [RFC] misleading error message

In reply to Jesper Juhl
Quoted 4 lines · Jesper Juhl
Quoted 3 lines

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

#8 lore raw

Re: [RFC] misleading error message

In reply to Jesper Juhl
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

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)

#9 lore raw

Re: [RFC] misleading error message

Random side thoughts..

a) is there a simple way to search for symbols in a running kernel's memory area that
b) can differentiate between module and static, and if so
c) is there an interest in a tiny tool that scripts could use to determine existing support?

I want to be able to request information about a whooplesnoople without it triggering a module load request, to determine if it's compiled in statically. I want to be able to distinguish static a static whooplesnoople from a modularly loaded whooplesnoople.

i.e.
Scott ~$ kernfunctionexists "iptables"
builtin

Other possible values:
module
not found

The tool would do the work of doing a lookup on "iptables" to match it with a certain name. I.e "irda" would be resolved to a known proper irda_function_name() value.

The purpose of this is not to be able to research any given function name in the kernel, but to look for major support functions such as iptables.

David

#10 lore raw

Re: [RFC] misleading error message

Quoted 8 lines · David Ford

Random side thoughts..

a) is there a simple way to search for symbols in a running kernel's memory area that
b) can differentiate between module and static, and if so
c) is there an interest in a tiny tool that scripts could use to determine existing support?

Take a look in /proc/kallsyms when you have a module loaded. The
addresses are nowhere near the rest of the kernel, and the module names appear in square brackets at the end of the lines, so something like

grep '\[natsemi\]' /proc/kallsyms

will find out if the natsemi driver is loaded.

Ken

Signature · 1 line
 das eine Mal als Tragödie, das andere Mal als Farce
#11 lore raw

Re: [RFC] misleading error message

Quoted 11 lines
Quoted 8 lines

Random side thoughts..

a) is there a simple way to search for symbols in a running kernel's memory area that
b) can differentiate between module and static, and if so
c) is there an interest in a tiny tool that scripts could use to determine existing support?

Take a look in /proc/kallsyms when you have a module loaded. [...] grep '\[natsemi\]' /proc/kallsyms

Most distributors do not have the CONFIG_KALLSYMS (or whatever it is called) active. And IIRC, the help texts say that it consumes a lot of memory (which is probably due to kallsyms storing not only symbols we need).

Jan Engelhardt

Signature · 1 line
ENOSPC
#12 lore raw

Re: [RFC] misleading error message

In reply to David Ford

David Ford <[email protected]> said:

[...]

Quoted 4 lines

I want to be able to request information about a whooplesnoople without it triggering a module load request, to determine if it's compiled in statically. I want to be able to distinguish static a static whooplesnoople from a modularly loaded whooplesnoople.

The running kernel might have been compiled with whooplesnoople support, but the module isn't there (or is broken); there are modules (think the infamous binary drivers, but the NTFS and ipw-2x00 drivers are fully open source examples I use) that can be loaded into "any" running kernel (even build them after the kernel was built). A part of the module mechanism is exactly for making that possible, so this is not a _kernel_ property, but a _setup_ property.

The only reliable way of finding out if support is there is by using it. Or groping inside /etc/modprobe.conf and /lib/modules &c to find out, if you are brave. I'm chicken.

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513