[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/05: system: Add 'label' field to <operating-system>.

From: guix-commits
Subject: 03/05: system: Add 'label' field to <operating-system>.
Date: Mon, 15 Apr 2019 06:25:12 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 3f03a198b2f1ad7ff6f1d53c287c36011024d67c
Author: Ludovic Court├Ęs <address@hidden>
Date:   Mon Apr 15 11:30:50 2019 +0200

    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
    * doc/guix.texi (operating-system Reference): Document it.
 doc/guix.texi  |  4 ++++
 gnu/system.scm | 12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5fefc1a..1ae5711 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10436,6 +10436,10 @@ the command-line of the kernel---e.g., 
 @item @code{bootloader}
 The system bootloader configuration object.  @xref{Bootloader Configuration}.
address@hidden @code{label}
+This is the label (a string) as it appears in the bootloader's menu entry.
+The default label includes the kernel name and version.
 @item @code{keyboard-layout} (default: @code{#f})
 This field specifies the keyboard layout to use in the console.  It can be
 either @code{#f}, in which case the default keyboard layout is used (usually
diff --git a/gnu/system.scm b/gnu/system.scm
index 2abb1fe..24243eb 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -78,6 +78,8 @@
+            operating-system-label
+            operating-system-default-label
@@ -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
+  (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)))
      (label label)
      (root-device root-device)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]