unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: <pkill9@runbox.com>
To: 33719@debbugs.gnu.org
Subject: bug#33719: Bug: Unable to use an inferior package as a kernel in the system configuration
Date: Wed, 12 Dec 2018 17:33:35 +0000 (GMT)	[thread overview]
Message-ID: <E1gX8O7-0001zO-Ig@rmmprod06.runbox> (raw)

When putting an inferior package in the 'kernel' field of the system configuration, Guix fails with

```
gnu/system.scm:909:35: In procedure kernel->boot-label:
In procedure package-name: Wrong type argument: #<inferior-package linux-libre@4.18.15 4182150>
```

The issue is very simple: The function that creates the text for a boot entry (`kernel->boot-label`) gets the name and version of the kernel using the functions `package-name` and `package-version`, which are incompatible with inferior packages.
The `(guix inferior)` module provides equivalent functions for inferior packages: `inferior-package-name` and `inferior-package-version`. Here's a patch that demonstrates which part needs to be changed:

```
diff --git a/gnu/system.scm b/gnu/system.scm
index a5a8f40d6..3c3fe94ad 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -21,6 +21,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

 (define-module (gnu system)
+  #:use-module (guix inferior)
   #:use-module (guix store)
   #:use-module (guix monads)
   #:use-module (guix gexp)
@@ -906,8 +907,8 @@ listed in OS.  The C library expects to find it under
 (define (kernel->boot-label kernel)
   "Return a label for the bootloader menu entry that boots KERNEL."
   (string-append "GNU with "
-                 (string-titlecase (package-name kernel)) " "
-                 (package-version kernel)
+                 (string-titlecase (inferior-package-name kernel)) " "
+                 (inferior-package-version kernel)
                  " (beta)"))

 (define (store-file-system file-systems)
```

I tested this and it made inferior-packages able to be used as a kernel - I'm running that kernel on my system now, I wrote a guide on how to do that if anyone's interested, which includes an example of how to add it to your system configuration: http://miha.info/2018-Dec-09/how-to-add-a-modified-kernel-built-using-a-previous-guix-commit-to-your-system-configuration/

I assume the solution is to modify the `kernel->boot-label` function to check if the package passed to it is an inferior package, and use the compatible functions to get the name and version of the package depending on if it's inferior or not, however I don't know scheme/guile well enough to do this, and I don't know if this is the correct solution to do, so it would be great if someone could else could create a patch that fixes this.

             reply	other threads:[~2018-12-12 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 17:33 pkill9 [this message]
2019-02-09 10:58 ` bug#33719: Bug: Unable to use an inferior package as a kernel in the system configuration pkill9

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=E1gX8O7-0001zO-Ig@rmmprod06.runbox \
    --to=pkill9@runbox.com \
    --cc=33719@debbugs.gnu.org \
    /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).