From: Efraim Flashner <efraim@flashner.co.il>
To: Mario Forzanini <mf@marioforzanini.com>
Cc: Rodrigo Morales <moralesrodrigo1100@gmail.com>, help-guix@gnu.org
Subject: Re: Newbie: How to find all kernel modules that can be loaded?
Date: Tue, 18 Apr 2023 11:39:13 +0300 [thread overview]
Message-ID: <ZD5XMR+PxDwpS8+Z@3900XT> (raw)
In-Reply-To: <87cz4okgci.fsf@marioforzanini.com>
[-- 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 --]
prev parent reply other threads:[~2023-04-18 8:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZD5XMR+PxDwpS8+Z@3900XT \
--to=efraim@flashner.co.il \
--cc=help-guix@gnu.org \
--cc=mf@marioforzanini.com \
--cc=moralesrodrigo1100@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).