From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KNUvD63z+V4BBwAA0tVLHw (envelope-from ) for ; Mon, 29 Jun 2020 13:59:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GMvaCq3z+V6XdgAAbx9fmQ (envelope-from ) for ; Mon, 29 Jun 2020 13:59:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE36F940215 for ; Mon, 29 Jun 2020 13:59:08 +0000 (UTC) Received: from localhost ([::1]:48116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpuJP-00081C-Nr for larch@yhetil.org; Mon, 29 Jun 2020 09:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpuJL-0007yh-4k for guix-patches@gnu.org; Mon, 29 Jun 2020 09:59:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jpuJK-0002oN-Sg for guix-patches@gnu.org; Mon, 29 Jun 2020 09:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jpuJK-0004ku-S5 for guix-patches@gnu.org; Mon, 29 Jun 2020 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42122] [PATCH 2/3] services: system-service-type: Add entries support for the Hurd. Resent-From: "Jan (janneke) Nieuwenhuizen" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 Jun 2020 13:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42122 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42122@debbugs.gnu.org Received: via spool by 42122-submit@debbugs.gnu.org id=B42122.159343910718205 (code B ref 42122); Mon, 29 Jun 2020 13:59:02 +0000 Received: (at 42122) by debbugs.gnu.org; 29 Jun 2020 13:58:27 +0000 Received: from localhost ([127.0.0.1]:49007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpuIl-0004jU-Di for submit@debbugs.gnu.org; Mon, 29 Jun 2020 09:58:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpuIk-0004j5-9T for 42122@debbugs.gnu.org; Mon, 29 Jun 2020 09:58:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59811) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpuIe-0002lE-Uu; Mon, 29 Jun 2020 09:58:20 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=50092 helo=dundal.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1jpuIe-0000l9-3P; Mon, 29 Jun 2020 09:58:20 -0400 From: "Jan (janneke) Nieuwenhuizen" Date: Mon, 29 Jun 2020 15:58:16 +0200 Message-Id: <20200629135817.12784-2-janneke@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200629135817.12784-1-janneke@gnu.org> References: <20200629135817.12784-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: 6fa0H1as4RPy 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 | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com