diff mbox series

[bug#41015] (incomplete) F2FS support

Message ID 20200502024800.4b741809@riseup.net
State Accepted
Headers show
Series [bug#41015] (incomplete) F2FS support | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Csepp May 2, 2020, 12:48 a.m. UTC
I've been working on this on and off for a while, but can't finish the
last steps, so I'm sending it as is.

What works:
installing to and booting from a partition specified by UUID

What seemed to work but then didn't:
installing to a partition specified by its label. i tried to do the
math, but for some reason it still can't find it. I'm pretty sure it
worked at some point.

What definitely doesn't work:
file system check on boot. I tried and tried to create a statically
linked fsck and I've concluded that it's impossible and that I hate
linkers. Someone else can figure it out, because I've given up.
This means that the init will look for it but won't find it. You will
be thrown into a rescue shell, but if you exit it with `,q`, the init
process continues without any issue.


I used this to set Guix up on my desktop machine on an SSD and
other than the issues I've mentioned, it seems to be working fine.


I'm hoping someone will pick up the work where I left it. If not, I may
revisit it once I've learned enough about how f2fs-tools is built. But I
can't say that I'm eager to devote more of my life to that.


About the patches:
0001-0005 are what you need for a working system, I included the rest
to help anyone who wishes to continue the work.

Comments

Danny Milosavljevic May 2, 2020, 9:02 a.m. UTC | #1
Hi,

thanks!

I know exactly what you mean--I've had some "fun" preparing initrds too.

Pushed the first patch to guix master as commit 23b37c3d40d497cc6f07437ab26ab10e60fb6e09
and a variant of your fourth patch to guix master as commit 27efeef3068bfa21011ea509e21efcbe8c353b5f
so you should be able to at least boot.

Note:

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/tree/include/linux/f2fs_fs.h says volume name can have up to 512 chars.

Your comment says 16, but your code uses 512.  I've fixed comment to say 512.

fsck progress so far: fsck.f2fs links to libuuid dynamically...
Danny Milosavljevic May 2, 2020, 9:40 a.m. UTC | #2
fsck progress so far:

Everything except mkfs.f2fs links statically.
Danny Milosavljevic May 2, 2020, 9:56 a.m. UTC | #3
Pushed that version of f2fs-tools-static to guix master as commit
807986a55fc2849d6986efb79f9a015cf4132e09 anyway since it is a problem
in our util-linux package.

See also https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019
Danny Milosavljevic May 2, 2020, 9:59 a.m. UTC | #4
Pushed patch 3 to guix master as commit 2dd2210bf9065c9dcc3ec5412776a88b4df0201b.
Danny Milosavljevic May 2, 2020, 10:04 a.m. UTC | #5
On Sat, 2 May 2020 02:48:00 +0200
raingloom <raingloom@riseup.net> wrote:

> What seemed to work but then didn't:
> installing to a partition specified by its label. i tried to do the
> math, but for some reason it still can't find it. I'm pretty sure it
> worked at some point.

Please try:

$ guile --no-auto-compile -L .
((@@ (gnu build file-systems) f2fs-superblock-volume-name)
 ((@@ (gnu build file-systems) read-f2fs-superblock) "your-device"))
Danny Milosavljevic May 3, 2020, 10:41 a.m. UTC | #6
Correction:

Pushed patch 3 to guix master as commit a5cf52d3aa31717a8ae0c2cbbc4b848266ed7818.
Danny Milosavljevic May 3, 2020, 6:47 p.m. UTC | #7
I've tried it now--it wasn't honoring the UTF-16 NUL termination.
I've fixed it now in guix master commit f73f4b3a2d7a313a6cb1667bd69205ea4b09f57c.
Danny Milosavljevic May 3, 2020, 9:05 p.m. UTC | #8
On Sat, 2 May 2020 11:56:54 +0200
Danny Milosavljevic <dannym@scratchpost.org> wrote:

> See also https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019

Pushed a workaround for that bug to guix master in commit
da09c63e78ebebeabb347f483d7284b87ff51c2f
and enabled f2fs fsck in commit 33eab4a10dcd2a6580f168f18455df1d4653d14b.

Added system installation test in commit af7a8e718dddd12c3dddf92bfce2f79471fa4a0d.

Added workaround for mising support for UTF-16 in the initrd's guile in
commit bb357c509e1c017e1fef5aa5f4d05beea0c25157.

That concludes this patch series.
diff mbox series

Patch

From ab44403a7563fe6ca3edf4d1b7929a8d7d12429a Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@protonmail.com>
Date: Thu, 23 Apr 2020 04:14:37 +0200
Subject: [PATCH 8/8] trying the original approach + glibc static + adding a
 "breakpoint"

---
 gnu/packages/linux.scm | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c0fac7b6e5..801ffbdf88 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4571,17 +4571,18 @@  disks and SD cards.  This package provides the userland utilities.")
      (inherit f2fs-tools)
      (name "f2fs-tools-static")
      (arguments
-      '(#:make-flags (list "CFLAGS=-v")
-        #:phases
-        (modify-phases %standard-phases
-          (add-before 'install 'fail
-            (lambda _
-              (error "fail on purpose"))))))
+      (substitute-keyword-arguments (package-arguments f2fs-tools)
+        ((#:make-flags flags)
+         `(cons* "CFLAGS=-v" ,flags))
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (add-before 'install 'fail
+              (lambda _
+                (error "fail on purpose")))))))
      (inputs
-      `(,@(package-inputs f2fs-tools)
-        ("libuuid:static" ,util-linux "static")
+      `(("libuuid:static" ,util-linux "static")
         ("glibc:static" ,glibc "static")
-        )))))
+        ,@(package-inputs f2fs-tools))))))
 
 (define-public f2fs-fsck/static
   (package
-- 
2.26.2