rosenthal: linux-cachyos: Remove builtin ZFS modules.

This commit is contained in:
Hilton Chain committed 2026-10-11 01:45:06 +08:00
1 parent 2dae5082ff
commit c2897f17ad
1 file changed
+24 -108
+24 -108
View File
@@ -8,20 +8,14 @@
;; Utilities ;; Utilities
#:use-module (guix diagnostics) #:use-module (guix diagnostics)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix i18n)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix utils) #:use-module (guix utils)
;; Guix origin methods ;; Guix origin methods
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
;; Guix packages ;; Guix packages
#:use-module (gnu packages autotools)
#:use-module (gnu packages file-systems)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages onc-rpc)
#:use-module (gnu packages pkg-config)
#:export (default-initrd-configs #:export (default-initrd-configs
linux-with-zfs
cachyos-configs)) cachyos-configs))
(define* (default-initrd-configs (define* (default-initrd-configs
@@ -61,80 +55,6 @@
'() '()
'("CONFIG_HID_APPLE=m")))) '("CONFIG_HID_APPLE=m"))))
(define* (linux-with-zfs linux #:optional (zfs zfs))
"Return a kernel package based on LINUX, with ZFS kernel modules built in."
(cond
((not (package? linux))
(warning (G_ "'~a': kernel '~a' is not a package, skipping modification~%")
"linux-with-zfs"
linux)
linux)
((assq-ref (package-properties linux) 'with-zfs?)
linux)
(else
(let ((zfs-directory
(string-append (package-name zfs) "-" (package-version zfs))))
(package
(inherit linux)
(name (string-append (package-name linux) "-with-zfs"))
(arguments
(substitute-keyword-arguments arguments
((#:substitutable? _ #t) #f)
((#:phases phases)
#~(modify-phases #$phases
(add-after 'unpack 'unpack-zfs
(lambda* (#:key inputs #:allow-other-keys)
(let ((zfs-source #+(package-source zfs)))
(if (file-is-directory? zfs-source)
(copy-recursively zfs-source #$zfs-directory)
(invoke "tar" "xf" zfs-source)))
(with-directory-excursion #$zfs-directory
;; Copied from zfs package.
(substitute* "module/os/linux/zfs/zfs_ctldir.c"
(("/usr/bin/env\", \"umount")
(string-append
(search-input-file inputs "/bin/umount") "\", \"-n"))
(("/usr/bin/env\", \"mount")
(string-append
(search-input-file inputs "/bin/mount") "\", \"-n"))))))
;; https://github.com/openzfs/zfs/issues/10450#issuecomment-643654436
(add-after 'patch-source-shebangs 'add-zfs-to-kernel-tree
(lambda _
(invoke "make" "defconfig" "prepare")
(with-directory-excursion #$zfs-directory
(invoke "./autogen.sh")
(substitute* "configure"
(("/bin/sh") (which "sh")))
(invoke "./configure" "--enable-linux-builtin"
"--with-linux=.."
"--with-linux-obj=..")
(invoke "./copy-builtin" ".."))
(delete-file-recursively #$zfs-directory)))
(add-after 'configure 'enable-zfs
(lambda _
(for-each
(lambda (config)
(invoke "./scripts/config" "--enable" config))
'("CONFIG_CRYPTO_DEFLATE"
"CONFIG_ZLIB_DEFLATE"
"CONFIG_KALLSYMS"
"CONFIG_EFI_PARTITION"
"CONFIG_ZFS"))))))))
(native-inputs
(modify-inputs native-inputs
(prepend autoconf
automake
libtool
pkg-config)))
(inputs
(modify-inputs inputs
(prepend libtirpc
util-linux
`(,util-linux "lib"))))
(properties
`((with-zfs? . #t)
,@(package-properties linux))))))))
;;; ;;;
;;; linux-cachyos ;;; linux-cachyos
@@ -295,23 +215,29 @@
(file-append source path))) (file-append source path)))
(define-public linux-cachyos-lts-server (define-public linux-cachyos-lts-server
(let* ((version "6.18.55-1")
(kernel
(customize-linux (customize-linux
#:name "linux-cachyos-lts-server" #:name "linux-cachyos-lts-server"
#:source #:linux
(package
(inherit linux-libre)
(version "6.18.55-1")
(source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"https://github.com/CachyOS/linux/releases/download/cachyos-" "https://github.com/CachyOS/linux/releases/download/cachyos-"
version "/cachyos-" version ".tar.gz")) version "/cachyos-" version ".tar.gz"))
(sha256 (sha256
(base32 "1x9hymblmpj90dhwlz7lsfkdw8fjjpnghhg0yk3qmf9x16v8nrd3"))) (base32 "1x9hymblmpj90dhwlz7lsfkdw8fjjpnghhg0yk3qmf9x16v8nrd3"))))
(home-page "https://cachyos.org/")
(synopsis "CachyOS Linux kernel (lts + server)")
(description "")
(supported-systems '("x86_64-linux")))
#:defconfig (%kernel-config "/defconfig_server") #:defconfig (%kernel-config "/defconfig_server")
#:configs #:configs
(string-join (string-join
(append (cachyos-configs (append (cachyos-configs
#:major-version (version-major version) #:major-version "6"
#:cachy-config? #f #:cachy-config? #f
#:cpusched 'eevdf #:cpusched 'eevdf
#:cc-harder? #t #:cc-harder? #t
@@ -323,22 +249,16 @@
#:hugepage 'always #:hugepage 'always
#:processor-opt 'generic) #:processor-opt 'generic)
(default-initrd-configs)) (default-initrd-configs))
"\n")))) "\n")))
(hidden-package
(package
(inherit (linux-with-zfs kernel))
(version version)
(arguments
(substitute-keyword-arguments arguments
((#:substitutable? _ #f) #t)))
(supported-systems '("x86_64-linux"))))))
(define-public linux-cachyos-bore-zen4 (define-public linux-cachyos-bore-zen4
(let* ((version "7.2.9-2")
(kernel
(customize-linux (customize-linux
#:name "linux-cachyos-bore-zen4" #:name "linux-cachyos-bore-zen4"
#:source #:linux
(package
(inherit linux-libre)
(version "7.2.9-2")
(source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@@ -346,12 +266,16 @@
version "/cachyos-" version ".tar.gz")) version "/cachyos-" version ".tar.gz"))
(sha256 (sha256
(base32 "1fpwmihnv9j9bvhcviia5k1dlilr0mcv17ch8rznadhlwgzyda9d")) (base32 "1fpwmihnv9j9bvhcviia5k1dlilr0mcv17ch8rznadhlwgzyda9d"))
(patches (map %kernel-config '("/patches/bore-cachy-7.2.patch")))) (patches (map %kernel-config '("/patches/bore-cachy-7.2.patch")))))
(home-page "https://cachyos.org/")
(synopsis "CachyOS Linux kernel (bore + znver4)")
(description "")
(supported-systems '("x86_64-linux")))
#:defconfig (%kernel-config "/defconfig_desktop") #:defconfig (%kernel-config "/defconfig_desktop")
#:configs #:configs
(string-join (string-join
(append (cachyos-configs (append (cachyos-configs
#:major-version (version-major version) #:major-version "7"
#:cachy-config? #t #:cachy-config? #t
#:cpusched 'bore #:cpusched 'bore
#:cc-harder? #t #:cc-harder? #t
@@ -363,12 +287,4 @@
#:hugepage 'always #:hugepage 'always
#:processor-opt 'zen4) #:processor-opt 'zen4)
(default-initrd-configs)) (default-initrd-configs))
"\n")))) "\n")))
(hidden-package
(package
(inherit (linux-with-zfs kernel))
(version version)
(arguments
(substitute-keyword-arguments arguments
((#:substitutable? _ #f) #t)))
(supported-systems '("x86_64-linux"))))))