[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Newbie: How to find all kernel modules that can be loaded?
From: |
Efraim Flashner |
Subject: |
Re: Newbie: How to find all kernel modules that can be loaded? |
Date: |
Tue, 18 Apr 2023 11:39:13 +0300 |
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
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Newbie: How to find all kernel modules that can be loaded?,
Efraim Flashner <=