[PATCH] gnu: Add cramfs-tools.

DoneSubmitted by Vincent Legoll.
Details
2 participants
  • Ludovic Courtès
  • Vincent Legoll
Owner
unassigned
Severity
normal
V
V
Vincent Legoll wrote on 26 Mar 2020 23:34
(address . guix-patches@gnu.org)
CAEwRq=r09qqcCfgC=CpMJZ4g3JztS8SkDieSHMPpMjpOH39QyA@mail.gmail.com
This patch adds the updated cramfs-tools
suite from Nicolas Pitre.

This version has additional features
implemented over the 1.1 version still
packaged in some other distros, which
is unmaintained (available on

It handles uncompressed blocks, random
block placement and XiP.

Lightly tested, by loop-mounting a tiny (4kB)
cramfs in a file, worked fine.

--
Vincent Legoll
From ff79a4b2d798bba222ac502a7aa1f7ef0a97e249 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Thu, 26 Mar 2020 23:12:53 +0100
Subject: [PATCH] gnu: Add cramfs-tools.

* gnu/packages/linux.scm (cramfs-tools): New variable.
---
gnu/packages/linux.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 8fec3352f3..6ab08e18f4 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4371,6 +4371,40 @@ repair and easy administration.")
 from the btrfs-progs package.  It is meant to be used in initrds.")
     (license (package-license btrfs-progs))))
 
+(define-public cramfs-tools
+  (package
+    (name "cramfs-tools")
+    (version "2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/npitre/cramfs-tools/archive/v"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "1hqwy3bsj4j7wmhj3hr4l9c1gqrscpgprcsnchxhckq3mpna9dyd"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f                      ; No tests.
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file "mkcramfs" (string-append out "/sbin"))
+               (install-file "cramfsck" (string-append out "/sbin")))
+             #t)))))
+    (inputs
+     `(("zlib" ,zlib)))
+    (home-page "https://github.com/npitre/cramfs-tools")
+    (synopsis "Tools to manage Cramfs filesystems")
+    (description "Cramfs is a Linux filesystem designed to be simple, small,
+and to compress things well.  It is used on a number of embedded systems and
+small devices.  This version has additional features such as uncompressed
+blocks and random block placement.")
+    (license license:gpl2)))
+
 (define-public compsize
   (package
     (name "compsize")
-- 
2.25.2
V
V
Vincent Legoll wrote on 27 Mar 2020 00:22
Re: gnu: Add cramfs-tools
(address . 40246@debbugs.gnu.org)
CAEwRq=q-gURk8L5fBTtG0iOU2nA9fKxAmYYND1-hkp6JCL8-sw@mail.gmail.com
This was obsoleted, but then resurrected later...

From wikikpedia
[...]
In 2013, Linux maintainers indicated that cramfs was made obsolete by
squashfs,[1] but the file system got rehabilitated in 2017 for use in
low-memory devices where using squashfs may not be viable.
[...]

And also the guix kernel has support for it...
So why not ?

--
Vincent Legoll
L
L
Ludovic Courtès wrote on 1 Apr 2020 23:22
Re: [bug#40246] [PATCH] gnu: Add cramfs-tools.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40246@debbugs.gnu.org)
87sghmsxy1.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (7 lines)
> From ff79a4b2d798bba222ac502a7aa1f7ef0a97e249 Mon Sep 17 00:00:00 2001
> From: Vincent Legoll <vincent.legoll@gmail.com>
> Date: Thu, 26 Mar 2020 23:12:53 +0100
> Subject: [PATCH] gnu: Add cramfs-tools.
>
> * gnu/packages/linux.scm (cramfs-tools): New variable.

[...]

Toggle quote (7 lines)
> + (name "cramfs-tools")
> + (version "2.1")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://github.com/npitre/cramfs-tools/archive/v"

As reported by ‘guix lint’, please don’t refer to a generated tarball.

Instead you can use a hosted “hand-crafted” tarball if there’s one or,
more likely, ‘git-fetch’.

Toggle quote (6 lines)
> + (synopsis "Tools to manage Cramfs filesystems")
> + (description "Cramfs is a Linux filesystem designed to be simple, small,
> +and to compress things well. It is used on a number of embedded systems and
> +small devices. This version has additional features such as uncompressed
> +blocks and random block placement.")

Could you write “file systems” (two words)? This is by convention in
GNU and Guix.

Thanks in advance!

Ludo’.
V
V
Vincent Legoll wrote on 1 Apr 2020 23:46
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40246@debbugs.gnu.org)
CAEwRq=qaiD8GfA2SWVgzsMd8FQagbVx3VcY+N3NXOkQ9=ePBqA@mail.gmail.com
Hello Ludovic,

On Wed, Apr 1, 2020 at 11:22 PM Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (5 lines)
> As reported by ‘guix lint’, please don’t refer to a generated tarball.
>
> Instead you can use a hosted “hand-crafted” tarball if there’s one or,
> more likely, ‘git-fetch’.
>
[...]
Toggle quote (4 lines)
>
> Could you write “file systems” (two words)? This is by convention in
> GNU and Guix.

Here it is

--
Vincent Legoll
From d8c3ae54d42d662f7af6cb6740b6ae16455d9073 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Thu, 26 Mar 2020 23:12:53 +0100
Subject: [PATCH] gnu: Add cramfs-tools.

* gnu/packages/linux.scm (cramfs-tools): New variable.
---
gnu/packages/linux.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 945c15d972..f36531efa0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4368,6 +4368,40 @@ repair and easy administration.")
 from the btrfs-progs package.  It is meant to be used in initrds.")
     (license (package-license btrfs-progs))))
 
+(define-public cramfs-tools
+  (package
+    (name "cramfs-tools")
+    (home-page "https://github.com/npitre/cramfs-tools")
+    (version "2.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
+              (file-name (git-file-name name version))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f                      ; No tests.
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file "mkcramfs" (string-append out "/sbin"))
+               (install-file "cramfsck" (string-append out "/sbin")))
+             #t)))))
+    (inputs
+     `(("zlib" ,zlib)))
+    (synopsis "Tools to manage Cramfs file systems")
+    (description "Cramfs is a Linux file system designed to be simple, small,
+and to compress things well.  It is used on a number of embedded systems and
+small devices.  This version has additional features such as uncompressed
+blocks and random block placement.")
+    (license license:gpl2)))
+
 (define-public compsize
   (package
     (name "compsize")
-- 
2.25.2
L
L
Ludovic Courtès wrote on 2 Apr 2020 10:01
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40246-done@debbugs.gnu.org)
877dyys4dg.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (7 lines)
> From d8c3ae54d42d662f7af6cb6740b6ae16455d9073 Mon Sep 17 00:00:00 2001
> From: Vincent Legoll <vincent.legoll@gmail.com>
> Date: Thu, 26 Mar 2020 23:12:53 +0100
> Subject: [PATCH] gnu: Add cramfs-tools.
>
> * gnu/packages/linux.scm (cramfs-tools): New variable.

Applied!

Toggle quote (2 lines)
> + (license license:gpl2)))

I changed that to ‘gpl2+’ because I noticed that source file headers
carry the “or any later version” wording.

Thanks,
Ludo’.
Closed
V
V
Vincent Legoll wrote on 2 Apr 2020 10:03
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40246-done@debbugs.gnu.org)
CAEwRq=pZ38P6Hvk=oBHh+jxYAs22ARojW85UHEJWd-em5Pe0Rg@mail.gmail.com
Thanks

--
Vincent Legoll
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 40246@debbugs.gnu.org