FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Ernesto A. Fernández" <ernesto.mnd.fernandez@gmail.com>
To: fstests@vger.kernel.org
Cc: Eryu Guan <guaneryu@gmail.com>,
	Eric Sandeen <sandeen@sandeen.net>,
	Dave Chinner <david@fromorbit.com>
Subject: [PATCH v2] fstests: add support for hfsplus
Date: Mon, 24 Sep 2018 18:43:52 -0300	[thread overview]
Message-ID: <20180924214352.7fjpxbcnxpugnoms@eaf> (raw)

Running tests on hfsplus requires patched versions of the mkfs and fsck
tools [1] that support filesystems smaller than the device.

[1] https://github.com/eafer/hfsprogs-linux.git

Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
---
 common/config | 10 ++++++++++
 common/rc     | 15 ++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/common/config b/common/config
index 1ba8d96c..315f8b1e 100644
--- a/common/config
+++ b/common/config
@@ -229,6 +229,7 @@ case "$HOSTOS" in
 	export MKFS_CIFS_PROG="false"
 	export MKFS_OVERLAY_PROG="false"
 	export MKFS_REISER4_PROG=$(type -P mkfs.reiser4)
+	export MKFS_HFSPLUS_PROG=$(type -P mkfs.hfsplus)
 	export E2FSCK_PROG=$(type -P e2fsck)
 	export TUNE2FS_PROG=$(type -P tune2fs)
 	export FSCK_OVERLAY_PROG=$(type -P fsck.overlay)
@@ -313,6 +314,9 @@ _mount_opts()
 	ubifs)
 		export MOUNT_OPTIONS=$UBIFS_MOUNT_OPTIONS
 		;;
+	hfsplus)
+		export MOUNT_OPTIONS=$HFSPLUS_MOUNT_OPTIONS
+		;;
 	*)
 		;;
 	esac
@@ -380,6 +384,9 @@ _mkfs_opts()
 	f2fs)
 		export MKFS_OPTIONS="$F2FS_MKFS_OPTIONS"
 		;;
+	hfsplus)
+		export MKFS_OPTIONS=$HFSPLUS_MKFS_OPTIONS
+		;;
 	*)
 		;;
 	esac
@@ -397,6 +404,9 @@ _fsck_opts()
 	f2fs)
 		export FSCK_OPTIONS=""
 		;;
+	hfsplus)
+		export FSCK_OPTIONS="-nX"
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
diff --git a/common/rc b/common/rc
index d5bb1fee..a843e9f6 100644
--- a/common/rc
+++ b/common/rc
@@ -158,6 +158,12 @@ case "$FSTYP" in
     ubifs)
 	[ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found"
 	;;
+    hfsplus)
+	[ "$MKFS_HFSPLUS_PROG" = "" ] && _fatal "mkfs.hfsplus not found"
+	mkfs.hfsplus -X |& grep "invalid" &&
+		_fatal "A patched version of mkfs.hfsplus is required:" \
+		       "https://github.com/eafer/hfsprogs-linux.git"
+	;;
 esac
 
 if [ ! -z "$REPORT_LIST" ]; then
@@ -746,6 +752,10 @@ _scratch_mkfs()
 		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
 		mkfs_filter="grep -v -e ^mkfs\.ocfs2"
 		;;
+	hfsplus)
+		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP -- -X"
+		mkfs_filter="cat"
+		;;
 	*)
 		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
 		mkfs_filter="cat"
@@ -995,6 +1005,9 @@ _scratch_mkfs_sized()
 	fi
 	export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
 	;;
+    hfsplus)
+	${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -X $fssize -b $blocksize $SCRATCH_DEV
+	;;
     *)
 	_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
 	;;
@@ -3055,7 +3068,7 @@ _require_metadata_journaling()
 	fi
 
 	case "$FSTYP" in
-	ext2|vfat|msdos|udf)
+	ext2|vfat|msdos|udf|hfsplus)
 		_notrun "$FSTYP does not support metadata journaling"
 		;;
 	ext4)
-- 
2.11.0

             reply	other threads:[~2018-09-25  3:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 21:43 Ernesto A. Fernández [this message]
2018-09-25  5:57 ` [PATCH v2] fstests: add support for hfsplus Amir Goldstein
2018-09-25 17:58   ` Ernesto A. Fernández
2018-09-25 18:12     ` Amir Goldstein
2018-09-25 18:35       ` Ernesto A. Fernández

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180924214352.7fjpxbcnxpugnoms@eaf \
    --to=ernesto.mnd.fernandez@gmail.com \
    --cc=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox