help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging bcachefs


From: Tobias Geerinckx-Rice
Subject: Re: Packaging bcachefs
Date: Fri, 13 Dec 2019 16:32:11 +0100

Joshua,

Joshua Branson 写道:
It would be kind of cool to package bcachefs...but it might be a little
too premature for that.

I've been using bcachefs on Guix System for a bit over 3 months now, without any issues that weren't self-inflicted. The other way 'round (/gnu/store on bcachefs) is currently not possible.

Of course you need a kustom kernel, but it should be trivial to apply the ~300 bcachefs patches (upstream/v5.3..bcachefs/master) on top of Linux-Libre. I'd share my recipe but it's a) not -Libre, even though I don't use & want any of the blobs, and b) such an unholy union of other dodgy patches that it would make the bcachefs graft look much more difficult than it is.

I've attached my bcachefs-tools package below. It works fine, I just need to finish the boring bits. Now that I have a reason I'll probably do so and submit it soon.

To boot Guix System on bcachefs, we're missing the same thing as for JFS: Guile code to read its label & UUID. But there's one big problem: GRUB can't read it. At all[0].

Either we wait until GRUB grows bcachefs support, or somebody (:-)) needs to finally make Guix support kernels + initrds copied to a separate /boot partition.

Kind regards,

T G-R

[0]: https://lists.gnu.org/archive/html/bug-grub/2019-03/msg00000.html

From f22d6bdfbf0f31c19936b817f8ffec7d4613650a Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <address@hidden>
Date: Sun, 8 Dec 2019 00:40:28 +0100
Subject: [PATCH 1/4] XXX gnu: Add bcachefs-tools.

* gnu/packages/file-systems.scm (bcachefs-tools): New public variable.
---
 gnu/packages/file-systems.scm | 55 ++++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index 1594cac846..744bcf2b52 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <address@hidden>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2017 Gábor Boskovits <address@hidden>
 ;;; Copyright © 2017, 2018 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2018 Leo Famulari <address@hidden>
@@ -34,11 +34,13 @@
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages datastructures)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages onc-rpc)
@@ -47,8 +49,59 @@
   #:use-module (gnu packages readline)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages xml))
 
+(define-public bcachefs-tools
+  (let ((commit "f712a866a474d70bfbe3a43aad2b04ceec13ddd3")
+        (revision "0"))
+    (package
+      (name "bcachefs-tools")
+      (version (git-version "0.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://evilpiepirate.org/git/bcachefs-tools.git";)
+               (commit commit)))
+         (sha256
+          (base32 "01zwcqdw6kwdyji7c4307dzgiv67jjmjxpavxx2fq4661v3r7pfn"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags
+         (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+               "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
+               "CC=gcc"
+               "PYTEST=pytest")
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)          ; no configure switch
+           #:tests? #f)))               ; XXX 6 valgrind tests fail
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+
+         ;; libbcachefs/bkey_methods.c:84:41: error: initializer element is 
not constant
+         ("gcc" ,gcc-8)
+
+         ;; For tests.
+         ("python-pytest" ,python-pytest)
+         ("valgrind" ,valgrind)))
+      (inputs
+       `(("keyutils" ,keyutils)
+         ("libaio" ,libaio)
+         ("libscrypt" ,libscrypt)
+         ("libsodium" ,libsodium)
+         ("liburcu" ,liburcu)
+         ("util-linux" ,util-linux)     ; lib{blkid,uuid}
+         ("lz4" ,lz4)
+         ("zlib" ,zlib)
+         ("zstd:lib" ,zstd "lib")))
+      (home-page "https://bcachefs.org/";)
+      (synopsis "")
+      (description
+       "")
+      (license license:gpl2+))))
+
 (define-public httpfs2
   (package
     (name "httpfs2")
-- 
2.23.0

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]