From: Leo Famulari <leo@famulari.name>
To: 47979@debbugs.gnu.org
Subject: [bug#47979] [PATCH v6 2/3] installer: Recommend 'ntp-service-type' for non-graphical systems.
Date: Sun, 26 Dec 2021 15:31:30 -0500 [thread overview]
Message-ID: <817dd7dd12e866f87428dcac82fff96e42c4ba77.1640550687.git.leo@famulari.name> (raw)
In-Reply-To: <18b693c017c779578de0a6a367ebf0eab95c7054.1640550687.git.leo@famulari.name>
We had several bug reports with a root cause of "the clock was
incorrect" from users who used the installer to install a non-graphical
Guix System.
* gnu/installer/services.scm (%system-services): Add the ntp-service-type.
* gnu/installer/newt/services.scm (run-system-administration-cbt-page): New
variable.
(run-services-page): Use run-system-administration-cbt-page when not
installing a desktop.
* gnu/installer/tests.scm (choose-services): Add and use a
choose-misc-service? procedure.
* gnu/tests/install.scm (installation-target-os-for-gui-tests)<services>: Add
ntp-service-type.
---
gnu/installer/newt/services.scm | 25 ++++++++++++++++++++++++-
gnu/installer/services.scm | 8 ++++++++
gnu/installer/tests.scm | 10 +++++++++-
gnu/tests/install.scm | 5 +++--
4 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm
index b4b5219b20..c218825813 100644
--- a/gnu/installer/newt/services.scm
+++ b/gnu/installer/newt/services.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -88,6 +89,27 @@ (define (run-printing-services-cbt-page)
(condition
(&installer-step-abort)))))))
+(define (run-console-services-cbt-page)
+ "Run a page to select various system adminstration services for non-graphical
+systems."
+ (let ((items (filter (lambda (service)
+ (eq? 'administration
+ (system-service-type service)))
+ %system-services)))
+ (run-checkbox-tree-page
+ #:title (G_ "Console services")
+ #:info-text (G_ "Select miscellaneous services to run on your \
+non-graphical system.")
+ #:items items
+ #:selection (map system-service-recommended? items)
+ #:item->text (compose G_ system-service-name)
+ #:checkbox-tree-height 5
+ #:exit-button-callback-procedure
+ (lambda ()
+ (raise
+ (condition
+ (&installer-step-abort)))))))
+
(define (run-network-management-page)
"Run a page to select among several network management methods."
(let ((title (G_ "Network management")))
@@ -119,6 +141,7 @@ (define (run-services-page)
(append desktop
(run-networking-cbt-page)
(if (null? desktop)
- (list (run-network-management-page))
+ (cons (run-network-management-page)
+ (run-console-services-cbt-page))
'())
(run-printing-services-cbt-page))))
diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm
index 341d8b69c8..94c49307f0 100644
--- a/gnu/installer/services.scm
+++ b/gnu/installer/services.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -104,6 +105,13 @@ (define %system-services
(packages '((specification->package "nss-certs")))
(recommended? #t))
+ ;; Miscellaneous system administration services.
+ (system-service
+ (name (G_ "Network time service (NTP), to set the clock automatically"))
+ (type 'administration)
+ (recommended? #t)
+ (snippet '((service ntp-service-type))))
+
;; Network connectivity management.
(system-service
(name (G_ "NetworkManager network connection manager"))
diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm
index 5d931149b8..39be59f689 100644
--- a/gnu/installer/tests.scm
+++ b/gnu/installer/tests.scm
@@ -221,7 +221,11 @@ (define* (choose-services port
(choose-network-management-tool?
(lambda (service)
(string-contains service "DHCP")))
- (choose-other-service? (const #f)))
+ (choose-other-service? (const #f))
+ (choose-misc-service?
+ (lambda (service)
+ (string-contains service "NTP"))))
+
"Converse over PORT to choose services."
(define desktop-environments '())
@@ -243,6 +247,10 @@ (define desktop-environments '())
(null? desktop-environments)
(find choose-network-management-tool? services))
+ ((checkbox-list (title "Console services") (text _)
+ (items ,services))
+ (filter choose-misc-service? services))
+
((checkbox-list (title "Printing and document services") (text _)
(items ,services))
(filter choose-other-service? services))))
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 154f98b2e1..ae8c6051f1 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -1685,8 +1685,9 @@ (define* (installation-target-os-for-gui-tests
(list
(swap-space
(target (uuid "11111111-2222-3333-4444-123456789abc"))))))
- (services (cons (service dhcp-client-service-type)
- (operating-system-user-services %minimal-os-on-vda)))))
+ (services (cons* (service dhcp-client-service-type)
+ (service ntp-service-type)
+ (operating-system-user-services %minimal-os-on-vda)))))
(define* (installation-target-desktop-os-for-gui-tests
#:key (encrypted? #f))
--
2.34.0
next prev parent reply other threads:[~2021-12-26 20:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 18:53 [bug#47979] [PATCH] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-04-23 18:56 ` Leo Famulari
2021-04-23 22:45 ` Leo Famulari
2021-04-23 23:20 ` Leo Famulari
2021-04-24 0:56 ` [bug#47979] [PATCH v3] " Leo Famulari
2021-05-02 4:36 ` Leo Famulari
2021-05-02 9:25 ` Mathieu Othacehe
2021-05-02 15:22 ` Leo Famulari
2021-05-21 12:58 ` [bug#47979] [PATCH] " Mathieu Othacehe
2021-05-21 13:37 ` Leo Famulari
2021-05-21 14:21 ` Leo Famulari
2021-05-21 14:26 ` Leo Famulari
2021-05-21 14:39 ` Mathieu Othacehe
2021-05-21 21:01 ` Leo Famulari
2021-05-21 21:44 ` Leo Famulari
2021-06-01 9:49 ` Mathieu Othacehe
2021-12-24 18:04 ` [bug#47979] [PATCH v5] gnu: binutils: Fix CVE-2021-45078 Leo Famulari
2021-12-24 18:04 ` [bug#47979] [PATCH v5 1/2] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-12-24 18:04 ` [bug#47979] [PATCH v5 2/2] installer: Offer 'gpm-service-type' " Leo Famulari
2021-12-24 18:14 ` [bug#47979] [PATCH v5 1/2] installer: Recommend 'ntp-service-type' " Leo Famulari
2021-12-26 20:31 ` [bug#47979] [PATCH v6 1/3] installer: Offer the CUPS printing service on a dedicated page Leo Famulari
2021-12-26 20:31 ` Leo Famulari [this message]
2021-12-26 20:33 ` [bug#47979] [PATCH v6 2/3] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-12-26 21:06 ` Mathieu Othacehe
2021-12-27 0:57 ` Leo Famulari
2021-12-26 20:31 ` [bug#47979] [PATCH v6 3/3] installer: Offer 'gpm-service-type' " Leo Famulari
2021-12-27 22:24 ` [bug#47979] [PATCH v7 1/3] installer: Offer the CUPS printing service on a dedicated page Leo Famulari
2021-12-27 22:24 ` [bug#47979] [PATCH v7 2/3] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-12-27 23:53 ` Leo Famulari
2021-12-28 4:54 ` Leo Famulari
2021-12-28 8:27 ` Mathieu Othacehe
2021-12-28 20:34 ` bug#47979: " Leo Famulari
2021-12-27 22:24 ` [bug#47979] [PATCH v7 3/3] installer: Offer 'gpm-service-type' " Leo Famulari
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=817dd7dd12e866f87428dcac82fff96e42c4ba77.1640550687.git.leo@famulari.name \
--to=leo@famulari.name \
--cc=47979@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).