generic/740: set env for mkfs.exfat
PATCH 1/2 generic/740: set env for mkfs.exfat
Foreign filesystem detection is added in exfatprogs version 1.4.1. To maintain backward compatibility, mkfs.exfat refuses to format the device only when it's run from terminal with a tty associated to it.
This is similar to how e2fsprogs work around the issue. However, with exfatprogs, this behaviour can be overridden with the special environment variable EXFAT_TTY_OVERRIDE to simulate shell invocation by user.
--- tests/generic/740 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
tests/generic/740 +14 -1
@@ -28,6 +28,18 @@ _require_block_device "${SCRATCH_DEV}" # not all the FS support zoned block device _require_non_zoned_device "${SCRATCH_DEV}" +mkfs_preop="" +mkfs_preargs="" +mkfs_postargs="" + +case "$FSTYP" in +exfat) + # For backward compatibility, mkfs.exfat refuses to format only when run + # from a tty. This env var should override the behaviour if supported. + mkfs_preop="EXFAT_TTY_OVERRIDE=1" + ;; +esac + echo "Silence is golden." for fs in `echo ${MKFS_PROG}.* | sed -e "s:${MKFS_PROG}.::g"` do
@@ -83,7 +95,8 @@ do # next, ensure we don't overwrite it echo "=== Attempting $FSTYP overwrite of $fs..." >>$seqres.full - ${MKFS_PROG} -t $FSTYP $SCRATCH_DEV >>$seqres.full 2>&1 + eval $mkfs_preop ${MKFS_PROG} -t $FSTYP $mkfs_preargs $SCRATCH_DEV $mkfs_postargs \ + >>$seqres.full 2>&1 [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!" else
Signature · 1 line
2.54.0
PATCH 2/2 generic/740: add --force option to mkfs.ntfs
mkntfs refuses to format the target if it's backed by a "real" device but not a partition to maintain compatibility with Windows. When formatting the scratch device in NTFS for testing, this behaviour has to be overridden so that any type of blockdev can be used as a scratch device.
--- tests/generic/740 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/generic/740 +4 -2
@@ -72,8 +72,10 @@ do postargs=2000 ;; ntfs) - # "quick" format that doesn't zero the entire device - postargs="--quick" + # "quick" format that doesn't zero the entire device. Use -F so + # that NTFS-3G mkfs formats the volume even if the scratch + # blockdev is not a partition. + postargs="--quick --force" ;; reiser4) preop="echo y |"
Signature · 1 line
2.54.0
Re: [PATCH 2/2] generic/740: add --force option to mkfs.ntfs
Looks good:
Re: [PATCH 2/2] generic/740: add --force option to mkfs.ntfs
In reply to David TimberQuoted 16 lines · David Timber
mkntfs refuses to format the target if it's backed by a "real" device but not a partition to maintain compatibility with Windows. When formatting the scratch device in NTFS for testing, this behaviour has to be overridden so that any type of blockdev can be used as a scratch device.
Signed-off-by David Timber <[email protected]>--- tests/generic/740 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/generic/740 +0
-0
tests/generic/740 do · line 75
Quoted 6 lines
tests/generic/740 +1
-2@@ -72,8 +72,10 @@ do postargs=2000 ;; ntfs) - # "quick" format that doesn't zero the entire device - postargs="--quick" + # "quick" format that doesn't zero the entire device. Use -F so
"Use --force..." ?
--D
Quoted 10 lines
tests/generic/740 +3
-0+ # that NTFS-3G mkfs formats the volume even if the scratch + # blockdev is not a partition. + postargs="--quick --force" ;; reiser4) preop="echo y |"Signature · 1 line
2.54.0
Quoted 38 lines · David Timber
Foreign filesystem detection is added in exfatprogs version 1.4.1. To maintain backward compatibility, mkfs.exfat refuses to format the device only when it's run from terminal with a tty associated to it.
This is similar to how e2fsprogs work around the issue. However, with exfatprogs, this behaviour can be overridden with the special environment variable
EXFAT_TTY_OVERRIDEto simulate shell invocation by user.Signed-off-by David Timber <[email protected]>--- tests/generic/740 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)tests/generic/740 +12
-0@@ -28,6 +28,18 @@ _require_block_device "${SCRATCH_DEV}" # not all the FS support zoned block device _require_non_zoned_device "${SCRATCH_DEV}" +mkfs_preop="" +mkfs_preargs="" +mkfs_postargs="" + +case "$FSTYP" in +exfat) + # For backward compatibility, mkfs.exfat refuses to format only when run + # from a tty. This env var should override the behaviour if supported. + mkfs_preop="EXFAT_TTY_OVERRIDE=1" + ;; +esac + echo "Silence is golden." for fs in `echo ${MKFS_PROG}.* | sed -e "s:${MKFS_PROG}.::g"` do
tests/generic/740 do · line 98
Quoted 5 lines
tests/generic/740 +1
-1@@ -83,7 +95,8 @@ do # next, ensure we don't overwrite it echo "=== Attempting $FSTYP overwrite of $fs..." >>$seqres.full - ${MKFS_PROG} -t $FSTYP $SCRATCH_DEV >>$seqres.full 2>&1 + eval $mkfs_preop ${MKFS_PROG} -t $FSTYP $mkfs_preargs $SCRATCH_DEV $mkfs_postargs \
breaking up the long line still would be nice here, i.e. keep at 80 characters. Else looks good.
Quoted 41 lines · Christoph Hellwig
Quoted 40 lines · David Timber
Foreign filesystem detection is added in exfatprogs version 1.4.1. To maintain backward compatibility, mkfs.exfat refuses to format the device only when it's run from terminal with a tty associated to it.
This is similar to how e2fsprogs work around the issue. However, with exfatprogs, this behaviour can be overridden with the special environment variable
EXFAT_TTY_OVERRIDEto simulate shell invocation by user.Signed-off-by David Timber <[email protected]>--- tests/generic/740 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)tests/generic/740 +12
-0@@ -28,6 +28,18 @@ _require_block_device "${SCRATCH_DEV}" # not all the FS support zoned block device _require_non_zoned_device "${SCRATCH_DEV}" +mkfs_preop="" +mkfs_preargs="" +mkfs_postargs="" + +case "$FSTYP" in +exfat) + # For backward compatibility, mkfs.exfat refuses to format only when run + # from a tty. This env var should override the behaviour if supported. + mkfs_preop="EXFAT_TTY_OVERRIDE=1" + ;; +esac + echo "Silence is golden." for fs in `echo ${MKFS_PROG}.* | sed -e "s:${MKFS_PROG}.::g"` do@@ -83,7 +95,8 @@ do # next, ensure we don't overwrite it
Quoted 6 lines
tests/generic/740 do · line 98
Quoted 3 lines
tests/generic/740 +1
-1echo "=== Attempting $FSTYP overwrite of $fs..." >>$seqres.full - ${MKFS_PROG} -t $FSTYP $SCRATCH_DEV >>$seqres.full 2>&1 + eval $mkfs_preop ${MKFS_PROG} -t $FSTYP $mkfs_preargs $SCRATCH_DEV $mkfs_postargs \breaking up the long line still would be nice here, i.e. keep at 80 characters. Else looks good.
I wonder why we don't just redirect stdin from /dev/null, it's not like we want to capture user input anyway...
--D