From patchwork Fri Jan 1 12:34:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: raid5atemyhomework X-Patchwork-Id: 26149 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 4D8A827BC08; Fri, 1 Jan 2021 12:35:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,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 ESMTPS id 81AAE27BC06 for ; Fri, 1 Jan 2021 12:35:33 +0000 (GMT) Received: from localhost ([::1]:45100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvJeV-0002xc-Lb for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 07:35:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvJe2-0002xT-NG for guix-patches@gnu.org; Fri, 01 Jan 2021 07:35:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvJe2-0004o9-GD for guix-patches@gnu.org; Fri, 01 Jan 2021 07:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvJe2-0004cu-C4 for guix-patches@gnu.org; Fri, 01 Jan 2021 07:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45592] [PATCH] gnu, doc: Create and document procedure to compile ZFS for specific kernel. Resent-From: raid5atemyhomework Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45592 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45592@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.160950447217744 (code B ref -1); Fri, 01 Jan 2021 12:35:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jan 2021 12:34:32 +0000 Received: from localhost ([127.0.0.1]:55753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvJdY-0004c7-96 for submit@debbugs.gnu.org; Fri, 01 Jan 2021 07:34:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:39236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvJdW-0004bz-7i for submit@debbugs.gnu.org; Fri, 01 Jan 2021 07:34:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvJdW-0002uj-13 for guix-patches@gnu.org; Fri, 01 Jan 2021 07:34:30 -0500 Received: from mail-40135.protonmail.ch ([185.70.40.135]:38222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvJdT-0004Yh-98 for guix-patches@gnu.org; Fri, 01 Jan 2021 07:34:29 -0500 Date: Fri, 01 Jan 2021 12:34:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609504456; bh=oLCgSD6JFqle+pb18hhCLm5GxDhItn6KAwstMHSrZC8=; h=Date:To:From:Reply-To:Subject:From; b=j2CMKfzXu0JruoCTE53B/uky/DVVoaSFq/ueBWH0B0yGPh0R1e7j+7t6HA5Dxjf2d BIIK072qPC4Vmh3N2dxV9DyEX+ycqYI806CXcVod4bLt86J4HHjEYJFn7hZ2Cc7Itt baxP84ywNKLSsUBgoXeoyvN0JovdMA4uRh2YkTRQ= Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.40.135; envelope-from=raid5atemyhomework@protonmail.com; helo=mail-40135.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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Reply-to: raid5atemyhomework , raid5atemyhomework via Guix-patches X-Patchwork-Original-From: raid5atemyhomework via Guix-patches via From: raid5atemyhomework X-getmail-retrieved-from-mailbox: Patches Fixes: https://issues.guix.gnu.org/45401 As suggested in https://issues.guix.gnu.org/45403#3 this instead exposes a specific `make-zfs-package` procedure that can be combined in the system configuration file in order to create a ZFS package that is intended for the specific system. It also gives a basic documentation on how to create a ZFS package for your system. I have not tested the ZFS *yet*, but this actually lets me compile ZFS for various kernel versions, which is an improvement over the current situation where installing ZFS is not possible at all. From 56e108591c65ed3aed1872290133d51962acb4a2 Mon Sep 17 00:00:00 2001 From: raid5atemyhomework Date: Fri, 1 Jan 2021 20:26:42 +0800 Subject: [PATCH] gnu, doc: Create and document procedure to compile ZFS for specific kernel. --- doc/guix.texi | 61 +++++++++++++++++++++++++++++++++++ gnu/packages/file-systems.scm | 22 ++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) -- 2.29.2 diff --git a/doc/guix.texi b/doc/guix.texi index 1081ed26a3..1f874b4ee0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13885,6 +13885,67 @@ a file system declaration such as: compress-force=zstd,space_cache=v2")) @end lisp +@node ZFS file system +@subsection ZFS file system + +The ZFS on Linux file system cannot legally be downloaded as part of the +Linux kernel, but you as a user can do anything on hardware you own, +including download ZFS as source code, compile ZFS as a kernel module, +and link it into Linux. + +As a large and complex kernel module, ZFS has to be compiled for a +specific version of Linux. Often the latest ZFS package available in Guix +cannot be compiled with the latest Linux kernel available in Guix, so +installing the @code{zfs} package in your system configuration file will +fail. + +Instead, you have to check the +@url{https://github.com/openzfs/zfs/releases,OpenZFS release notes} for +the specific version of ZFS that Guix has packaged to determine what +Linux kernels you can use, then check the @code{linux-libre} packages +that Guix has packaged, and select one you can use on your system. + +Then, you have to modify your system configuration file, and create a +ZFS package that compiles using the specific Linux version you chose. +Below is a sketch of how you would modify your @code{operating-system} +declaration in order to set up ZFS: + +@lisp +(use-modules (gnu)) +;; @dots{} +(use-package-modules + ; @dots{} + linux + file-systems) + +;; @dots{} + +;; ZFS 0.8.5 is known to compile with Linux 5.9 series +(define system-kernel linux-libre-5.9) +(define system-zfs (make-zfs-package system-kernel)) + +;; @dots{} + +(operating-system + (kernel system-kernel) + (kernel-loadable-modules (list system-zfs)) + ;; @dots{} + (packages + (cons* system-zfs + ; @dots{} + %base-packages)) + ;; @dots{} + ) +@end lisp + +@deffn (Scheme Procedure) make-zfs-package @var{kernel} +This procedure creates a package which, when included as a package +in your system, can be loaded as a kernel module for the specified +@var{kernel}, a Linux kernel package. +It is intended to create a system-specific ZFS kernel module for +the Linux kernel you will use in your system. +@end deffn + @node Mapped Devices @section Mapped Devices diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index 895ad069c5..ebc4bc87c1 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -951,9 +951,29 @@ APFS.") (description "ZFS on Linux is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the OpenZFS -community.") +community. + +DO NOT INSTALL THIS PACKAGE. Instead, refer to the 'ZFS file system' section +of the Guix info manual for how to install ZFS.") (license license:cddl1.0))) +(define-public (make-zfs-package kernel) + (package + (inherit zfs) + (name (string-append "zfs-for-" + (package-name kernel) + "-" + (package-version kernel) + "-version")) + (arguments + (cons* #:linux kernel (package-arguments zfs))) + (description + "ZFS on Linux is an advanced file system and volume manager which was +originally developed for Solaris and is now maintained by the OpenZFS +community. + +This package has been compiled for a specific Linux kernel."))) + (define-public mergerfs (package (name "mergerfs")