* [bug#38860] [PATCH 2/7] uuid: Add support for JFS.
2020-01-02 0:38 ` [bug#38860] [PATCH 1/7] file-systems: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-02 0:38 ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:38 ` [bug#38860] [PATCH 3/7] gnu: Add jfsutils-static Tobias Geerinckx-Rice via Guix-patches via
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 0:38 UTC (permalink / raw)
To: 38860
* gnu/system/uuid.scm (string->jfs-uuid): New procedure.
(%uuid-parsers, %uuid-printers): Add ‘jfs’ file system type.
---
gnu/system/uuid.scm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gnu/system/uuid.scm b/gnu/system/uuid.scm
index e7a3a0439d..225959e2b7 100644
--- a/gnu/system/uuid.scm
+++ b/gnu/system/uuid.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Danny Milosavljevic <dannym@scratchpost.org>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -43,6 +44,7 @@
string->ext4-uuid
string->btrfs-uuid
string->fat-uuid
+ string->jfs-uuid
iso9660-uuid->string
;; XXX: For lack of a better place.
@@ -202,6 +204,7 @@ ISO9660 UUID representation."
(define string->ext3-uuid string->dce-uuid)
(define string->ext4-uuid string->dce-uuid)
(define string->btrfs-uuid string->dce-uuid)
+(define string->jfs-uuid string->dce-uuid)
(define-syntax vhashq
(syntax-rules (=>)
@@ -215,13 +218,13 @@ ISO9660 UUID representation."
(define %uuid-parsers
(vhashq
- ('dce 'ext2 'ext3 'ext4 'btrfs 'luks => string->dce-uuid)
+ ('dce 'ext2 'ext3 'ext4 'btrfs 'jfs 'luks => string->dce-uuid)
('fat32 'fat16 'fat => string->fat-uuid)
('iso9660 => string->iso9660-uuid)))
(define %uuid-printers
(vhashq
- ('dce 'ext2 'ext3 'ext4 'btrfs 'luks => dce-uuid->string)
+ ('dce 'ext2 'ext3 'ext4 'btrfs 'jfs 'luks => dce-uuid->string)
('iso9660 => iso9660-uuid->string)
('fat32 'fat16 'fat => fat-uuid->string)))
--
2.23.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#38860] [PATCH 3/7] gnu: Add jfsutils-static.
2020-01-02 0:38 ` [bug#38860] [PATCH 1/7] file-systems: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:38 ` [bug#38860] [PATCH 2/7] uuid: " Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-02 0:38 ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:38 ` [bug#38860] [PATCH 4/7] gnu: Add jfs_fsck-static Tobias Geerinckx-Rice via Guix-patches via
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 0:38 UTC (permalink / raw)
To: 38860
gnu/packages/file-systems.scm (jfsutils/static): New public variable.
---
gnu/packages/file-systems.scm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index fbf0e2641f..3a8848b3ad 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -145,6 +145,15 @@ transaction log.
@end enumerate\n")
(license license:gpl3+))) ; no explicit version given
+(define-public jfsutils/static
+ (static-package
+ (package
+ (inherit jfsutils)
+ (name "jfsutils-static")
+ (inputs
+ `(("util-linux:static" ,util-linux "static")
+ ,@(package-inputs jfsutils))))))
+
(define-public disorderfs
(package
(name "disorderfs")
--
2.23.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#38860] [PATCH 4/7] gnu: Add jfs_fsck-static.
2020-01-02 0:38 ` [bug#38860] [PATCH 1/7] file-systems: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:38 ` [bug#38860] [PATCH 2/7] uuid: " Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:38 ` [bug#38860] [PATCH 3/7] gnu: Add jfsutils-static Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-02 0:38 ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:39 ` [bug#38860] [PATCH 5/7] linux-initrd: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 0:38 UTC (permalink / raw)
To: 38860
* gnu/packages/file-systems.scm (jfs_fsck-static): New public variable.
---
gnu/packages/file-systems.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index 3a8848b3ad..a3dc993055 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -28,6 +28,7 @@
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system linux-module)
+ #:use-module (guix build-system trivial)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages acl)
@@ -154,6 +155,38 @@ transaction log.
`(("util-linux:static" ,util-linux "static")
,@(package-inputs jfsutils))))))
+(define-public jfs_fsck/static
+ (package
+ (name "jfs_fsck-static")
+ (version (package-version jfsutils))
+ (source #f)
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils)
+ (ice-9 ftw)
+ (srfi srfi-26))
+ (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
+ (fsck "jfs_fsck")
+ (out (assoc-ref %outputs "out"))
+ (sbin (string-append out "/sbin")))
+ (mkdir-p sbin)
+ (with-directory-excursion sbin
+ (install-file (string-append jfsutils "/sbin/" fsck)
+ ".")
+ (remove-store-references fsck)
+ (chmod fsck #o555))
+ #t))))
+ (inputs
+ `(("jfsutils" ,jfsutils/static)))
+ (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))))
+
(define-public disorderfs
(package
(name "disorderfs")
--
2.23.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#38860] [PATCH 5/7] linux-initrd: Add support for JFS.
2020-01-02 0:38 ` [bug#38860] [PATCH 1/7] file-systems: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
` (2 preceding siblings ...)
2020-01-02 0:38 ` [bug#38860] [PATCH 4/7] gnu: Add jfs_fsck-static Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-02 0:39 ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:39 ` [bug#38860] [PATCH 6/7] tests: install: Test a JFS root file system Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:39 ` [bug#38860] [PATCH 7/7] install: Add jfsutils to the installation image Tobias Geerinckx-Rice via Guix-patches via
5 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 0:39 UTC (permalink / raw)
To: 38860
* gnu/system/linux-initrd.scm (file-system-packages): Add jfs_fsck/static.
(file-system-type-modules): Add ‘jfs’ module.
---
gnu/system/linux-initrd.scm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 0efb8fb222..dcc9b6b937 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -30,6 +31,7 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages disk)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages file-systems)
#:use-module (gnu packages guile)
#:use-module ((gnu packages xorg)
#:select (console-setup xkeyboard-config))
@@ -240,6 +242,9 @@ FILE-SYSTEMS."
'())
,@(if (find (file-system-type-predicate "btrfs") file-systems)
(list btrfs-progs/static)
+ '())
+ ,@(if (find (file-system-type-predicate "jfs") file-systems)
+ (list jfs_fsck/static)
'())))
(define-syntax vhash ;TODO: factorize
@@ -269,6 +274,7 @@ FILE-SYSTEMS."
("9p" => '("9p" "9pnet_virtio"))
("btrfs" => '("btrfs"))
("iso9660" => '("isofs"))
+ ("jfs" => '("jfs"))
(else '())))
(define (file-system-modules file-systems)
--
2.23.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#38860] [PATCH 6/7] tests: install: Test a JFS root file system.
2020-01-02 0:38 ` [bug#38860] [PATCH 1/7] file-systems: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
` (3 preceding siblings ...)
2020-01-02 0:39 ` [bug#38860] [PATCH 5/7] linux-initrd: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-02 0:39 ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-02 0:39 ` [bug#38860] [PATCH 7/7] install: Add jfsutils to the installation image Tobias Geerinckx-Rice via Guix-patches via
5 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 0:39 UTC (permalink / raw)
To: 38860
* gnu/tests/install.scm (%jfs-root-os, %jfs-root-installation-script)
(%test-jfs-root-os): New variables.
---
gnu/tests/install.scm | 78 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 76 insertions(+), 2 deletions(-)
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index bce4c4b9d4..8842d48df8 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -43,7 +43,8 @@
%test-separate-home-os
%test-raid-root-os
%test-encrypted-root-os
- %test-btrfs-root-os))
+ %test-btrfs-root-os
+ %test-jfs-root-os))
;;; Commentary:
;;;
@@ -810,4 +811,77 @@ build (current-guix) and then store a couple of full system images.")
(command (qemu-command/writable-image image)))
(run-basic-test %btrfs-root-os command "btrfs-root-os")))))
+\f
+;;;
+;;; JFS root file system.
+;;;
+
+(define-os-with-source (%jfs-root-os %jfs-root-os-source)
+ ;; The OS we want to install.
+ (use-modules (gnu) (gnu tests) (srfi srfi-1))
+
+ (operating-system
+ (host-name "liberigilo")
+ (timezone "Europe/Paris")
+ (locale "en_US.UTF-8")
+
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)
+ (target "/dev/vdb")))
+ (kernel-arguments '("console=ttyS0"))
+ (file-systems (cons (file-system
+ (device (file-system-label "my-root"))
+ (mount-point "/")
+ (type "jfs"))
+ %base-file-systems))
+ (users (cons (user-account
+ (name "charlie")
+ (group "users")
+ (supplementary-groups '("wheel" "audio" "video")))
+ %base-user-accounts))
+ (services (cons (service marionette-service-type
+ (marionette-configuration
+ (imported-modules '((gnu services herd)
+ (guix combinators)))))
+ %base-services))))
+
+(define %jfs-root-installation-script
+ ;; Shell script of a simple installation.
+ "\
+. /etc/profile
+set -e -x
+guix --version
+
+export GUIX_BUILD_OPTIONS=--no-grafts
+ls -l /run/current-system/gc-roots
+parted --script /dev/vdb mklabel gpt \\
+ mkpart primary ext2 1M 3M \\
+ mkpart primary ext2 3M 2G \\
+ set 1 boot on \\
+ set 1 bios_grub on
+jfs_mkfs -L my-root -q /dev/vdb2
+mount /dev/vdb2 /mnt
+herd start cow-store /mnt
+mkdir /mnt/etc
+cp /etc/target-config.scm /mnt/etc/config.scm
+guix system build /mnt/etc/config.scm
+guix system init /mnt/etc/config.scm /mnt --no-substitutes
+sync
+reboot\n")
+
+(define %test-jfs-root-os
+ (system-test
+ (name "jfs-root-os")
+ (description
+ "Test basic functionality of an OS installed like one would do by hand.
+This test is expensive in terms of CPU and storage usage since we need to
+build (current-guix) and then store a couple of full system images.")
+ (value
+ (mlet* %store-monad ((image (run-install %jfs-root-os
+ %jfs-root-os-source
+ #:script
+ %jfs-root-installation-script))
+ (command (qemu-command/writable-image image)))
+ (run-basic-test %jfs-root-os command "jfs-root-os")))))
+
;;; install.scm ends here
--
2.23.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#38860] [PATCH 7/7] install: Add jfsutils to the installation image.
2020-01-02 0:38 ` [bug#38860] [PATCH 1/7] file-systems: Add support for JFS Tobias Geerinckx-Rice via Guix-patches via
` (4 preceding siblings ...)
2020-01-02 0:39 ` [bug#38860] [PATCH 6/7] tests: install: Test a JFS root file system Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-02 0:39 ` Tobias Geerinckx-Rice via Guix-patches via
5 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 0:39 UTC (permalink / raw)
To: 38860
* gnu/system/install.scm (installation-os)[packages]: Add jfsutils.
---
gnu/system/install.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 4d1612ac7f..c15c2c7814 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -3,7 +3,7 @@
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -38,6 +38,7 @@
#:use-module (gnu packages bash)
#:use-module (gnu packages bootloaders)
#:use-module (gnu packages certs)
+ #:use-module (gnu packages file-systems)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages guile)
@@ -488,6 +489,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
mdadm
dosfstools ;mkfs.fat, for the UEFI boot partition
btrfs-progs
+ jfsutils
openssh ;we already have sshd, having ssh/scp can help
wireless-tools iw wpa-supplicant-minimal iproute
;; XXX: We used to have GNU fdisk here, but as of version
--
2.23.0
^ permalink raw reply related [flat|nested] 10+ messages in thread