From mboxrd@z Thu Jan 1 00:00:00 1970 From: 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) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX8Oc-0001PY-Ta for bug-guix@gnu.org; Wed, 12 Dec 2018 12:34:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX8OY-0003nF-9o for bug-guix@gnu.org; Wed, 12 Dec 2018 12:34:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:41210) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gX8OY-0003n4-4s for bug-guix@gnu.org; Wed, 12 Dec 2018 12:34:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gX8OY-0006B2-14 for bug-guix@gnu.org; Wed, 12 Dec 2018 12:34:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX8OF-00019Z-8M for bug-guix@gnu.org; Wed, 12 Dec 2018 12:33:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX8OB-0003X9-0g for bug-guix@gnu.org; Wed, 12 Dec 2018 12:33:43 -0500 Received: from aibo.runbox.com ([91.220.196.211]:38082) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gX8OA-0003VX-Kd for bug-guix@gnu.org; Wed, 12 Dec 2018 12:33:38 -0500 Received: from [10.9.9.128] (helo=rmmprod06.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1gX8O7-0001rb-Jx for bug-guix@gnu.org; Wed, 12 Dec 2018 18:33:35 +0100 Received: from mail by rmmprod06.runbox with local (Exim 4.86_2) (envelope-from ) id 1gX8O7-0001zO-Ig for bug-guix@gnu.org; Wed, 12 Dec 2018 18:33:35 +0100 Content-Disposition: inline Received: from [Authenticated user (850733)] by runbox.com with http (RMM6); for ; Wed, 12 Dec 2018 17:33:35 GMT List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 33719@debbugs.gnu.org When putting an inferior package in the 'kernel' field of the system config= uration, Guix fails with ``` gnu/system.scm:909:35: In procedure kernel->boot-label: In procedure package-name: Wrong type argument: # ``` The issue is very simple: The function that creates the text for a boot ent= ry (`kernel->boot-label`) gets the name and version of the kernel using the= functions `package-name` and `package-version`, which are incompatible wit= h inferior packages. The `(guix inferior)` module provides equivalent functions for inferior pac= kages: `inferior-package-name` and `inferior-package-version`. Here's a pat= ch 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 . (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-ke= rnel-built-using-a-previous-guix-commit-to-your-system-configuration/ I assume the solution is to modify the `kernel->boot-label` function to che= ck if the package passed to it is an inferior package, and use the compatib= le 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 gr= eat if someone could else could create a patch that fixes this.=