* Newbie: How to find all kernel modules that can be loaded?
@ 2023-03-31 16:37 Rodrigo Morales
2023-03-31 16:58 ` Mario Forzanini
0 siblings, 1 reply; 3+ messages in thread
From: Rodrigo Morales @ 2023-03-31 16:37 UTC (permalink / raw)
To: help-guix
As part of my learning journey with Guix, I'm experimenting with kernel
modules. I want to enable and disable and see how they affect my system.
I'm aware that in Guix kernel modules can be enabled and disabled
through kernel-module-loader-service-type.
I want to know all the modules that are available on my system so that I
can add them to kernel-module-loader-service-type. I'm a newbie when it
comes to kernel modules, so I'm not even aware if all of them have a unique
extension. If that's the case, a simple `find /gnu/store -type f -name
'*.<<extension>>' should find them.
I have two questions:
* Are kernel modules defined in unique files? If that's the case, do all of
them have a unique extension?
* Besides using `find` (assuming each kernel module exists in separated
files), do you know another way to find all kernel modules that exist
locally and that could be enabled?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Newbie: How to find all kernel modules that can be loaded?
2023-03-31 16:37 Newbie: How to find all kernel modules that can be loaded? Rodrigo Morales
@ 2023-03-31 16:58 ` Mario Forzanini
2023-04-18 8:39 ` Efraim Flashner
0 siblings, 1 reply; 3+ messages in thread
From: Mario Forzanini @ 2023-03-31 16:58 UTC (permalink / raw)
To: Rodrigo Morales; +Cc: help-guix
Rodrigo Morales <moralesrodrigo1100@gmail.com> writes:
> I want to know all the modules that are available on my system so that I
> can add them to kernel-module-loader-service-type. I'm a newbie when it
> comes to kernel modules, so I'm not even aware if all of them have a unique
> extension. If that's the case, a simple `find /gnu/store -type f -name
> '*.<<extension>>' should find them.
>
> I have two questions:
>
> * Are kernel modules defined in unique files? If that's the case, do all of
> them have a unique extension?
Yes they should all be object files with extensions '*.ko' or '*.o', and
in more conventional linux systems they are all under /lib/modules. On
Guix I can find them gzipped under
/run/current-system/kernel/lib/modules, so something like this lists a
bunch of modules:
┌(18:56:30)
└(~) % find /run/current-system/kernel/lib/modules -name '*.ko.gz' -or -name '*.o.gz'
This works on my system but YMMV
> * Besides using `find` (assuming each kernel module exists in separated
> files), do you know another way to find all kernel modules that exist
> locally and that could be enabled?
Well the lsmod(8) man page lists a lot of utilities to gain info about
kernel modules, but they may not work because they look for them in
/lib/modules, e.g.
┌(18:56:44)
└(~) % depmod -av
depmod: ERROR: could not open directory /lib/modules/6.2.7: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
--
Mario
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Newbie: How to find all kernel modules that can be loaded?
2023-03-31 16:58 ` Mario Forzanini
@ 2023-04-18 8:39 ` Efraim Flashner
0 siblings, 0 replies; 3+ messages in thread
From: Efraim Flashner @ 2023-04-18 8:39 UTC (permalink / raw)
To: Mario Forzanini; +Cc: Rodrigo Morales, help-guix
[-- Attachment #1: Type: text/plain, Size: 1986 bytes --]
On Fri, Mar 31, 2023 at 06:58:37PM +0200, Mario Forzanini wrote:
> Rodrigo Morales <moralesrodrigo1100@gmail.com> writes:
> > I want to know all the modules that are available on my system so that I
> > can add them to kernel-module-loader-service-type. I'm a newbie when it
> > comes to kernel modules, so I'm not even aware if all of them have a unique
> > extension. If that's the case, a simple `find /gnu/store -type f -name
> > '*.<<extension>>' should find them.
> >
> > I have two questions:
> >
> > * Are kernel modules defined in unique files? If that's the case, do all of
> > them have a unique extension?
>
> Yes they should all be object files with extensions '*.ko' or '*.o', and
> in more conventional linux systems they are all under /lib/modules. On
> Guix I can find them gzipped under
> /run/current-system/kernel/lib/modules, so something like this lists a
> bunch of modules:
>
> ┌(18:56:30)
> └(~) % find /run/current-system/kernel/lib/modules -name '*.ko.gz' -or -name '*.o.gz'
>
> This works on my system but YMMV
>
> > * Besides using `find` (assuming each kernel module exists in separated
> > files), do you know another way to find all kernel modules that exist
> > locally and that could be enabled?
>
> Well the lsmod(8) man page lists a lot of utilities to gain info about
> kernel modules, but they may not work because they look for them in
> /lib/modules, e.g.
>
> ┌(18:56:44)
> └(~) % depmod -av
> depmod: ERROR: could not open directory /lib/modules/6.2.7: No such file or directory
> depmod: FATAL: could not search modules: No such file or directory
A little late on the reply, but you can work around this with the
-b/--basedir flag
depmod -av -b /run/current-system/kernel
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-18 8:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31 16:37 Newbie: How to find all kernel modules that can be loaded? Rodrigo Morales
2023-03-31 16:58 ` Mario Forzanini
2023-04-18 8:39 ` Efraim Flashner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).