Subject: Re: bug#39643: (Out-of-tree) system kernel modules only found in :out

From: Marius Bakke <[email-masked]>
Date: Tue, 18 Feb 2020 18:26:46 +0100

Tobias Geerinckx-Rice via Bug reports for GNU Guix <[email-masked]>
writes:

> Guix,
>
> After adding (specification->package+output "zfs:module") to my 
> system packages, it's still missing from current-system:
>
>   $ guix system reconfigure …
>
>   $ ls /run/current-system/profile/lib/modules/
>   5.4.0-pf7-4-ed26-M88
>
> That's my horrible custom Linux fork/version/abomination. 
> Apologies.  The ZFS package simply compiles against Guix's default 
> linux-libre-5.4.20-gnu package.

To build out-of-tree modules with a custom kernel I would expect that
you have to rebuild them against your kernel:

(define my-kernel
 (package/inherit
  linux-libre
  ...))

(define with-custom-kernel
 (package-input-rewriting `((,linux-libre . ,my-kernel))))

(define zfs-with-custom-kernel
 (with-custom-kernel zfs))

Alternatively, I see that 'linux-module-build-system' takes a #:linux
argument:

(define zfs-with-my-kernel
 (package/inherit
  zfs
  (arguments (substitute-keyword-arguments (package-arguments zfs))
   ((#:linux _ #f) my-kernel))))

Will these options work for you, or am I misunderstanding something?