all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#33806] [PATCH] system: 'kernel->boot-label' now accepts inferior packages.
@ 2018-12-19 20:42 pkill9
  2018-12-19 21:56 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: pkill9 @ 2018-12-19 20:42 UTC (permalink / raw)
  To: 33806

[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

I modified the 'kernel->boot-label' function in gnu/system.scm to check if the kernel passed to it is a regular package, and if it isn't then it will try to get the package name and version using 'inferior-package-name' and 'inferior-package-version'.

Note: I wasn't sure if the hack at the beginning of this patch was neccessary and I didn't add it: http://git.savannah.gnu.org/cgit/guix.git/commit/?id=811b21fb15d36b06fde994ca7ef5916a9a19f250
```
  (define inferiors-loaded?
    ;; This hack allows us to provide seamless integration for inferior
    ;; packages while not having a hard dependency on (guix inferior).
    (resolve-module '(guix inferior) #f #f #:ensure #f))

  (define (inferior->entry)
    (module-ref (resolve-interface '(guix inferior))
                'inferior-package->manifest-entry))
```

This is the only issue preventing using an inferior package as a kernel, which is very useful as it means you can avoid recompiling a custom kernel when you reconfigure the system with a newer guix revision that changes the kernel package dependencies.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-system-kernel-boot-label-now-accepts-inferior-packag.patch --]
[-- Type: text/x-patch; name="0001-system-kernel-boot-label-now-accepts-inferior-packag.patch", Size: 1711 bytes --]

From 6c0bbaa0a73f4c6043211df6af100877dc9a4094 Mon Sep 17 00:00:00 2001
From: Pkill -9 <pkill9@runbox.com>
Date: Wed, 19 Dec 2018 20:22:20 +0000
Subject: [PATCH] system: 'kernel->boot-label' now accepts inferior packages.

* gnu/system.scm (kernel->boot-label): Get package name and version
using the functions for inferior packages if the kernel is not a
regular package.
---
 gnu/system.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index a5a8f40d6..afe39278d 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)
@@ -905,10 +906,15 @@ 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)
-                 " (beta)"))
+  (if (package? kernel)
+      (string-append "GNU with "
+                     (string-titlecase (package-name kernel)) " "
+                     (package-version kernel)
+                     " (beta)")
+      (string-append "GNU with "
+                     (string-titlecase (inferior-package-name kernel))
+                     (inferior-package-version kernel)
+                     " (beta)")))
 
 (define (store-file-system file-systems)
   "Return the file system object among FILE-SYSTEMS that contains the store."
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-26 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-19 20:42 [bug#33806] [PATCH] system: 'kernel->boot-label' now accepts inferior packages pkill9
2018-12-19 21:56 ` Ludovic Courtès
2018-12-20 14:44   ` pkill9
2018-12-21 15:20     ` bug#33806: " Ludovic Courtès
2018-12-24 20:04       ` [bug#33806] " pkill9
2018-12-26 16:22         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.