* modules detection
@ 2002-01-17 13:21 Yann E. MORIN
2002-01-17 13:55 ` Richard B. Johnson
0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2002-01-17 13:21 UTC (permalink / raw)
To: lkml
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 / \ |
°--------------------------------------------------°------------------°
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: modules detection
2002-01-17 13:21 modules detection Yann E. MORIN
@ 2002-01-17 13:55 ` Richard B. Johnson
0 siblings, 0 replies; 2+ messages in thread
From: Richard B. Johnson @ 2002-01-17 13:55 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: lkml
On Thu, 17 Jan 2002, Yann E. MORIN wrote:
> 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.
>
You could also use `lsmod`. It uses query_module() which will return
some error code if modules are not supported.
if lsmod >/dev/null ; then
echo "Modules are supported"
else
echo "Modules not supported"
fi
Cheers,
Dick Johnson
Penguin : Linux version 2.4.1 on an i686 machine (797.90 BogoMips).
I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-01-17 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 13:21 modules detection Yann E. MORIN
2002-01-17 13:55 ` Richard B. Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®