unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
To: 42122@debbugs.gnu.org
Subject: [bug#42122] [PATCH 2/3] services: system-service-type: Add entries support for the Hurd.
Date: Mon, 29 Jun 2020 15:58:16 +0200	[thread overview]
Message-ID: <20200629135817.12784-2-janneke@gnu.org> (raw)
In-Reply-To: <20200629135817.12784-1-janneke@gnu.org>

When creating a disk-image using --save-provenance, "guix system describe"
now works.

* gnu/system.scm (operating-system-directory-base-entries): Add conditional
"hurd" parameter, make "initrd" parameter conditional.
(hurd-default-essential-services): Use them.
(operating-system-boot-parameters-file): Only add 'initrd' when set.
---
 gnu/system.scm | 71 +++++++++++++++++++++++++++++---------------------
 1 file changed, 41 insertions(+), 30 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index a6a9c958e6..d4641cc9b0 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -537,22 +537,26 @@ possible (that is if there's a LINUX keyword argument in the build system)."
 value of the SYSTEM-SERVICE-TYPE service."
   (let* ((locale  (operating-system-locale-directory os))
          (kernel  (operating-system-kernel os))
+         (hurd    (operating-system-hurd os))
          (modules (operating-system-kernel-loadable-modules os))
-         (kernel  (profile
-                   (content (packages->manifest
-                             (cons kernel
-                                   (map (lambda (module)
-                                          (if (package? module)
-                                              (package-for-kernel kernel
-                                                                  module)
-                                              module))
-                                        modules))))
-                   (hooks (list linux-module-database))))
-         (initrd  (operating-system-initrd-file os))
+         (kernel  (if hurd
+                      kernel
+                      (profile
+                       (content (packages->manifest
+                                 (cons kernel
+                                       (map (lambda (module)
+                                              (if (package? module)
+                                                  (package-for-kernel kernel
+                                                                      module)
+                                                  module))
+                                            modules))))
+                       (hooks (list linux-module-database)))))
+         (initrd  (and (not hurd) (operating-system-initrd-file os)))
          (params  (operating-system-boot-parameters-file os)))
     `(("kernel" ,kernel)
+      ,@(if hurd `(("hurd" ,hurd)) '())
       ("parameters" ,params)
-      ("initrd" ,initrd)
+      ,@(if initrd `(("initrd" ,initrd)) '())
       ("locale" ,locale))))   ;used by libc
 
 (define (operating-system-default-essential-services os)
@@ -604,23 +608,24 @@ bookkeeping."
                                   (operating-system-firmware os)))))))
 
 (define (hurd-default-essential-services os)
-  (list (service system-service-type '())
-        %boot-service
-        %hurd-startup-service
-        %activation-service
-        %shepherd-root-service
-        (service user-processes-service-type)
-        (account-service (append (operating-system-accounts os)
-                                 (operating-system-groups os))
-                         (operating-system-skeletons os))
-        (root-file-system-service)
-        (service file-system-service-type '())
-        (service fstab-service-type
-                 (filter file-system-needed-for-boot?
-                         (operating-system-file-systems os)))
-        (pam-root-service (operating-system-pam-services os))
-        (operating-system-etc-service os)
-        (service profile-service-type (operating-system-packages os))))
+  (let ((entries (operating-system-directory-base-entries os)))
+   (list (service system-service-type entries)
+         %boot-service
+         %hurd-startup-service
+         %activation-service
+         %shepherd-root-service
+         (service user-processes-service-type)
+         (account-service (append (operating-system-accounts os)
+                                  (operating-system-groups os))
+                          (operating-system-skeletons os))
+         (root-file-system-service)
+         (service file-system-service-type '())
+         (service fstab-service-type
+                  (filter file-system-needed-for-boot?
+                          (operating-system-file-systems os)))
+         (pam-root-service (operating-system-pam-services os))
+         (operating-system-etc-service os)
+         (service profile-service-type (operating-system-packages os)))))
 
 (define* (operating-system-services os)
   "Return all the services of OS, including \"essential\" services."
@@ -1276,7 +1281,13 @@ being stored into the \"parameters\" file)."
                      (kernel #$(boot-parameters-kernel params))
                      (kernel-arguments
                       #$(boot-parameters-kernel-arguments params))
-                     (initrd #$(boot-parameters-initrd params))
+                     #$@(if (boot-parameters-initrd params)
+                            #~((initrd #$(boot-parameters-initrd params)))
+                            #~())
+                     #$@(if (pair? (boot-parameters-multiboot-modules params))
+                            #~((multiboot-modules
+                                #$(boot-parameters-multiboot-modules params)))
+                            #~())
                      (bootloader-name #$(boot-parameters-bootloader-name params))
                      (bootloader-menu-entries
                       #$(map menu-entry->sexp
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





  reply	other threads:[~2020-06-29 13:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 13:55 [bug#42122] [PATCH 0/3] Support guix system describe and provenance for the Hurd Jan (janneke) Nieuwenhuizen
2020-06-29 13:58 ` [bug#42122] [PATCH 1/3] system: 'read-boot-parameters' fixes for multiboot Jan (janneke) Nieuwenhuizen
2020-06-29 13:58   ` Jan (janneke) Nieuwenhuizen [this message]
2020-07-02 21:50     ` [bug#42122] [PATCH 2/3] services: system-service-type: Add entries support for the Hurd Ludovic Courtès
2020-07-03  7:42       ` Jan Nieuwenhuizen
2020-06-29 13:58   ` [bug#42122] [PATCH 3/3] guix system: "describe" displays multiboot info Jan (janneke) Nieuwenhuizen
2020-07-02 21:51     ` Ludovic Courtès
2020-07-03  7:42       ` bug#42122: " Jan Nieuwenhuizen
2020-07-02 21:42   ` [bug#42122] [PATCH 1/3] system: 'read-boot-parameters' fixes for multiboot Ludovic Courtès
2020-07-03  7:42     ` Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200629135817.12784-2-janneke@gnu.org \
    --to=janneke@gnu.org \
    --cc=42122@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).