From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id GIotOubMMGCiRwAA0tVLHw (envelope-from ) for ; Sat, 20 Feb 2021 08:48:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id j9T8NebMMGBaBgAA1q6Kng (envelope-from ) for ; Sat, 20 Feb 2021 08:48:38 +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 8C3A52180E for ; Sat, 20 Feb 2021 09:48:38 +0100 (CET) Received: from localhost ([::1]:54544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDNwL-0002w7-Ng for larch@yhetil.org; Sat, 20 Feb 2021 03:48:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDNw4-0002jE-LI for guix-devel@gnu.org; Sat, 20 Feb 2021 03:48:20 -0500 Received: from mail-40141.protonmail.ch ([185.70.40.141]:51794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDNw1-0002bv-Ci for guix-devel@gnu.org; Sat, 20 Feb 2021 03:48:20 -0500 Date: Sat, 20 Feb 2021 08:48:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1613810892; bh=j8bFbGn59xIzi87OPS9dz/epMkSYW8V939BQIhxa8iA=; h=Date:To:From:Reply-To:Subject:From; b=I0uw5Ra55GZ0ibyhQXBK6+KQG7iBARhtWq+jkl1KPe6CDX4C2t1t1nVel2rC/KkEx MIAJvL96qqDvXUJ6GuhjmzMWOfM0TNf0aYOJxEMvDH3Bh+crUG1oi+EEj22fURluF8 8ZbvTIPGVPtIdiMkRBNlxR7iZUZo3FSD4q7JWm5Q= To: "guix-devel@gnu.org" , =?utf-8?Q?Ludovic_Court=C3=A8s?= From: raid5atemyhomework Subject: ZFS on Guix, again Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.141; envelope-from=raid5atemyhomework@protonmail.com; helo=mail-40141.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.07 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=I0uw5Ra5; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 8C3A52180E X-Spam-Score: -3.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: j9y6IoA40oSe Hi guix-devel, I had some questions on the big ZFS guix bugpatches a week ago, and did not= find any response, so I am back here pestering everyone. Anyway: * I am wary of calling the service type that accepts kernel modules as `lin= ux-loadable-module-service-type`: * The equivalent existing `operating-system` field is `kernel-loadable-mo= dules`. Because `operating-system` is user-facing, we cannot rename it to = `linux-loadable-modules`, thus leading to a naming inconsistency (the `oper= ating-system` field is `kernel-loadable-modules`, the service type that add= s items to that field is `linux-loadable-module-service-type`). * Just because Guix only supports two kernels *now* and only one of them = (`linux-libre`) supports loadable modules does not mean in the future Guix = will not support *other* kernels with a concept of a loadable module (e.g. = FreeBSD kernel). So it seems premature to only name it `linux` loadable mo= dules when the concept of a kernel-loadable module apparently also exists i= n other kernels (since OpenZFS itself can be compiled as an out-of-tree ker= nel module for FreeBSD, and there is nothing really preventing Guix from su= pporting FreeBSD in the future). * There is already an existing `kernel-module-loader-service-type`. This= is used to explicitly load kernel modules, which either have to be in the = `kernel-loadable-modules` field of `operating-system`, or provided by exten= ding with the new, inconsistently named `linux-loadable-module-service-type= `. Changing the name to `linux-loadable-module-service-type` means: * We should deprecate `kernel-module-loader-service-type` and replace it wi= th an equivalent `linux-module-loader-service-type`. * We should deprecate the `operating-system` `kernel-loadable-modules` fiel= d and replace it with an equivalent `linux-loadable-modules` field. In any case, I have some sketches below. I want to create two new service types: * `linux-profile-builder-service-type` which has configuration `linux-profi= le-builder-configuration`. * `linux-profile-builder-configuration` has fields: * `linux-libre` which is the `kernel` field of the `operating-system`. * `loadable-modules` which is the `kernel-loadable-modules` field of th= e `operating-system`. * This type is extensible. `compose` is `identity`, `extend` is `(lambda= (config extensions) ((apply compose identity extensions) config))` * In short, extensions of this service-type should return a procedure w= hich takes the `linux-profile-builder-configuration` and modifies it. * This extend the root `system-service-type`, creating the `kernel` outpu= t. * `linux-loadable-module-service-type`, which takes as configuration an emp= ty list. * This type is extensible. `compose` is `concatenate`, `extend` is `appe= nd`. * This has a single service extension: * Extends `linux-profile-builder-service-type` and if the configuration= is not an empty list, extends the Linux-libre profile builder by a procedu= re that appends the list of kernel-loadable modules. The above gives a separation of concepts: * The `linux-profile-builder` builds the kernel profile for Linux-libre sys= tems. * The `linux-loadable-module-service-type` ensures that the kernel profile = contains particular loadable kernel modules. In the future there may be additional non-module things we can add to the L= inux profile, so I think this separation is useful. -- Another point I want to bring up is the use of `file-system-service-type`. If we use `file-system-service-type` to extends the `file-systems` Shepherd= service, then we need to add some kind of field to exempt the ZFS service = from being added to `/etc/fstab`. Note that ZFS expects there to be dozens of filesystems, and that creating = and destroying file systems is just a "simple" `zfs create pool/file/system= ` command. Each possible use or application may need to have specific tuni= ng, thus each application may very well have its own file system with its o= wn ZFS parameters specifically tuned for that application. This is not a good fit with the `operating-system` mechanism in Guix, where= you have to reconfigure the entire system just to add or remove file syste= ms. Nevertheless the ZFS still supports manual filesystem management, you just = need to specify the `legacy` parameter, so it's still possible to use `oper= ating-system` and its `file-systems` field to manage ZFS mounts, you just n= eed to do `zfs create -o mountpoint=3Dlegacy pool/file/system`. Though Gui= x still needs some modifications since the `device` would have to be `"pool= /file/system"` and some parts of Guix attempt to search for a block device. However, for the case where the user expects the "typical" ZFS style of man= aging file systems, we need to mount all the ZFS file systems and ensure th= at they aer all already mounted by the time `file-systems` Shepherd service= is started. This means we need to be able to extend the `requirement` of = the `file-systems` Shepherd service. And we need to do that without puttin= g any extra `/etc/fstab` entries since for "typical" ZFS style of managing = file systems, they are required to ***not*** be put in `/etc/fstab`. * We can just create a separate `file-systems-target-service-type` that alw= ays accepts (list of) symbols that the `file-systems` Shepherd service will= `requirement`. Then `file-systems-service-type` can just extend that serv= ice type. This is what I already originally did. * =E5=AE=8B=E6=96=87=E6=AD=A6 proposed to instead make `file-systems-servic= e-type` accept a heteregonous list of either symbols or `` rec= ords. * Ludo' ***agreed*** with this.... but then says that mixing symbols and = `` records in the same list is bad design. So... this is conf= using. There are two alternatives: * Go with what I already proposed which I think is more general-purpose and= cleaner (there is a separate service type that accepts symbols, and a sepa= rate service type that accepts `` records, and the latter just= extends the former). * Don't make a separate service type, but now we need to add some kind of `= fstab?` field to `file-system` so that the ZFS shepherd service that mounts= ZFS file systems will not be included in the `/etc/fstab`. I think overall that having lots of tiny service types that are then combin= ed together fits the functional design of Guix better. So I would strongly= propose my original design rather than hacks on top of `file-system-servic= e-type`. Thanks raid5atemyhomework