From patchwork Sat Jun 6 10:58:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 22569 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F1EF227BBE3; Sat, 6 Jun 2020 11:59:07 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id A6EE527BBE1 for ; Sat, 6 Jun 2020 11:59:07 +0100 (BST) Received: from localhost ([::1]:45398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhWXb-0003tJ-85 for patchwork@mira.cbaines.net; Sat, 06 Jun 2020 06:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhWXW-0003tA-14 for guix-patches@gnu.org; Sat, 06 Jun 2020 06:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhWXV-0002D4-Or for guix-patches@gnu.org; Sat, 06 Jun 2020 06:59:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhWXV-0006Hc-Oj for guix-patches@gnu.org; Sat, 06 Jun 2020 06:59:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl. Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 06 Jun 2020 10:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41541 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Mathieu Othacehe Cc: 41541@debbugs.gnu.org, Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 41541-submit@debbugs.gnu.org id=B41541.159144112024121 (code B ref 41541); Sat, 06 Jun 2020 10:59:01 +0000 Received: (at 41541) by debbugs.gnu.org; 6 Jun 2020 10:58:40 +0000 Received: from localhost ([127.0.0.1]:50867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhWWy-0006Gj-3G for submit@debbugs.gnu.org; Sat, 06 Jun 2020 06:58:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhWWv-0006GW-AO for 41541@debbugs.gnu.org; Sat, 06 Jun 2020 06:58:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58997) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhWWo-00022C-Qx; Sat, 06 Jun 2020 06:58:19 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=34770 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jhWWm-0002uk-GO; Sat, 06 Jun 2020 06:58:17 -0400 From: Jan Nieuwenhuizen Organization: AvatarAcademy.nl References: <20200604135914.4499-1-janneke@gnu.org> <20200604135914.4499-7-janneke@gnu.org> <875zc4mxtu.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Sat, 06 Jun 2020 12:58:13 +0200 In-Reply-To: <875zc4mxtu.fsf@gnu.org> (Mathieu Othacehe's message of "Sat, 06 Jun 2020 09:56:45 +0200") Message-ID: <877dwk4g1m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Mathieu Othacehe writes: Hello Mathieu, Ludo! >> ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \ >> gnu/system/examples/bare-hurd.tmpl > > Not related to your serie, but I would really like the "image" catalog I > proposed to help here. Most people struggle to get the difference > between --system and --target. Plus, those cross-compilation targets are > not really documented. > > I think if one could write: > > guix system image gnu/system/images/bare-hurd.scm > > or so, it would help. But this needs some more discussions. Yes, I agree. Do you propose to hold back merging wip-hurd-vm until after merging the "image" catalog feature and then rewrite this message? Exactly when we merge wip-hurd-vm does not matter all that much to me, it's much more important/interesting to agree when we're happy with it. >> - #:use-module ((guix utils) #:select (source-properties->location)) >> + #:use-module ((guix utils) #:select (source-properties->location >> + %current-target-system)) > > You're not using it right? Ah, no (not since the grub work moved). >> + ;; (kernel-loadable-modules '()) > > Remove it. Ok, I was already unsure about keeping... >> + ;; (label (operating-system-default-label this-operating-system)) > > Same for this one and the other commented lines below. ...these all. They were pretty helpful for me to get it to work, initially. This will see more changes as Hurd support improves! Hmm, oops: the guix-system.sh test fails. Added this --8<---------------cut here---------------start------------->8--- --8<---------------cut here---------------end--------------->8--- to "fix" that. It feals a bit heavy, ugly and specific. Ideas? Greetings, Janneke diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 3a831cba1d..0e22686a34 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -307,7 +307,12 @@ guix system search anonym network | grep "^name: tor" # Verify that the examples can be built. for example in gnu/system/examples/*.tmpl; do - guix system -n disk-image "$example" + if echo "$example" | grep hurd; then + target="--target=i586-pc-gnu" + else + target= + fi + guix system -n disk-image $target "$example" done # Verify that the disk image types can be built. From patchwork Sat Jun 6 14:31:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 22571 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E612127BBE3; Sat, 6 Jun 2020 15:32:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C2B5127BBE1 for ; Sat, 6 Jun 2020 15:32:07 +0100 (BST) Received: from localhost ([::1]:50646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhZrj-0003UC-C1 for patchwork@mira.cbaines.net; Sat, 06 Jun 2020 10:32:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhZre-0003Tl-C2 for guix-patches@gnu.org; Sat, 06 Jun 2020 10:32:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhZre-00025a-2J for guix-patches@gnu.org; Sat, 06 Jun 2020 10:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhZrd-0007vi-VT for guix-patches@gnu.org; Sat, 06 Jun 2020 10:32:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service'. Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 06 Jun 2020 14:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41541 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 41541@debbugs.gnu.org Received: via spool by 41541-submit@debbugs.gnu.org id=B41541.159145390130455 (code B ref 41541); Sat, 06 Jun 2020 14:32:01 +0000 Received: (at 41541) by debbugs.gnu.org; 6 Jun 2020 14:31:41 +0000 Received: from localhost ([127.0.0.1]:52276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhZrF-0007v5-Ke for submit@debbugs.gnu.org; Sat, 06 Jun 2020 10:31:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhZrA-0007un-1K for 41541@debbugs.gnu.org; Sat, 06 Jun 2020 10:31:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32846) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhZr3-00022l-E6; Sat, 06 Jun 2020 10:31:25 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=34952 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jhZr2-0002en-N3; Sat, 06 Jun 2020 10:31:25 -0400 From: Jan Nieuwenhuizen Organization: AvatarAcademy.nl References: <20200604135914.4499-1-janneke@gnu.org> <20200604135914.4499-8-janneke@gnu.org> <87k10kv4d0.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Sat, 06 Jun 2020 16:31:22 +0200 In-Reply-To: <87k10kv4d0.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 06 Jun 2020 13:08:27 +0200") Message-ID: <87y2p01d1h.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Ludovic Courtès writes: > "Jan (janneke) Nieuwenhuizen" skribis: > >> * gnu/services/hurd.scm: New file. >> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >> * doc/guix.texi (Hurd Services): Document it. > > [...] As discussed on IRC: dropped altogether, replaced with attached patch. >> +@deffn {Scheme Procedure} hurd-etc-service @var{os} >> +This service implements a minimal @code{etc-service}, adding some >> +specifics for the Hurd. >> + >> +It is part of the @code{hurd-default-essential-services}. >> +@end deffn > > The ‘hurd-default-essential-services’ bit is not in this patch, though. Hmm. I think it's complicated...No, it was complicated. ETC depends on %activatation which depends on %boot, but those now work; so I can reorder! Reordered, added to hurd-default-essential-services in compliance with the documentation. >> +;;; The ETC service for the Hurd. > > s/ETC/etc/ OK. Eh... ok. ;-) >> +(define (hurd-etc-service os) [..] >> + (etc-service >> + `(("services" ,(file-append net-base "/etc/services")) >> + ("protocols" ,(file-append net-base "/etc/protocols")) >> + ("profile" ,profile) >> + ("hostname" ,(plain-file "hostname" (operating-system-host-name os))) >> + ("login" ,(file-append hurd "/etc/login")) >> + ("motd" ,(file-append hurd "/etc/motd")))))) > > Why again does it need to be different from that on GNU/Linux? Good question! Yeah...this started out as a more formalized copy of the gnu/system/hurd.scm hack and it used to be complicated; services didn't cross build, for example. Also, it felt good to start really minimalistic, especially because of the cross build troubles. I seemed to remember that on top of that there was a Hurd build problem, but I think that must have been sudo and it's easy to disable. > Intuitively it should be the same, but it’s fine to keep this one, > perhaps with a FIXME, until we’ve figured out what to do to use the same > /etc service in both cases. Phew, I didn't expect so much work; but also not so much cleanup so soon. Thanks, Janneke From 4cef6e73ce9fd137640c1c00f98958cdc41dda90 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 25 Apr 2020 11:55:56 +0200 Subject: [PATCH] services: Support etc-service for the Hurd. * gnu/system.scm (operating-system-etc-service): Cater for missing nsswitch and missing sudoers-file. For the Hurd, add "login" and "motd". (hurd-default-essential-services): Add operating-system-etc-service. --- gnu/system.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index ac64dfcff6..0df642679d 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -611,6 +611,7 @@ bookkeeping." (list (service system-service-type '()) %boot-service %activation-service + (operating-system-etc-service os) (service profile-service-type '()))) (define* (operating-system-services os) @@ -716,7 +717,7 @@ This is the GNU system. Welcome.\n") (define* (operating-system-etc-service os) "Return a that builds containing the static part of the /etc directory." - (let ((login.defs + (let* ((login.defs (plain-file "login.defs" (string-append "# Default paths for non-login shells started by su(1).\n" @@ -727,10 +728,13 @@ directory." "/run/current-system/profile/bin:" "/run/current-system/profile/sbin\n"))) - (issue (plain-file "issue" (operating-system-issue os))) - (nsswitch (plain-file "nsswitch.conf" - (name-service-switch->string - (operating-system-name-service-switch os)))) + (hurd (operating-system-hurd os)) + (issue (plain-file "issue" (operating-system-issue os))) + (nsswitch (operating-system-name-service-switch os)) + (nsswitch (and nsswitch + (plain-file "nsswitch.conf" + (name-service-switch->string nsswitch)))) + (sudoers (operating-system-sudoers-file os)) ;; Startup file for POSIX-compliant login shells, which set system-wide ;; environment variables. @@ -820,7 +824,7 @@ fi\n"))) ("rpc" ,(file-append net-base "/etc/rpc")) ("login.defs" ,#~#$login.defs) ("issue" ,#~#$issue) - ("nsswitch.conf" ,#~#$nsswitch) + ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '()) ("profile" ,#~#$profile) ("bashrc" ,#~#$bashrc) ("hosts" ,#~#$(or (operating-system-hosts-file os) @@ -836,7 +840,9 @@ fi\n"))) ("timezone" ,(plain-file "timezone" (operating-system-timezone os))) ("localtime" ,(file-append tzdata "/share/zoneinfo/" (operating-system-timezone os))) - ("sudoers" ,(operating-system-sudoers-file os)))))) + ,@(if sudoers `(("sudoers" ,sudoers)) '()) + ,@(if hurd `(("login" ,(file-append hurd "/etc/login")) + ("motd" ,(file-append hurd "/etc/motd")))))))) (define %root-account ;; Default root account. -- 2.26.2