unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jelle Licht <jlicht@fsfe.org>
To: Robby Zambito <contact@robbyzambito.me>
Cc: Liliana Marie Prikler <liliana.prikler@gmail.com>, 62174@debbugs.gnu.org
Subject: bug#62174: Cannot use modules with an inferior kernel.
Date: Wed, 15 Mar 2023 12:35:16 +0100	[thread overview]
Message-ID: <87h6umtfgr.fsf@fsfe.org> (raw)
In-Reply-To: <87sfe73pyq.fsf@robbyzambito.me>

Robby Zambito <contact@robbyzambito.me> writes:

> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
>> I think you should try to pin the kernel modules as well.  If that
>> still doesn't work as intended (it very well might), we have a proper
>> case of something that should work but doesn't.
>>
>> Cheers
>
> Thanks for the suggestion. I tested with the following:
>
> ```
> (define-values (rz/linux rz/linux-kernel-modules)
>   (let* ((channels
>           (list	(channel
> 		 (name 'guix)
> 		 (url "https://git.savannah.gnu.org/git/guix.git")
> 		 (commit "d37b467631d5b0e965ea933b8bda8448993580e9"))))
> 	 (inferior (inferior-for-channels channels))
> 	 (kernel-version "6.1.15"))
>     (values (first (lookup-inferior-packages inferior "linux-libre" kernel-version))
> 	    (list (first (lookup-inferior-packages inferior "v4l2loopback-linux-module"))))))
>
> (operating-system
>   ...
>   (kernel rz/linux)
>   (kernel-loadable-modules rz/linux-kernel-modules)
>   ...)
> ```
>
> But I receive a different error now:
>
> ```
> running profile hook of type 'linux-module-database'...
> Backtrace:
>            1 (primitive-load "/gnu/store/7ha0kn8fz8yfi26m3m8997wlc8m?")
> In ice-9/boot-9.scm:
>    2007:7  0 (error _ . _)
>
> ice-9/boot-9.scm:2007:7: In procedure error:
> Specified Linux kernel and Linux kernel modules are not all of the same version
> ```
>
> However, if I use the most recent kernel version available in the
> inferior...
>
> ```
> (define-values (rz/linux rz/linux-kernel-modules)
>   (let* ((channels
>           (list	(channel
> 		 (name 'guix)
> 		 (url "https://git.savannah.gnu.org/git/guix.git")
> 		 (commit "d37b467631d5b0e965ea933b8bda8448993580e9"))))
> 	 (inferior (inferior-for-channels channels))
>          (kernel-version "6.2.2"))
>     (values (first (lookup-inferior-packages inferior "linux-libre"))
> 	    (list (first (lookup-inferior-packages inferior "v4l2loopback-linux-module"))))))
> ```
>
> It actually works! So it seems that the problem is specifically with
> using kernel modules with a kernel version other than the latest
> linux-libre kernel from an inferior. I also tried using a specific
> kernel version without an inferior like so:
>
> ```
> (operating-system
>   ...
>   (kernel (specification->package "linux-libre@6.1.15"))
>   (kernel-loadable-modules (list (specification->package"v4l2loopback-linux-module")))
>   ...)
> ```
>
> And that works as well.
>
> TL;DR: The issue has been narrowed down to using kernel modules with a
> kernel from an inferior besides the latest kernel from that inferior.

I believe our kernel-loadable-modules is backed by a service with type
linux-builder-service-type. It seems that the
linux-builder-configuration->system-entry only deals gracefully with
modules that are filtered by "(package? mod)" in order to rewrite the
package with "package-for-kernel".

So there are some things we'd need to do to ensure your use case works:
- Get linux-builder-configuration->system-entry to support packages from
an inferior.

Can you try to wrap your kernel module package like such [untested],
with rz/linux being the kernel inferior package you actually want:

--8<---------------cut here---------------start------------->8---
(kernel rz/linux)
(kernel-loadable-modules
  (map
    (lambda (mod) (package-for-kernel lz/linux mod))
    rz/linux-kernel-modules))
--8<---------------cut here---------------end--------------->8---

If this doesn't work, we also need to make package-for-kernel support
packages from an inferior for both the kernel and module argument, or
create an alternative implementation that deals
`linux-builder-configuration->system-entry' can dispatch to for this
specific case.

Good luck!
- Jelle






      reply	other threads:[~2023-03-15 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14  3:27 bug#62174: Cannot use modules with an inferior kernel Robby Zambito
2023-03-14 19:53 ` Liliana Marie Prikler
2023-03-14 21:48   ` Robby Zambito
2023-03-15 11:35     ` Jelle Licht [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=87h6umtfgr.fsf@fsfe.org \
    --to=jlicht@fsfe.org \
    --cc=62174@debbugs.gnu.org \
    --cc=contact@robbyzambito.me \
    --cc=liliana.prikler@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.
Code repositories for project(s) associated with this public inbox

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

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).