[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: |
Mario Forzanini |
Subject: |
Re: Newbie: How to find all kernel modules that can be loaded? |
Date: |
Fri, 31 Mar 2023 18:58:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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