summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-15 11:30:50 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-15 12:24:14 +0200
commit3f03a198b2f1ad7ff6f1d53c287c36011024d67c (patch)
treec1c4d015ce3a659f3906589549d3e811cfb59f18 /gnu
parent2c6c002ab7d23d21d592f3c3d1534c6791db2e72 (diff)
downloadguix-3f03a198b2f1ad7ff6f1d53c287c36011024d67c.tar.gz
system: Add 'label' field to <operating-system>.
* gnu/system.scm (<operating-system>)[label]: New field.
(operating-system-default-label): New procedure.
(operating-system-boot-parameters): Use it instead of
'kernel->boot-label'.
* doc/guix.texi (operating-system Reference): Document it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/system.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index 2abb1fefff..24243eb707 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -78,6 +78,8 @@
             operating-system-kernel
             operating-system-kernel-file
             operating-system-kernel-arguments
+            operating-system-label
+            operating-system-default-label
             operating-system-initrd-modules
             operating-system-initrd
             operating-system-users
@@ -160,6 +162,9 @@
   (kernel-arguments operating-system-user-kernel-arguments
                     (default '()))                ; list of gexps/strings
   (bootloader operating-system-bootloader)        ; <bootloader-configuration>
+  (label operating-system-label                   ; string
+         (thunked)
+         (default (operating-system-default-label this-operating-system)))
 
   (keyboard-layout operating-system-keyboard-layout ;#f | <keyboard-layout>
                    (default #f))
@@ -918,6 +923,11 @@ listed in OS.  The C library expects to find it under
                         (inferior-package-version kernel)))
         (else "GNU")))
 
+(define (operating-system-default-label os)
+  "Return the default label for OS, as it will appear in the bootloader menu
+entry."
+  (kernel->boot-label (operating-system-kernel os)))
+
 (define (store-file-system file-systems)
   "Return the file system object among FILE-SYSTEMS that contains the store."
   (match (filter (lambda (fs)
@@ -966,7 +976,7 @@ such as '--root' and '--load' to <boot-parameters>."
          (bootloader      (bootloader-configuration-bootloader
                            (operating-system-bootloader os)))
          (bootloader-name (bootloader-name bootloader))
-         (label           (kernel->boot-label (operating-system-kernel os))))
+         (label           (operating-system-label os)))
     (boot-parameters
      (label label)
      (root-device root-device)