From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 07 04:31:12 2020 Received: (at submit) by debbugs.gnu.org; 7 Apr 2020 08:31:12 +0000 Received: from localhost ([127.0.0.1]:49533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jLjdX-00082G-Jf for submit@debbugs.gnu.org; Tue, 07 Apr 2020 04:31:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:42179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jLjdV-0007zX-7O for submit@debbugs.gnu.org; Tue, 07 Apr 2020 04:31:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50389) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLjdT-0008Ew-GJ for guix-patches@gnu.org; Tue, 07 Apr 2020 04:31:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLjdR-0001TO-SJ for guix-patches@gnu.org; Tue, 07 Apr 2020 04:31:07 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:60129) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jLjdR-0001S7-JW for guix-patches@gnu.org; Tue, 07 Apr 2020 04:31:05 -0400 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 4C1E0100005 for ; Tue, 7 Apr 2020 08:31:00 +0000 (UTC) From: Brice Waegeneire To: guix-patches@gnu.org Subject: [PATCH] services: Add file-system utils to profile. Date: Tue, 7 Apr 2020 10:30:54 +0200 Message-Id: <20200407083054.19472-1-brice@waegenei.re> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.178.231 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/base.scm (file-system-type->utils, file-system-utils): New procedure. (file-system-service-type): Extend 'profile-service-type' with 'file-system-utils'. * gnu/system.scm (boot-file-system-service): New procedure... (operating-system-default-essential-services): ... use it. (%base-packages): Remove 'e2fsprogs'. * gnu/system/file-systems.scm (file-system): Add 'utils?' field. --- gnu/services/base.scm | 39 +++++++++++++++++++++++++++++++++++-- gnu/system.scm | 28 +++++++++++++++++--------- gnu/system/file-systems.scm | 6 +++++- 3 files changed, 61 insertions(+), 12 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 070765ab83..1fef44cf01 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,13 +44,20 @@ #:select (file-system-packages)) #:use-module (gnu packages admin) #:use-module ((gnu packages linux) - #:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools)) + #:select (alsa-utils btrfs-progs crda eudev eudev/btrfs-fix + e2fsprogs f2fs-tools fuse gpm kbd lvm2 rng-tools + util-linux xfsprogs)) #:use-module (gnu packages bash) #:use-module ((gnu packages base) #:select (canonical-package coreutils glibc glibc-utf8-locales)) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) - #:use-module (gnu packages linux) + #:use-module ((gnu packages disk) + #:select (dosfstools)) + #:use-module ((gnu packages file-systems) + #:select (bcachefs-tools jfsutils zfs)) + #:use-module ((gnu packages mtools) + #:select (exfat-utils)) #:use-module (gnu packages terminals) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask)) @@ -59,12 +66,15 @@ #:use-module (guix modules) #:use-module ((guix self) #:select (make-config.scm)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-2) #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (ice-9 format) #:export (fstab-service-type root-file-system-service file-system-service-type + file-system-utils swap-service user-processes-service-type host-name-service @@ -535,6 +545,29 @@ FILE-SYSTEM." (memq 'bind-mount (file-system-flags file-system)))) file-systems)) +(define (file-system-type->utils type) + "Return a utils package for file system TYPE." + (define pattern->utils + `(("ext[234]" . ,e2fsprogs) + ("btrfs" . ,btrfs-progs) + ("jfs" . ,jfsutils) + ("exfat" . ,exfat-utils) + ("bachefs" . ,bcachefs-tools) + ("xfs" . ,xfsprogs) + ("fat" . ,dosfstools) + ("f2fs" . ,f2fs-tools) + ("zfs" . ,zfs))) + (and-let* ((utils + (find (lambda (a) (string-match (car a) type)) pattern->utils))) + (cdr utils))) + +(define (file-system-utils file-systems) + "Return the list of file-system utils packages for FILE-SYSTEMS" + (filter-map (lambda (file-system) + (when (file-system-utils? file-system) + (file-system-type->utils (file-system-type file-system)))) + file-systems)) + (define file-system-service-type (service-type (name 'file-systems) (extensions @@ -542,6 +575,8 @@ FILE-SYSTEM." file-system-shepherd-services) (service-extension fstab-service-type file-system-fstab-entries) + (service-extension profile-service-type + file-system-utils) ;; Have 'user-processes' depend on 'file-systems'. (service-extension user-processes-service-type diff --git a/gnu/system.scm b/gnu/system.scm index fd456c6206..d86098fbe0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Meiyo Peng ;;; Copyright © 2020 Danny Milosavljevic +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -418,6 +419,14 @@ marked as 'needed-for-boot'." (service file-system-service-type (map add-dependencies file-systems))) +(define (boot-file-system-service os) + "Return a service adding to the system profile the file system utils +packages for the file systems of OS that are marked as 'needed-for-boot'." + (let ((file-systems (filter file-system-needed-for-boot? + (operating-system-file-systems os)))) + (simple-service 'boot-file-system-utils profile-service-type + (file-system-utils file-systems)))) + (define (mapped-device-users device file-systems) "Return the subset of FILE-SYSTEMS that use DEVICE." (let ((target (string-append "/dev/mapper/" (mapped-device-target device)))) @@ -504,13 +513,14 @@ bookkeeping." (define known-fs (map file-system-mount-point (operating-system-file-systems os))) - (let* ((mappings (device-mapping-services os)) - (root-fs (root-file-system-service)) - (other-fs (non-boot-file-system-service os)) - (swaps (swap-services os)) - (procs (service user-processes-service-type)) - (host-name (host-name-service (operating-system-host-name os))) - (entries (operating-system-directory-base-entries os))) + (let* ((mappings (device-mapping-services os)) + (root-fs (root-file-system-service)) + (boot-fs (boot-file-system-service os)) + (non-boot-fs (non-boot-file-system-service os)) + (swaps (swap-services os)) + (procs (service user-processes-service-type)) + (host-name (host-name-service (operating-system-host-name os))) + (entries (operating-system-directory-base-entries os))) (cons* (service system-service-type entries) %boot-service @@ -537,7 +547,7 @@ bookkeeping." (operating-system-setuid-programs os)) (service profile-service-type (operating-system-packages os)) - other-fs + boot-fs non-boot-fs (append mappings swaps ;; Add the firmware service. @@ -607,7 +617,7 @@ of PROVENANCE-SERVICE-TYPE to its services." ;; already depends on it anyway. kmod eudev - e2fsprogs kbd + kbd bash-completion diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 3b599efa8e..9bc1687696 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +43,7 @@ file-system-create-mount-point? file-system-dependencies file-system-location + file-system-utils? file-system-type-predicate @@ -111,7 +113,9 @@ (default '())) ; or (location file-system-location (default (current-source-location)) - (innate))) + (innate)) + (utils? file-system-utils? ; Boolean + (default #t))) ;; A file system label for use in the 'device' field. (define-record-type -- 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 15:10:17 2020 Received: (at 40480) by debbugs.gnu.org; 12 Apr 2020 19:10:17 +0000 Received: from localhost ([127.0.0.1]:58888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNhzk-0000Qy-SD for submit@debbugs.gnu.org; Sun, 12 Apr 2020 15:10:17 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:55497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNhzi-0000Qg-AA for 40480@debbugs.gnu.org; Sun, 12 Apr 2020 15:10:15 -0400 X-Originating-IP: 78.237.113.178 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 1221D60002 for <40480@debbugs.gnu.org>; Sun, 12 Apr 2020 19:10:06 +0000 (UTC) From: Brice Waegeneire To: 40480@debbugs.gnu.org Subject: [PATCH v2] services: Add file-system utils to profile. Date: Sun, 12 Apr 2020 21:10:02 +0200 Message-Id: <20200412191002.3165-1-brice@waegenei.re> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40480 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/services/base.scm (file-system-type->utils, file-system-utils): New procedures. (file-system-service-type): Extend 'profile-service-type' with 'file-system-utils'. * gnu/system.scm (boot-file-system-service): New procedure... (operating-system-default-essential-services): ...use it. (%base-packages): Remove 'e2fsprogs'. * gnu/system/file-systems.scm (file-system): Add 'utils?' field. --- This version simplify 'file-system-type->utils' and makes it compliant with the coding style. gnu/services/base.scm | 40 +++++++++++++++++++++++++++++++++++-- gnu/system.scm | 28 +++++++++++++++++--------- gnu/system/file-systems.scm | 6 +++++- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 070765ab83..9744a6517a 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,13 +44,20 @@ #:select (file-system-packages)) #:use-module (gnu packages admin) #:use-module ((gnu packages linux) - #:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools)) + #:select (alsa-utils btrfs-progs crda eudev eudev/btrfs-fix + e2fsprogs f2fs-tools fuse gpm kbd lvm2 rng-tools + util-linux xfsprogs)) #:use-module (gnu packages bash) #:use-module ((gnu packages base) #:select (canonical-package coreutils glibc glibc-utf8-locales)) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) - #:use-module (gnu packages linux) + #:use-module ((gnu packages disk) + #:select (dosfstools)) + #:use-module ((gnu packages file-systems) + #:select (bcachefs-tools jfsutils zfs)) + #:use-module ((gnu packages mtools) + #:select (exfat-utils)) #:use-module (gnu packages terminals) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask)) @@ -59,12 +66,15 @@ #:use-module (guix modules) #:use-module ((guix self) #:select (make-config.scm)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-2) #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (ice-9 format) #:export (fstab-service-type root-file-system-service file-system-service-type + file-system-utils swap-service user-processes-service-type host-name-service @@ -535,6 +545,30 @@ FILE-SYSTEM." (memq 'bind-mount (file-system-flags file-system)))) file-systems)) +(define (file-system-type->utils type) + "Return a utils package for file system TYPE, #f otherwise." + (assoc-ref + `(("bachefs" . ,bcachefs-tools) + ("btrfs" . ,btrfs-progs) + ("exfat" . ,exfat-utils) + ("ext2" . ,e2fsprogs) + ("ext3" . ,e2fsprogs) + ("ext4" . ,e2fsprogs) + ("fat" . ,dosfstools) + ("f2fs" . ,f2fs-tools) + ("jfs" . ,jfsutils) + ("vfat" . ,dosfstools) + ("xfs" . ,xfsprogs) + ("zfs" . ,zfs)) + type)) + +(define (file-system-utils file-systems) + "Return the list of file-system utils packages for FILE-SYSTEMS" + (filter-map (lambda (file-system) + (when (file-system-utils? file-system) + (file-system-type->utils (file-system-type file-system)))) + file-systems)) + (define file-system-service-type (service-type (name 'file-systems) (extensions @@ -542,6 +576,8 @@ FILE-SYSTEM." file-system-shepherd-services) (service-extension fstab-service-type file-system-fstab-entries) + (service-extension profile-service-type + file-system-utils) ;; Have 'user-processes' depend on 'file-systems'. (service-extension user-processes-service-type diff --git a/gnu/system.scm b/gnu/system.scm index fd456c6206..d86098fbe0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Meiyo Peng ;;; Copyright © 2020 Danny Milosavljevic +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -418,6 +419,14 @@ marked as 'needed-for-boot'." (service file-system-service-type (map add-dependencies file-systems))) +(define (boot-file-system-service os) + "Return a service adding to the system profile the file system utils +packages for the file systems of OS that are marked as 'needed-for-boot'." + (let ((file-systems (filter file-system-needed-for-boot? + (operating-system-file-systems os)))) + (simple-service 'boot-file-system-utils profile-service-type + (file-system-utils file-systems)))) + (define (mapped-device-users device file-systems) "Return the subset of FILE-SYSTEMS that use DEVICE." (let ((target (string-append "/dev/mapper/" (mapped-device-target device)))) @@ -504,13 +513,14 @@ bookkeeping." (define known-fs (map file-system-mount-point (operating-system-file-systems os))) - (let* ((mappings (device-mapping-services os)) - (root-fs (root-file-system-service)) - (other-fs (non-boot-file-system-service os)) - (swaps (swap-services os)) - (procs (service user-processes-service-type)) - (host-name (host-name-service (operating-system-host-name os))) - (entries (operating-system-directory-base-entries os))) + (let* ((mappings (device-mapping-services os)) + (root-fs (root-file-system-service)) + (boot-fs (boot-file-system-service os)) + (non-boot-fs (non-boot-file-system-service os)) + (swaps (swap-services os)) + (procs (service user-processes-service-type)) + (host-name (host-name-service (operating-system-host-name os))) + (entries (operating-system-directory-base-entries os))) (cons* (service system-service-type entries) %boot-service @@ -537,7 +547,7 @@ bookkeeping." (operating-system-setuid-programs os)) (service profile-service-type (operating-system-packages os)) - other-fs + boot-fs non-boot-fs (append mappings swaps ;; Add the firmware service. @@ -607,7 +617,7 @@ of PROVENANCE-SERVICE-TYPE to its services." ;; already depends on it anyway. kmod eudev - e2fsprogs kbd + kbd bash-completion diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 3b599efa8e..9bc1687696 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +43,7 @@ file-system-create-mount-point? file-system-dependencies file-system-location + file-system-utils? file-system-type-predicate @@ -111,7 +113,9 @@ (default '())) ; or (location file-system-location (default (current-source-location)) - (innate))) + (innate)) + (utils? file-system-utils? ; Boolean + (default #t))) ;; A file system label for use in the 'device' field. (define-record-type -- 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 15:26:43 2020 Received: (at 40480) by debbugs.gnu.org; 12 Apr 2020 19:26:43 +0000 Received: from localhost ([127.0.0.1]:58898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNiFf-0000p3-Mb for submit@debbugs.gnu.org; Sun, 12 Apr 2020 15:26:43 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:43363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNiFe-0000oo-Gm for 40480@debbugs.gnu.org; Sun, 12 Apr 2020 15:26:43 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay5-d.mail.gandi.net (Postfix) with ESMTPA id C1BAB1C0004 for <40480@debbugs.gnu.org>; Sun, 12 Apr 2020 19:26:35 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 12 Apr 2020 19:26:35 +0000 From: Brice Waegeneire To: 40480@debbugs.gnu.org Subject: [PATCH v2] services: Add file-system utils to profile. Message-ID: <78971e71972c6deae8207b26ad0f1dce@waegenei.re> X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40480 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Guix, Looks like I forgot to describe this patch... It adds the utils package of each used file-system type to the system profile. This behavior can be disabled by setting the “file-system-utils?” field to #f. When you have an issue with your file system it's not the time to discover the absence of the utility package nor trying to install it. This patch fix that. We talked about such feature at[0]. [0]: https://issues.guix.info/issue/39332 - Brice From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 14:50:22 2020 Received: (at 40480) by debbugs.gnu.org; 22 Apr 2020 18:50:22 +0000 Received: from localhost ([127.0.0.1]:53229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRKRy-0004u7-6c for submit@debbugs.gnu.org; Wed, 22 Apr 2020 14:50:22 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:40971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRKRv-0004tr-Vz for 40480@debbugs.gnu.org; Wed, 22 Apr 2020 14:50:21 -0400 X-Originating-IP: 78.237.113.178 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 1564B60008 for <40480@debbugs.gnu.org>; Wed, 22 Apr 2020 18:50:12 +0000 (UTC) From: Brice Waegeneire To: 40480@debbugs.gnu.org Subject: [PATCH v3] services: Add file-system utils to profile. Date: Wed, 22 Apr 2020 20:50:04 +0200 Message-Id: <20200422185004.12102-1-brice@waegenei.re> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40480 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/services/base.scm (file-system-type->utils, file-system-utils): New procedures. (file-system-service-type): Extend 'profile-service-type' with 'file-system-utils'. * gnu/system.scm (boot-file-system-service): New procedure... (operating-system-default-essential-services): ...use it. (%base-packages): Remove 'e2fsprogs'. * gnu/system/file-systems.scm (file-system): Add 'utils?' field. --- Rebased ontop of master. gnu/services/base.scm | 40 +++++++++++++++++++++++++++++++++++-- gnu/system.scm | 28 ++++++++++++++++---------- gnu/system/file-systems.scm | 6 +++++- 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 2913478e4a..9a1d2f9efa 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,13 +44,20 @@ #:select (file-system-packages)) #:use-module (gnu packages admin) #:use-module ((gnu packages linux) - #:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools)) + #:select (alsa-utils btrfs-progs crda eudev eudev/btrfs-fix + e2fsprogs f2fs-tools fuse gpm kbd lvm2 rng-tools + util-linux xfsprogs)) #:use-module (gnu packages bash) #:use-module ((gnu packages base) #:select (canonical-package coreutils glibc glibc-utf8-locales)) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) - #:use-module (gnu packages linux) + #:use-module ((gnu packages disk) + #:select (dosfstools)) + #:use-module ((gnu packages file-systems) + #:select (bcachefs-tools jfsutils zfs)) + #:use-module ((gnu packages mtools) + #:select (exfat-utils)) #:use-module (gnu packages terminals) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask)) @@ -59,13 +66,16 @@ #:use-module (guix modules) #:use-module ((guix self) #:select (make-config.scm)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-2) #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (ice-9 format) #:re-export (user-processes-service-type) ;backwards compatibility #:export (fstab-service-type root-file-system-service file-system-service-type + file-system-utils swap-service host-name-service console-keymap-service @@ -413,6 +423,30 @@ FILE-SYSTEM." (memq 'bind-mount (file-system-flags file-system)))) file-systems)) +(define (file-system-type->utils type) + "Return a utils package for file system TYPE, #f otherwise." + (assoc-ref + `(("bachefs" . ,bcachefs-tools) + ("btrfs" . ,btrfs-progs) + ("exfat" . ,exfat-utils) + ("ext2" . ,e2fsprogs) + ("ext3" . ,e2fsprogs) + ("ext4" . ,e2fsprogs) + ("fat" . ,dosfstools) + ("f2fs" . ,f2fs-tools) + ("jfs" . ,jfsutils) + ("vfat" . ,dosfstools) + ("xfs" . ,xfsprogs) + ("zfs" . ,zfs)) + type)) + +(define (file-system-utils file-systems) + "Return the list of file-system utils packages for FILE-SYSTEMS" + (filter-map (lambda (file-system) + (when (file-system-utils? file-system) + (file-system-type->utils (file-system-type file-system)))) + file-systems)) + (define file-system-service-type (service-type (name 'file-systems) (extensions @@ -420,6 +454,8 @@ FILE-SYSTEM." file-system-shepherd-services) (service-extension fstab-service-type file-system-fstab-entries) + (service-extension profile-service-type + file-system-utils) ;; Have 'user-processes' depend on 'file-systems'. (service-extension user-processes-service-type diff --git a/gnu/system.scm b/gnu/system.scm index 3ee2c84235..efd88fa373 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -423,6 +423,14 @@ marked as 'needed-for-boot'." (service file-system-service-type (map add-dependencies file-systems))) +(define (boot-file-system-service os) + "Return a service adding to the system profile the file system utils +packages for the file systems of OS that are marked as 'needed-for-boot'." + (let ((file-systems (filter file-system-needed-for-boot? + (operating-system-file-systems os)))) + (simple-service 'boot-file-system-utils profile-service-type + (file-system-utils file-systems)))) + (define (mapped-device-users device file-systems) "Return the subset of FILE-SYSTEMS that use DEVICE." (let ((target (string-append "/dev/mapper/" (mapped-device-target device)))) @@ -503,13 +511,14 @@ bookkeeping." (define known-fs (map file-system-mount-point (operating-system-file-systems os))) - (let* ((mappings (device-mapping-services os)) - (root-fs (root-file-system-service)) - (other-fs (non-boot-file-system-service os)) - (swaps (swap-services os)) - (procs (service user-processes-service-type)) - (host-name (host-name-service (operating-system-host-name os))) - (entries (operating-system-directory-base-entries os))) + (let* ((mappings (device-mapping-services os)) + (root-fs (root-file-system-service)) + (boot-fs (boot-file-system-service os)) + (non-boot-fs (non-boot-file-system-service os)) + (swaps (swap-services os)) + (procs (service user-processes-service-type)) + (host-name (host-name-service (operating-system-host-name os))) + (entries (operating-system-directory-base-entries os))) (cons* (service system-service-type entries) %boot-service @@ -536,7 +545,7 @@ bookkeeping." (operating-system-setuid-programs os)) (service profile-service-type (operating-system-packages os)) - other-fs + boot-fs non-boot-fs (append mappings swaps ;; Add the firmware service. @@ -629,8 +638,7 @@ of PROVENANCE-SERVICE-TYPE to its services." (define %base-packages ;; Default set of packages globally visible. It should include anything ;; required for basic administrator tasks. - (append (list e2fsprogs) - %base-packages-interactive + (append %base-packages-interactive %base-packages-linux %base-packages-networking %base-packages-utils)) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 3b599efa8e..9bc1687696 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +43,7 @@ file-system-create-mount-point? file-system-dependencies file-system-location + file-system-utils? file-system-type-predicate @@ -111,7 +113,9 @@ (default '())) ; or (location file-system-location (default (current-source-location)) - (innate))) + (innate)) + (utils? file-system-utils? ; Boolean + (default #t))) ;; A file system label for use in the 'device' field. (define-record-type -- 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 17:28:39 2020 Received: (at 40480) by debbugs.gnu.org; 22 Apr 2020 21:28:39 +0000 Received: from localhost ([127.0.0.1]:53473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRMv9-0000bm-Aw for submit@debbugs.gnu.org; Wed, 22 Apr 2020 17:28:39 -0400 Received: from tobias.gr ([80.241.217.52]:47514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRMv6-0000bc-Sj for 40480@debbugs.gnu.org; Wed, 22 Apr 2020 17:28:38 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id 35c08e7b for <40480@debbugs.gnu.org>; Wed, 22 Apr 2020 21:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to :subject:references:in-reply-to:date:message-id:mime-version :content-type; s=2018; i=me@tobias.gr; bh=mKvGHw6XWImO/wcYQl5xCd MDJFG40j9jW18SIzT+Dwc=; b=EHwa9Rwmp8uL7ZlFY7VtQAhIzGkUHRlcVrHpxZ tX9l+DiiwVP7TuXJyZj9J460ERHSJOJZzoEGj5FymOzH9l8My8GpnGahrVUnrIl3 U8TonRxLPJdtMAbCyVNTvdqGclNATcZ+ZZ/LYUgVly2DKcLQhGsuPabRyJbjTHcO 9nzg7VKOj+oGldzu/wizceg9Kp1iIyBGA+PtMu/tLQt38i8nwzP1Xf9TUpz2IXk6 AxLnDyeDG/6wEEj7SMG7gJnUE4yCQXByknsxvjESyBgosjJEMt/X9cFJm7zJ3uAp xCIwFGCEET3sFCZ+aLK04fwsR5Rdfazrli13wXvZ4EFGXRYQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id e516024c (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <40480@debbugs.gnu.org>; Wed, 22 Apr 2020 21:28:34 +0000 (UTC) From: Tobias Geerinckx-Rice To: 40480@debbugs.gnu.org Subject: Re: [bug#40480] [PATCH v3] services: Add file-system utils to profile. References: <20200407083054.19472-1-brice@waegenei.re> <20200422185004.12102-1-brice@waegenei.re> In-reply-to: <20200422185004.12102-1-brice@waegenei.re> Date: Wed, 22 Apr 2020 23:26:53 +0200 Message-ID: <87wo67fbz6.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40480 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Brice, Thanks for this and your very polite pings :-) I'm amused that bcachefs is amongst this list so I'll test it on a=20 bcachefs system and get back to you. Both (srfi srfi-2) and/or (ice-9 regex) seem to be unused. Did I=20 miss something? In the next revision and future patches, please write =E2=80=98utilities=E2= =80=99=20 instead of =E2=80=98utils=E2=80=99, =E2=80=98operating-system=E2=80=99 inst= ead of =E2=80=98os=E2=80=99, &c. (in=20 prose and code). In general, in Scheme, avoid all the tedious and=20 unnecessary abbreviation fashionable in some other languages. Kind regards, T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXqC2nQAKCRANsP+IT1Vt eXsHAQCUIdb46A6BLhRz7QzFVfa4BEV1Gk9u/W8moVZ7pOjt3AD7B+sI6tBv5bRD +ucWknKjAQzIa+5EbeubvaYw/9S/pwE= =1f5y -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 17:45:40 2020 Received: (at 40480) by debbugs.gnu.org; 22 Apr 2020 21:45:40 +0000 Received: from localhost ([127.0.0.1]:53478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRNBb-00011f-PZ for submit@debbugs.gnu.org; Wed, 22 Apr 2020 17:45:40 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:58354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRNBa-00011W-Mn for 40480@debbugs.gnu.org; Wed, 22 Apr 2020 17:45:39 -0400 Received: from localhost (80-110-126-163.cgn.dynamic.surfer.at [80.110.126.163]) by dd26836.kasserver.com (Postfix) with ESMTPSA id D56BC3366D4E; Wed, 22 Apr 2020 23:45:36 +0200 (CEST) Date: Wed, 22 Apr 2020 23:45:33 +0200 From: Danny Milosavljevic To: Brice Waegeneire Subject: Re: [bug#40480] [PATCH v3] services: Add file-system utils to profile. Message-ID: <20200422234533.208c22d2@scratchpost.org> In-Reply-To: <20200422185004.12102-1-brice@waegenei.re> References: <20200407083054.19472-1-brice@waegenei.re> <20200422185004.12102-1-brice@waegenei.re> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/goJiBPM+9/R4LJ04/f8e5ke"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40480 Cc: 40480@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/goJiBPM+9/R4LJ04/f8e5ke Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 22 Apr 2020 20:50:04 +0200 Brice Waegeneire wrote: > +(define (file-system-type->utils type) > + "Return a utils package for file system TYPE, #f otherwise." > + (assoc-ref > + `(("bachefs" . ,bcachefs-tools) ^^ Typo? --Sig_/goJiBPM+9/R4LJ04/f8e5ke Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl6guv0ACgkQ5xo1VCww uqUntwf+LX8lXDE51yof3n8bhFXURXD0UqpwdpLK74ytB0MZOoMQ8awoubWo4FZ2 bKkFmVg72KHgdtMAAHxGaz/O2Hiwx3yBYJLjyYTcLJLzhy+AT0sJ3NmcBYin2WPh 62240/u4nqkawg2f1aB8f0wg9yLhe2RGNw8xsRvo0h8jzEZ/F0SwCMk+DmXjRBd0 3zcHoJ+5VukUo1lqzbnlhCYDn6N3dALoHHUjmt5oxsEdpOVfrNAbdvWsuQf9joaB KZ0wuENYWFBgNE3MmN9JfYkMk1paRGS7kcVgmzJ5Npfm36GJeTgPSKD17VlwHKQm Q6TZ6y4Y23C9ZJpT4QLUqylhKaCiXA== =yTG3 -----END PGP SIGNATURE----- --Sig_/goJiBPM+9/R4LJ04/f8e5ke-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 23 08:00:20 2020 Received: (at 40480) by debbugs.gnu.org; 23 Apr 2020 12:00:20 +0000 Received: from localhost ([127.0.0.1]:54190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRaWh-0001U9-Tu for submit@debbugs.gnu.org; Thu, 23 Apr 2020 08:00:20 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRaWf-0001To-6s for 40480@debbugs.gnu.org; Thu, 23 Apr 2020 08:00:18 -0400 X-Originating-IP: 78.237.113.178 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 6F65D1BF212 for <40480@debbugs.gnu.org>; Thu, 23 Apr 2020 12:00:08 +0000 (UTC) From: Brice Waegeneire To: 40480@debbugs.gnu.org Subject: [PATCH v4] services: Add file system utilities to profile. Date: Thu, 23 Apr 2020 14:00:02 +0200 Message-Id: <20200423120002.32554-1-brice@waegenei.re> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40480 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/services/base.scm (file-system-type->utilities, file-system-utilities): New procedures. (file-system-service-type): Extend 'profile-service-type' with 'file-system-utilities'. * gnu/system.scm (boot-file-system-service): New procedure... (operating-system-default-essential-services): ...use it. (%base-packages): Remove 'e2fsprogs'. * gnu/system/file-systems.scm (file-system): Add 'utilities?' field. --- Fix bcachefs typo and replace 'utils' by 'utilities'. Reword the documentation procedures to be clearer. Remove (srfi srfi-2) and (ice-9 regex) which weren't used since v1. gnu/services/base.scm | 40 +++++++++++++++++++++++++++++++++++-- gnu/system.scm | 28 ++++++++++++++++---------- gnu/system/file-systems.scm | 6 +++++- 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 2913478e4a..9b2c8c22b9 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,13 +44,20 @@ #:select (file-system-packages)) #:use-module (gnu packages admin) #:use-module ((gnu packages linux) - #:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools)) + #:select (alsa-utils btrfs-progs crda eudev eudev/btrfs-fix + e2fsprogs f2fs-tools fuse gpm kbd lvm2 rng-tools + util-linux xfsprogs)) #:use-module (gnu packages bash) #:use-module ((gnu packages base) #:select (canonical-package coreutils glibc glibc-utf8-locales)) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) - #:use-module (gnu packages linux) + #:use-module ((gnu packages disk) + #:select (dosfstools)) + #:use-module ((gnu packages file-systems) + #:select (bcachefs-tools jfsutils zfs)) + #:use-module ((gnu packages mtools) + #:select (exfat-utils)) #:use-module (gnu packages terminals) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask)) @@ -66,6 +73,7 @@ #:export (fstab-service-type root-file-system-service file-system-service-type + file-system-utilities swap-service host-name-service console-keymap-service @@ -413,6 +421,32 @@ FILE-SYSTEM." (memq 'bind-mount (file-system-flags file-system)))) file-systems)) +(define (file-system-type->utilities type) + "Return a package providing the utilities for file system TYPE, #f +otherwise." + (assoc-ref + `(("bcachefs" . ,bcachefs-tools) + ("btrfs" . ,btrfs-progs) + ("exfat" . ,exfat-utils) + ("ext2" . ,e2fsprogs) + ("ext3" . ,e2fsprogs) + ("ext4" . ,e2fsprogs) + ("fat" . ,dosfstools) + ("f2fs" . ,f2fs-tools) + ("jfs" . ,jfsutils) + ("vfat" . ,dosfstools) + ("xfs" . ,xfsprogs) + ("zfs" . ,zfs)) + type)) + +(define (file-system-utilities file-systems) + "Return a list of packages containing file system utilities for +FILE-SYSTEMS." + (filter-map (lambda (file-system) + (when (file-system-utilities? file-system) + (file-system-type->utilities (file-system-type file-system)))) + file-systems)) + (define file-system-service-type (service-type (name 'file-systems) (extensions @@ -420,6 +454,8 @@ FILE-SYSTEM." file-system-shepherd-services) (service-extension fstab-service-type file-system-fstab-entries) + (service-extension profile-service-type + file-system-utilities) ;; Have 'user-processes' depend on 'file-systems'. (service-extension user-processes-service-type diff --git a/gnu/system.scm b/gnu/system.scm index 29e622872d..3b8a1c4822 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -424,6 +424,14 @@ marked as 'needed-for-boot'." (service file-system-service-type (map add-dependencies file-systems))) +(define (boot-file-system-service os) + "Return a service which adds, to the system profile, packages providing the +utilites for the file systems marked as 'needed-for-boot' in OS." + (let ((file-systems (filter file-system-needed-for-boot? + (operating-system-file-systems os)))) + (simple-service 'boot-file-system-utilities profile-service-type + (file-system-utilities file-systems)))) + (define (mapped-device-users device file-systems) "Return the subset of FILE-SYSTEMS that use DEVICE." (let ((target (string-append "/dev/mapper/" (mapped-device-target device)))) @@ -519,13 +527,14 @@ bookkeeping." (define known-fs (map file-system-mount-point (operating-system-file-systems os))) - (let* ((mappings (device-mapping-services os)) - (root-fs (root-file-system-service)) - (other-fs (non-boot-file-system-service os)) - (swaps (swap-services os)) - (procs (service user-processes-service-type)) - (host-name (host-name-service (operating-system-host-name os))) - (entries (operating-system-directory-base-entries os))) + (let* ((mappings (device-mapping-services os)) + (root-fs (root-file-system-service)) + (boot-fs (boot-file-system-service os)) + (non-boot-fs (non-boot-file-system-service os)) + (swaps (swap-services os)) + (procs (service user-processes-service-type)) + (host-name (host-name-service (operating-system-host-name os))) + (entries (operating-system-directory-base-entries os))) (cons* (service system-service-type entries) %boot-service @@ -552,7 +561,7 @@ bookkeeping." (operating-system-setuid-programs os)) (service profile-service-type (operating-system-packages os)) - other-fs + boot-fs non-boot-fs (append mappings swaps ;; Add the firmware service. @@ -645,8 +654,7 @@ of PROVENANCE-SERVICE-TYPE to its services." (define %base-packages ;; Default set of packages globally visible. It should include anything ;; required for basic administrator tasks. - (append (list e2fsprogs) - %base-packages-interactive + (append %base-packages-interactive %base-packages-linux %base-packages-networking %base-packages-utils)) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 3b599efa8e..f78c3b1b8e 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +43,7 @@ file-system-create-mount-point? file-system-dependencies file-system-location + file-system-utilities? file-system-type-predicate @@ -111,7 +113,9 @@ (default '())) ; or (location file-system-location (default (current-source-location)) - (innate))) + (innate)) + (utilities? file-system-utilities? ; Boolean + (default #t))) ;; A file system label for use in the 'device' field. (define-record-type -- 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 23 08:18:35 2020 Received: (at 40480) by debbugs.gnu.org; 23 Apr 2020 12:18:35 +0000 Received: from localhost ([127.0.0.1]:54199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRaoN-0001vE-0G for submit@debbugs.gnu.org; Thu, 23 Apr 2020 08:18:35 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRaoL-0001uw-2j for 40480@debbugs.gnu.org; Thu, 23 Apr 2020 08:18:33 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 2E04DE0009; Thu, 23 Apr 2020 12:18:25 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 23 Apr 2020 12:18:25 +0000 From: Brice Waegeneire To: 40480@debbugs.gnu.org, Tobias Geerinckx-Rice Subject: Re: Re: [bug#40480] [PATCH v3] services: Add file-system utils to profile. Message-ID: X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40480 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Tobias, Thank you for taking the time to review this patch. > I'm amused that bcachefs is amongst this list so I'll test it on a > bcachefs system and get back to you. I'm not sure if it'll works, I've just searched the packages for all the file system utilities that were available in Guix to make the mapping. You will at least need to patch your kernel to get bcachefs working properly. > In the next revision and future patches, please write ‘utilities’ > instead of ‘utils’, ‘operating-system’ instead of ‘os’, &c. (in > prose and code). In general, in Scheme, avoid all the tedious and > unnecessary abbreviation fashionable in some other languages. This is still difficult for me especially for such widely used abbreviations. I have kept OS in gnu/system.scm because it's used extensively there and that 'boot-file-system-service' is modeled onto 'non-boot-file-system-service'. About the usage of 'utils' you may want to rename %base-package-utils introduced in 93664feee1. Cheers, - Brice From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 10:28:39 2020 Received: (at 40480) by debbugs.gnu.org; 18 Dec 2020 15:28:39 +0000 Received: from localhost ([127.0.0.1]:39655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqHgN-0004al-G9 for submit@debbugs.gnu.org; Fri, 18 Dec 2020 10:28:39 -0500 Received: from mira.cbaines.net ([212.71.252.8]:36596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqHgL-0004ac-OJ for 40480@debbugs.gnu.org; Fri, 18 Dec 2020 10:28:38 -0500 Received: from localhost (188.30.130.172.threembb.co.uk [188.30.130.172]) by mira.cbaines.net (Postfix) with ESMTPSA id B5D8227BC05; Fri, 18 Dec 2020 15:28:36 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id d0b3efe8; Fri, 18 Dec 2020 15:28:34 +0000 (UTC) References: <20200407083054.19472-1-brice@waegenei.re> <20200423120002.32554-1-brice@waegenei.re> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines To: Brice Waegeneire Subject: Re: [bug#40480] [PATCH v4] services: Add file system utilities to profile. In-reply-to: <20200423120002.32554-1-brice@waegenei.re> Date: Fri, 18 Dec 2020 15:28:34 +0000 Message-ID: <87k0tf16cd.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40480 Cc: 40480@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Brice Waegeneire writes: > * gnu/services/base.scm (file-system-type->utilities, > file-system-utilities): New procedures. > (file-system-service-type): Extend 'profile-service-type' with > 'file-system-utilities'. > * gnu/system.scm (boot-file-system-service): New procedure... > (operating-system-default-essential-services): ...use it. > (%base-packages): Remove 'e2fsprogs'. > * gnu/system/file-systems.scm (file-system): Add 'utilities?' field. > --- > > Fix bcachefs typo and replace 'utils' by 'utilities'. Reword the > documentation procedures to be clearer. Remove (srfi srfi-2) and (ice-9 > regex) which weren't used since v1. > > gnu/services/base.scm | 40 +++++++++++++++++++++++++++++++++++-- > gnu/system.scm | 28 ++++++++++++++++---------- > gnu/system/file-systems.scm | 6 +++++- > 3 files changed, 61 insertions(+), 13 deletions(-) Thanks for the updated patch Brian, and apologies it's taken so long to review. I've had a quick look through, and generally it looks fine to me. > diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm > index 3b599efa8e..f78c3b1b8e 100644 > --- a/gnu/system/file-systems.scm > +++ b/gnu/system/file-systems.scm > @@ -1,5 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Co= urt=C3=A8s > +;;; Copyright =C2=A9 2020 Brice Waegeneire > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -42,6 +43,7 @@ > file-system-create-mount-point? > file-system-dependencies > file-system-location > + file-system-utilities? >=20=20 > file-system-type-predicate >=20=20 > @@ -111,7 +113,9 @@ > (default '())) ; or > (location file-system-location > (default (current-source-location)) > - (innate))) > + (innate)) > + (utilities? file-system-utilities? ; Boolean > + (default #t))) >=20=20 > ;; A file system label for use in the 'device' field. > (define-record-type On utilties? here, I wonder if the name for this option could be clearer? Most of the other options can be interpreted in the context of the filesystem itself, but this is about whether the system profile should include utilities for that filesystem. I haven't got any particularly good ideas though, maybe system-include-utilities? I think utilities? is OK though, if someone wants to turn it off, then they'll probably be able to work out how. On that, maybe the only must before merging this is adding to the list of options in the documentation. Is this something you're able to do? Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/cyqJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XeEVQ//ZyZni8SoMgSEgfZyzamU9y+edxneaAao wpnq00AwLXnhnTA3LB0HlH+pgy9Qp0TSWVKSDa+aY1EkyJe/9JiaQ0uqaFrPY/FS vxDwPS6MJnPmG/akLTSVcQov26QgTrc9QIdH5bcXgQf9HCPRk4dnsViMlSvgqsFV LQqbD2MGWeMWhJFL5r4Y8Hc+iQpse5qxeGkgZ8A6gDjeL4gZmx/P8xhh6lU4wEP4 1/7Ranwey30q69FwtPhnhaLMsVJapTAKSrwFrC+79vp+wVZBVuakoY3fWgO9dmen vegnLB7ptJf+y/GfrhYMQkbUv0LoOChaInVZiPzmvMp5fTmYiS1ByhK0+RMXTytu jKt/D4kMnr+jLGBijZoueGIu3RWzdwhlOvfIsKqRUej4fVLy0As+MJKvHMfCEWK6 Sm8wfW9W+uXfJCNwfF0TKGlV04rcVW2oWd1dAJLJNRmdPt5QABSFk/G3YzxWUHQx ochSk9xW4lSDrPCKG6+gbDsk0DptlFdfUX2oeJKn3jLZ5zEPbh91HMjL6YZLDEdH jPzaHTaVBrWLIXNKD8LiiBwBvt9yYVxLqsauy8iypDrsab96VfmzfSNjuN6L+3Yi BP+9BBzrscDYI6fy0WnrAD3FJSfB5Z3EacjZyCoEgONvRdQwpGaMGGkQCD1q2I33 MDjDahQuezk= =EAre -----END PGP SIGNATURE----- --=-=-=--