Bug: Unable to use an inferior package as a kernel in the system configuration

  • Done
  • quality assurance status badge
Details
One participant
  • pkill9
Owner
unassigned
Submitted by
pkill9
Severity
normal

Debbugs page

pkill9 wrote 6 years ago
(name . bug-guix)(address . bug-guix@gnu.org)
E1gX8O7-0001zO-Ig@rmmprod06.runbox
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:

```
Toggle diff (28 lines)
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.
pkill9 wrote 6 years ago
(name . 33719-done)(address . 33719-done@debbugs.gnu.org)
E1gsQKu-0000x9-JE@rmmprod07.runbox
Fixed with guix commit bdc61ff97d26d5d87020d07dfd43c0a552bd3449
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 33719@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 33719
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help