all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Looking for Guix alternative to /lib/modules/$(uname -r)/build
@ 2019-09-11  6:25 Hebi Li
  2019-09-11  6:59 ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Hebi Li @ 2019-09-11  6:25 UTC (permalink / raw)
  To: help-guix

Hi Guix,

I'm trying to compile and package a kernel module. Kernel modules
require the kernel "build folder" with Makefile, Kconfig, etc, and
compile with:

        make -C /lib/modules/$(uname -r)/build modules

I'm looking for Guix alternative to the folder /lib/modules/$(uname -r)/build.

The linux-libre and linux-libre-headers do not seem to serve that
purpose. In particular, linux-libre-headers contains only header
files, and no Makefiles. The linux-libre:

        $ ls -l /gnu/store/...-linux-libre-5.2.13/modules/5.2.13-gnu

        lrwxrwxrwx  3 root root      53 Dec 31  1969 build ->
/tmp/guix-build-linux-libre-5.2.13.drv-0/linux-5.2.13
        dr-xr-xr-x 13 root root    4096 Dec 31  1969 kernel/
        lrwxrwxrwx  3 root root      53 Dec 31  1969 source ->
/tmp/guix-build-linux-libre-5.2.13.drv-0/linux-5.2.13

The build/ and source/ folders are symlinks to the
/tmp/guix-build-..., and thus only available when using guix build
--check --keep-failed linux-libre. When I do that, the
/tmp/guix-build-... folder
does function as I expected. But I'm not sure if it is possible to access
them in a Guix package build.  The kernel/ folder contains only .ko files,
thus won't work for my purpose.

So my question is, is there a Guix alternative to the folder
/lib/modules/$(uname -r)/build ?

Thanks,
Hebi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Looking for Guix alternative to /lib/modules/$(uname -r)/build
  2019-09-11  6:25 Looking for Guix alternative to /lib/modules/$(uname -r)/build Hebi Li
@ 2019-09-11  6:59 ` Ricardo Wurmus
  2019-09-12  3:21   ` Hebi Li
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2019-09-11  6:59 UTC (permalink / raw)
  To: Hebi Li; +Cc: help-guix


Hebi Li <lihebi.com@gmail.com> writes:

> I'm trying to compile and package a kernel module. Kernel modules
> require the kernel "build folder" with Makefile, Kconfig, etc, and
> compile with:
>
>         make -C /lib/modules/$(uname -r)/build modules
>
> I'm looking for Guix alternative to the folder /lib/modules/$(uname -r)/build.

We have a linux-module-build-system which implements the common
procedure of building a kernel module.  You would just need to write a
Guix package definition using that build system.

-- 
Ricardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Looking for Guix alternative to /lib/modules/$(uname -r)/build
  2019-09-11  6:59 ` Ricardo Wurmus
@ 2019-09-12  3:21   ` Hebi Li
  0 siblings, 0 replies; 3+ messages in thread
From: Hebi Li @ 2019-09-12  3:21 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

Thanks, I've managed to use linux-module-build-system to build the
module, and I got the output
/gnu/store/...my-module-0.0.1/extra/xxx.ko. I can load the module via
insmod with the full path.

Now I want to load the module via modprobe, instead of specifying the
full path. For that, I need to place the .ko file in the modprobe
search directory. I notice that in
gnu/packages/patches/kmod-module-directory.patch, the modprobe is
modified to honor the LINUX_MODULE_DIRECTORY env variable, which is
set to /run/booted-system/kernel/lib/modules. However,
/run/booted-system/kernel/ is symlink to
/gnu/store/9rq5y83c9y1kplv6r7a2vksswyjzs57k-linux-libre-5.2.13, which
is read-only.

Further, it seems that modprobe can only scan exactly *one* directory,
be it from the LINUX_MODULE_DIRECTORY env variable, or the original
hard coded "/lib/modules/"

So my question is, is it possible to let modprobe be aware of my
external module?

Hebi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-12  3:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  6:25 Looking for Guix alternative to /lib/modules/$(uname -r)/build Hebi Li
2019-09-11  6:59 ` Ricardo Wurmus
2019-09-12  3:21   ` Hebi Li

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.