unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 41541@debbugs.gnu.org
Subject: [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service'.
Date: Sat, 06 Jun 2020 16:31:22 +0200	[thread overview]
Message-ID: <87y2p01d1h.fsf@gnu.org> (raw)
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")

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-Support-etc-service-for-the-Hurd.patch --]
[-- Type: text/x-patch, Size: 3181 bytes --]

From 4cef6e73ce9fd137640c1c00f98958cdc41dda90 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
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 <service> 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


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

  reply	other threads:[~2020-06-06 14:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200604135914.4499-1-janneke@gnu.org>
     [not found] ` <20200604135914.4499-2-janneke@gnu.org>
2020-06-06 10:45   ` [bug#41541] [PATCH 1/8] system: Add 'hurd' field to <operating-system> Ludovic Courtès
2020-06-06 11:14     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-3-janneke@gnu.org>
2020-06-06 10:48   ` [bug#41541] [PATCH 2/8] bootloader: Extend `<menu-entry>' for multiboot Ludovic Courtès
2020-06-06 12:00     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-4-janneke@gnu.org>
     [not found]   ` <87eeqsmyxy.fsf@gnu.org>
2020-06-06 10:55     ` [bug#41541] [PATCH 3/8] system: Add 'multiboot-modules' field to <boot-parameters> Ludovic Courtès
2020-06-07  7:39       ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-5-janneke@gnu.org>
2020-06-06 10:57   ` [bug#41541] [PATCH 4/8] bootloader: grub: Add support for multiboot Ludovic Courtès
2020-06-06 12:08     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-6-janneke@gnu.org>
2020-06-06 10:57   ` [bug#41541] [PATCH 5/8] system: Use 'hurd' package in label Ludovic Courtès
     [not found] ` <20200604135914.4499-7-janneke@gnu.org>
     [not found]   ` <875zc4mxtu.fsf@gnu.org>
2020-06-06 10:58     ` [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl Jan Nieuwenhuizen
2020-06-06 16:49       ` Mathieu Othacehe
2020-06-06 22:44         ` Jan Nieuwenhuizen
2020-06-06 10:59   ` Ludovic Courtès
2020-06-06 12:34     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-9-janneke@gnu.org>
2020-06-06 11:05   ` [bug#41541] [PATCH 8/8] system: Add `hurd-activation' Ludovic Courtès
2020-06-06 14:21     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-8-janneke@gnu.org>
2020-06-06 11:08   ` [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service' Ludovic Courtès
2020-06-06 14:31     ` Jan Nieuwenhuizen [this message]
2020-06-07 20:02       ` Ludovic Courtès
2020-06-07 20:31         ` 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=87y2p01d1h.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=41541@debbugs.gnu.org \
    --cc=ludo@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).