Hi Tobias,

On 12/12/19 12:11 pm, Tobias Geerinckx-Rice wrote:
Michael & me,

Tobias Geerinckx-Rice 写道:
- jfsutils needs to be packaged for Guix

I wrote a quick but working package[0].

- and a static fsck added to the initramfs

I didn't have time for this yet.


Ok so it seems you're half done already, but I've been plodding away (and didn't check my email on my old computer) and have both building.

I'm not really sure where to put it or how to compile each part (it just build jfsutils, not jfs_fsck/static) and I used the slackware patches, but attached is what i have at the moment.  I used jfs_fsck for the static fsck because that's the default name but it could be fsck.jfs.

I started with a definitions of e2fsprogs and it's related functions from a linux.scm i found in /gnu/store and based it on that.

I've a number of built package 'attempts' building up - should I just run guix gc to clear them out or will that delete stuff i'm just going to need again?

Cheers,
 Z

(I presume attachments work ok on this list.)


(define-module (jfsutils)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define-public jfsutils
  (package
    (name "jfsutils")
    (version "1.1.15")
    (source (origin
              (method url-fetch)
              (uri (string-append
		    "http://jfs.sourceforge.net/project/pub/jfsutils-";
		    version ".tar.gz"))
              (sha256
               (base32
                "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
	      (patches (search-patches "jfsutils.patch"))))
    (build-system gnu-build-system)
    (inputs `(("util-linux" ,util-linux)))
    (home-page "http://jfs.sourceforge.net/";)
    (synopsis "IBM JFS file system tools")
    (description "This package provides commands to create and check JFS
file systems.")
    ;; COPYING is gpl3, the headers are gpl2+?
    (license gpl3))
)

(define jfsutils/static
  (static-package
   (package (inherit jfsutils)
	    (inputs `())
	    (native-inputs
	     `(("util-linux:static" ,util-linux "static")
	       ("util-linux" ,util-linux)))
            (arguments
             ;; Force static linkage
             (substitute-keyword-arguments (package-arguments jfsutils)
               ((#:configure-flags _)
                '(list "LDFLAGS=-static")))))))

(define-public jfs_fsck/static
  (package
    (name "jfs_fsck-static")
    (version (package-version jfsutils))
    (build-system trivial-build-system)
    (source #f)
    (inputs
     `(("jfsutils" ,jfsutils/static)))
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
         (use-modules (guix build utils)
                      (ice-9 ftw)
                      (srfi srfi-26))

         (let ((jfs_fsck (string-append (assoc-ref %build-inputs "jfsutils")
                                      "/sbin/jfs_fsck"))
               (bin    (string-append (assoc-ref %outputs "out") "/sbin")))
           (mkdir-p bin)
           (with-directory-excursion bin
             (copy-file jfs_fsck "jfs_fsck")
             (remove-store-references "jfs_fsck")
             (chmod "jfs_fsck" #o555))
           #t))))
    (home-page (package-home-page jfsutils))
    (synopsis "Statically-linked jfs_fsck command from jfsutils")
    (description "This package provides statically-linked jfs_fsck command taken
from the jfsutils package.  It is meant to be used in initrds.")
    (license (package-license jfsutils))))

--- ./libfs/devices.c.orig	2009-03-23 10:37:05.000000000 -0500
+++ ./libfs/devices.c	2018-09-18 18:51:00.699063404 -0500
@@ -40,6 +40,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#include <sys/sysmacros.h>
 #if defined(__DragonFly__)
 #include <machine/param.h>
 #include <sys/diskslice.h>
--- ./libfs/devices.h.orig	2005-11-22 14:43:55.000000000 -0600
+++ ./libfs/devices.h	2018-09-19 01:55:37.960336102 -0500
@@ -40,6 +40,8 @@
 #define ERROR_INVALID_PARAMETER	87
 #define ERROR_DISK_FULL		112
 
+#include <inttypes.h>
+
 struct stat;
 
 int ujfs_get_dev_size(FILE *, int64_t * size);

Reply via email to