modules detection

Yann E. MORIN (yann.morin.1998@anciens.enib.fr)
Thu, 17 Jan 2002 14:21:14 +0100


Hi!

I need to know (in a script shell for instance) if a running kernel
is compiled with/without module support. I don't have access to the
source tree when detecting (though I have it mounted sometime later).

Reading the source (fs/proc/proc_misc.c), I understand that the file
/proc/modules exists only when modules are supported by the running
kernel. Is that true? If so, can I assume that the following script
is correct?

-=-=-=-
#!/bin/bash
[ -e /proc/modules ] && echo Modules supported by running kernel. \
|| echo Modules not supported by running kernel.
-=-=-=-

If not, how may I detect module support?

(Yes, I could build two kernels supporting modules vs not supporting
modules, but my machine is quite slow : 2h per compilation :-( ).

Thanks for any reply.

Regards,
Yann E. MORIN.

--
.---------------------------.----------------------.------------------.
|       Yann E. MORIN       |  Real-Time Embedded  | ASCII RIBBON /"\ |
|  phone: (33) 662 376 056  |  Software  Designer  |   CAMPAIGN   \ / |
|   http://ymorin.free.fr   °----------------------:   AGAINST     X  |
| yann.morin.1998@anciens.enib.fr                  |  HTML MAIL   / \ |
°--------------------------------------------------°------------------°

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/