GNU bug report logs - #71482
[PATCH] gnu: zfs: Split the kernel module out of the base package.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Kaelyn Takata <kaelyn.alexi@HIDDEN>; Keywords: patch; dated Mon, 10 Jun 2024 17:11:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Jun 2024 17:10:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 10 13:10:31 2024
Received: from localhost ([127.0.0.1]:47350 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sGiXO-0006cE-7t
	for submit <at> debbugs.gnu.org; Mon, 10 Jun 2024 13:10:31 -0400
Received: from lists.gnu.org ([209.51.188.17]:33972)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kaelyn.alexi@HIDDEN>) id 1sGiOt-00069Y-EF
 for submit <at> debbugs.gnu.org; Mon, 10 Jun 2024 13:01:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <kaelyn.alexi@HIDDEN>)
 id 1sGi9O-0007qt-0C
 for guix-patches@HIDDEN; Mon, 10 Jun 2024 12:45:47 -0400
Received: from mail-4322.protonmail.ch ([185.70.43.22])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <kaelyn.alexi@HIDDEN>)
 id 1sGi9J-0002so-Bj
 for guix-patches@HIDDEN; Mon, 10 Jun 2024 12:45:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1718037930; x=1718297130;
 bh=y+4dO3hV+HZTdKPFyr/1I1UtrBwTxjjRylJYYmnqlp8=;
 h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=W3JzGpq4HM0OW9n3ag9shYTrm+20grKxL3WbMwcf4zzz2DEWwkOShrXwIXRydPP6U
 jfJZ3k+t3E51SWMToDUS+rUoccy79N/QYBrfRh6AhffSMIzvRJ5otNKNF/LMS4d931
 ylnbv9rEt3QQLGtXINbkdvmCZkAZuYtcp9KwGkTd+GfDTF43A0/+48LWOd8ihby2Pp
 D2cbKsZFXt7aImiv9xrEoFfU8k5CQhVMwtOXzGC9aQ6UOortZykBZ3NKqmfbIr2kMG
 CB7l8JYzNgF/LMMdXli1FJDnkK2q0sPAfVtQ67Hj8RSdw6XtwCu7QvlVmMbQvC1P/J
 ibeKMWCGwUX6A==
Date: Mon, 10 Jun 2024 16:45:26 +0000
To: guix-patches@HIDDEN
From: Kaelyn Takata <kaelyn.alexi@HIDDEN>
Subject: [PATCH] gnu: zfs: Split the kernel module out of the base package.
Message-ID: <8681cce4ff0cb548ff8bd527a77a5206c6d63e24.1718037851.git.kaelyn.alexi@HIDDEN>
Feedback-ID: 34709329:user:proton
X-Pm-Message-ID: 488a38d69a0dae78015d2e60b18ceacad3b5b2f8
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=185.70.43.22;
 envelope-from=kaelyn.alexi@HIDDEN; helo=mail-4322.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
Cc: Kaelyn Takata <kaelyn.alexi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Split the ZFS user-space tools and kernel modules into separate packages, w=
ith
a new make-zfs-for-kernel procedure for easily creating ZFS kernel module
packages for a specific kernel package. The generated kernel module package
includes the kernel version for which it was built in the name of the packa=
ge,
such as "zfs-for-linux-libre-6.6.32-version".

& gnu/packages/file-systems.scm (zfs): Change to be the user-space tools.
(make-zfs-for-kernel): New procedure which accepts a single 'kernel-package=
'
argument.

Change-Id: Ib2d0e2b0f031d2ab3105d6b46ecd73bde1aa8564
---
 gnu/packages/file-systems.scm | 124 ++++++++++++++++++++--------------
 1 file changed, 72 insertions(+), 52 deletions(-)

diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index fa7da35898..78121c1ec2 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -1444,7 +1444,6 @@ (define-public zfs
   (package
     (name "zfs")
     (version "2.2.4")
-    (outputs '("out" "module" "src"))
     (source
       (origin
         (method url-fetch)
@@ -1453,33 +1452,19 @@ (define-public zfs
                               "/zfs-" version ".tar.gz"))
           (sha256
            (base32 "1h0yqchirzsn2gll1w2gclb13hr8511z67lf85cigm43frgr144p")=
)))
-    (build-system linux-module-build-system)
+    (build-system gnu-build-system)
     (arguments
      (list
-      ;; The ZFS kernel module should not be downloaded since the license
-      ;; terms don't allow for distributing it, only building it locally.
-      #:substitutable? #f
-      ;; Tests cannot run in an unprivileged build environment.
-      #:tests? #f
+      #:configure-flags #~(list "--with-config=3Duser"
+                                (string-append "--prefix=3D" #$output)
+                                (string-append "--with-dracutdir=3D" #$out=
put
+                                               "/lib/dracut")
+                                (string-append "--with-udevdir=3D" #$outpu=
t
+                                               "/lib/udev")
+                                (string-append "--with-mounthelperdir=3D" =
#$output
+                                               "/sbin"))
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'configure 'really-configure
-            (lambda* (#:key inputs #:allow-other-keys)
-              (substitute* "configure"
-                (("-/bin/sh") (string-append "-" (which "sh"))))
-              (invoke "./configure"
-                      "--with-config=3Dall"
-                      (string-append "--prefix=3D" #$output)
-                      (string-append "--with-dracutdir=3D" #$output
-                                     "/lib/dracut")
-                      (string-append "--with-udevdir=3D" #$output
-                                     "/lib/udev")
-                      (string-append "--with-mounthelperdir=3D" #$output
-                                     "/sbin")
-                      (string-append "--with-linux=3D"
-                                     (search-input-directory
-                                      inputs
-                                      "lib/modules/build")))))
           (add-after 'unpack 'patch-source
             (lambda* (#:key inputs #:allow-other-keys)
               ;; New feature "compatibility=3D" in 2.1.0.
@@ -1511,14 +1496,6 @@ (define-public zfs
                 ;; Just use 'modprobe' in message to user, since Guix
                 ;; does not have a traditional /sbin/
                 (("'/sbin/modprobe ") "'modprobe "))
-              (substitute* "configure"
-                (("/etc/default")
-                 (string-append #$output "/etc/default"))
-                (("/etc/bash_completion.d")
-                 (string-append #$output "/etc/bash_completion.d")))
-              (substitute* "Makefile.in"
-                (("/usr/share/initramfs-tools")
-                 (string-append #$output "/usr/share/initramfs-tools")))
               (substitute* "contrib/initramfs/Makefile.am"
                 (("/usr/share/initramfs-tools")
                  (string-append #$output "/usr/share/initramfs-tools")))
@@ -1548,31 +1525,22 @@ (define-public zfs
                                 (dirname (which "sed")) ":"
                                 (dirname (which "gawk")))))
               (substitute* '("Makefile.am" "Makefile.in")
-                (("\\$\\(prefix)/src") (string-append #$output:src "/src")=
))
+                (("@initconfdir@") (string-append #$output "/etc/default")=
)
+                (("/usr/share/initramfs-tools" dir) (string-append #$outpu=
t dir)))
               (substitute* (find-files "udev/rules.d/" ".rules.in$")
                 (("/sbin/modprobe")
                  (search-input-file inputs "/bin/modprobe")))))
-          (replace 'build
-            (lambda _ (invoke "make")))
           (replace 'install
-            (lambda* (#:key inputs native-inputs #:allow-other-keys)
-              (let* ((kmod (assoc-ref (or native-inputs inputs) "kmod")))
-                (invoke "make" "install"
-                        (string-append "DEFAULT_INITCONF_DIR=3D"
-                                       #$output "/etc/default")
-                        (string-append "DEPMOD=3D"
-                                       (search-input-file
-                                        (or native-inputs inputs)
-                                        "/bin/depmod"))
-                        (string-append "INSTALL_PATH=3D" #$output)
-                        (string-append "INSTALL_MOD_PATH=3D" #$output:modu=
le)
-                        "INSTALL_MOD_STRIP=3D1")
-                (install-file
-                 "contrib/bash_completion.d/zfs"
-                 (string-append #$output
-                                "/share/bash-completion/completions"))))))=
))
+            (lambda _
+              (invoke "make" "install"
+                      (string-append "DEFAULT_INITCONF_DIR=3D"
+                                     #$output "/etc/default")
+                      (string-append "INSTALL_PATH=3D" #$output)
+                      (string-append "bashcompletiondir=3D"
+                                     #$output
+                                     "/share/bash-completion/completions")=
))))))
     (native-inputs
-     (list attr kmod pkg-config))
+     (list attr kmod pkg-config python))
     (inputs (list eudev
                   kmod
                   libaio
@@ -1592,6 +1560,58 @@ (define-public zfs
 community.")
     (license license:cddl1.0)))
=20
+(define-public (make-zfs-for-kernel kernel-package)
+  (package
+    (inherit zfs)
+    (name (string-join (list (package-name zfs)
+                             "for"
+                             (package-name kernel-package)
+                             (package-version kernel-package)
+                             "version")
+                       "-"))
+    (build-system linux-module-build-system)
+    (arguments
+     (substitute-keyword-arguments
+         (strip-keyword-arguments '(#:configure-flags)
+                                  (package-arguments zfs))
+       ((#:linux _ #f) kernel-package)
+       ((#:substitutable? _ #t) #f)
+       ((#:phases phases)
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'patch-source
+              (assoc-ref #$phases 'patch-source))
+            (add-after 'configure 'really-configure
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "configure"
+                  (("-/bin/sh") (string-append "-" (which "sh"))))
+                (invoke "./configure"
+                        "--with-config=3Dkernel"
+                        (string-append "--prefix=3D" #$output)
+                        (string-append "--with-udevdir=3D" #$output
+                                       "/lib/udev")
+                        (string-append "--with-linux=3D"
+                                       (search-input-directory
+                                        inputs
+                                        "lib/modules/build")))))
+            (replace 'build
+              (lambda* (#:key (make-flags '()) (parallel-build? #t)
+                        #:allow-other-keys)
+                (apply invoke "make"
+                       `(,@(if parallel-build?
+                               `("-j" ,(number->string (parallel-job-count=
)))
+                               '())
+                         ,@make-flags))))
+            (replace 'install
+              (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                (let* ((kmod (assoc-ref (or native-inputs inputs) "kmod"))=
)
+                  (invoke "make" "-C" "module" "install"
+                          (string-append "DEPMOD=3D"
+                                         (search-input-file
+                                          (or native-inputs inputs)
+                                          "/bin/depmod"))
+                          (string-append "INSTALL_MOD_PATH=3D" #$output)
+                          "INSTALL_MOD_STRIP=3D1"))))))))))
+
 (define-public zfs-auto-snapshot
   (package
     (name "zfs-auto-snapshot")

base-commit: df5648daa1a5d097a430131bbff353b865b476b6
--=20
2.45.1






Acknowledgement sent to Kaelyn Takata <kaelyn.alexi@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#71482; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 10 Jun 2024 17:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.