mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1398722e04 | ||
|
|
74b0cd7410 | ||
|
|
ed54329e1f | ||
|
|
14bde08c8b |
@@ -6,15 +6,22 @@
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
;; Utilities
|
||||
#:use-module (guix diagnostics)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix i18n)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix utils)
|
||||
;; Guix origin methods
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages autotools)
|
||||
#:use-module (gnu packages file-systems)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages onc-rpc)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:export (default-initrd-configs
|
||||
linux-with-zfs
|
||||
cachyos-configs))
|
||||
|
||||
(define* (default-initrd-configs
|
||||
@@ -54,6 +61,80 @@
|
||||
'()
|
||||
'("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
|
||||
@@ -214,10 +295,16 @@
|
||||
(file-append source path)))
|
||||
|
||||
(define-public linux-cachyos-lts-server
|
||||
(let* ((version "6.18.52-1")
|
||||
(kernel
|
||||
(let ((version "6.18.55-1"))
|
||||
(linux-with-zfs
|
||||
(customize-linux
|
||||
#:name "linux-cachyos-lts-server"
|
||||
#:linux
|
||||
(hidden-package
|
||||
(package
|
||||
(inherit linux-libre)
|
||||
(version version)
|
||||
(supported-systems '("x86_64-linux"))))
|
||||
#:source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -225,7 +312,7 @@
|
||||
"https://github.com/CachyOS/linux/releases/download/cachyos-"
|
||||
version "/cachyos-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 "0m3rp34gfddjki662jv0mirig5rfa1chy5vfrvyzcsvvs26qpyrn")))
|
||||
(base32 "1x9hymblmpj90dhwlz7lsfkdw8fjjpnghhg0yk3qmf9x16v8nrd3")))
|
||||
#:defconfig (%kernel-config "/defconfig_server")
|
||||
#:configs
|
||||
(string-join
|
||||
@@ -242,18 +329,19 @@
|
||||
#:hugepage 'always
|
||||
#:processor-opt 'generic)
|
||||
(default-initrd-configs))
|
||||
"\n"))))
|
||||
(hidden-package
|
||||
(package
|
||||
(inherit kernel)
|
||||
(version version)
|
||||
(supported-systems '("x86_64-linux"))))))
|
||||
"\n")))))
|
||||
|
||||
(define-public linux-cachyos-bore-zen4
|
||||
(let* ((version "7.2.8-1")
|
||||
(kernel
|
||||
(let ((version "7.2.9-2"))
|
||||
(linux-with-zfs
|
||||
(customize-linux
|
||||
#:name "linux-cachyos-bore-zen4"
|
||||
#:linux
|
||||
(hidden-package
|
||||
(package
|
||||
(inherit linux-libre)
|
||||
(version version)
|
||||
(supported-systems '("x86_64-linux"))))
|
||||
#:source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -261,7 +349,7 @@
|
||||
"https://github.com/CachyOS/linux/releases/download/cachyos-"
|
||||
version "/cachyos-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 "0a7kxhivrp13j50scqqvb7bnsg0dcqing30q314imhsapm1dyj7q"))
|
||||
(base32 "1fpwmihnv9j9bvhcviia5k1dlilr0mcv17ch8rznadhlwgzyda9d"))
|
||||
(patches (map %kernel-config '("/patches/bore-cachy-7.2.patch"))))
|
||||
#:defconfig (%kernel-config "/defconfig_desktop")
|
||||
#:configs
|
||||
@@ -279,9 +367,4 @@
|
||||
#:hugepage 'always
|
||||
#:processor-opt 'zen4)
|
||||
(default-initrd-configs))
|
||||
"\n"))))
|
||||
(hidden-package
|
||||
(package
|
||||
(inherit kernel)
|
||||
(version version)
|
||||
(supported-systems '("x86_64-linux"))))))
|
||||
"\n")))))
|
||||
Reference in new issue
Block a user