All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prasad Joshi <prasadjoshi.linux@gmail.com>
To: prasadjoshi.linux@gmail.com
Cc: Chaitanya Kulkarni <chaitanyakulkarni15@gmail.com>,
	xfs@oss.sgi.com, linux-ext4@vger.kernel.org
Subject: [PATCH] Assume yes when test device is not partitioned
Date: Sat,  3 Sep 2011 14:02:03 +0530	[thread overview]
Message-ID: <1315038723-2009-1-git-send-email-prasadjoshi.linux@gmail.com> (raw)

If an entire device used for file system creation, the mkfs.ext2/3/4
asks for confirmation before proceeding. Since the device is
configured for testing it is safe to assume positive response
during mkfs.

The patch also replaces hard coded mkfs path with MKFS_PROG variable.

Signed-off-by: Chaitanya Kulkarni <chaitanyakulkarni15@gmail.com>
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
---
 032       |    4 ++--
 049       |    2 +-
 073       |    2 +-
 common.rc |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/032 b/032
index 4261ca2..bf88492 100755
--- a/032
+++ b/032
@@ -45,7 +45,7 @@ _require_nobigloopfs
 _require_scratch
 
 echo "Silence is golden."
-for fs in `echo /sbin/mkfs.* | sed -e 's/.sbin.mkfs.//g'`
+for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
 do
 	preop=""	# for special input needs
 	preargs=""	# for any special pre-device options
@@ -78,7 +78,7 @@ do
 	if [ $? -eq 0 ] ; then
 		# next, ensure we don't overwrite it
 		echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
-		/sbin/mkfs.xfs $SCRATCH_DEV >>$seq.full 2>&1
+		${MKFS_PROG}.xfs $SCRATCH_DEV >>$seq.full 2>&1
 
 		[ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
 	else
diff --git a/049 b/049
index c6c4faa..8d4a22f 100755
--- a/049
+++ b/049
@@ -83,7 +83,7 @@ mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seq.full 2>&1 \
     || _fail "!!! failed to mount"
 
 _log "Create xfs fs in file on scratch"
-/sbin/mkfs.xfs -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
+${MKFS_PROG}.xfs -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
     >> $seq.full 2>&1 \
     || _fail "!!! failed to mkfs xfs"
 
diff --git a/073 b/073
index 18257d4..fc0951f 100755
--- a/073
+++ b/073
@@ -155,7 +155,7 @@ _verify_copy $imgs.image $SCRATCH_DEV $SCRATCH_MNT
 
 echo 
 echo === copying scratch device to single target, large ro device
-/sbin/mkfs.xfs -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
+${MKFS_PROG}.xfs -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
 rmdir $imgs.source_dir 2>/dev/null
 mkdir $imgs.source_dir
 
diff --git a/common.rc b/common.rc
index 35f782b..a356c02 100644
--- a/common.rc
+++ b/common.rc
@@ -314,7 +314,7 @@ _scratch_mkfs()
         $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
 	;;
     *)
-	/sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
+	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
     esac
 }
@@ -333,7 +333,7 @@ _scratch_mkfs_sized()
 	_scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
 	;;
     ext2|ext3|ext4|ext4dev)
-	/sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+	yes | ${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
 	;;
     btrfs)
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
-- 
1.7.4.1


WARNING: multiple messages have this Message-ID (diff)
From: Prasad Joshi <prasadjoshi.linux@gmail.com>
To: prasadjoshi.linux@gmail.com
Cc: linux-ext4@vger.kernel.org,
	Chaitanya Kulkarni <chaitanyakulkarni15@gmail.com>,
	xfs@oss.sgi.com
Subject: [PATCH] Assume yes when test device is not partitioned
Date: Sat,  3 Sep 2011 14:02:03 +0530	[thread overview]
Message-ID: <1315038723-2009-1-git-send-email-prasadjoshi.linux@gmail.com> (raw)

If an entire device used for file system creation, the mkfs.ext2/3/4
asks for confirmation before proceeding. Since the device is
configured for testing it is safe to assume positive response
during mkfs.

The patch also replaces hard coded mkfs path with MKFS_PROG variable.

Signed-off-by: Chaitanya Kulkarni <chaitanyakulkarni15@gmail.com>
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
---
 032       |    4 ++--
 049       |    2 +-
 073       |    2 +-
 common.rc |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/032 b/032
index 4261ca2..bf88492 100755
--- a/032
+++ b/032
@@ -45,7 +45,7 @@ _require_nobigloopfs
 _require_scratch
 
 echo "Silence is golden."
-for fs in `echo /sbin/mkfs.* | sed -e 's/.sbin.mkfs.//g'`
+for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
 do
 	preop=""	# for special input needs
 	preargs=""	# for any special pre-device options
@@ -78,7 +78,7 @@ do
 	if [ $? -eq 0 ] ; then
 		# next, ensure we don't overwrite it
 		echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
-		/sbin/mkfs.xfs $SCRATCH_DEV >>$seq.full 2>&1
+		${MKFS_PROG}.xfs $SCRATCH_DEV >>$seq.full 2>&1
 
 		[ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
 	else
diff --git a/049 b/049
index c6c4faa..8d4a22f 100755
--- a/049
+++ b/049
@@ -83,7 +83,7 @@ mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seq.full 2>&1 \
     || _fail "!!! failed to mount"
 
 _log "Create xfs fs in file on scratch"
-/sbin/mkfs.xfs -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
+${MKFS_PROG}.xfs -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
     >> $seq.full 2>&1 \
     || _fail "!!! failed to mkfs xfs"
 
diff --git a/073 b/073
index 18257d4..fc0951f 100755
--- a/073
+++ b/073
@@ -155,7 +155,7 @@ _verify_copy $imgs.image $SCRATCH_DEV $SCRATCH_MNT
 
 echo 
 echo === copying scratch device to single target, large ro device
-/sbin/mkfs.xfs -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
+${MKFS_PROG}.xfs -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
 rmdir $imgs.source_dir 2>/dev/null
 mkdir $imgs.source_dir
 
diff --git a/common.rc b/common.rc
index 35f782b..a356c02 100644
--- a/common.rc
+++ b/common.rc
@@ -314,7 +314,7 @@ _scratch_mkfs()
         $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
 	;;
     *)
-	/sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
+	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
     esac
 }
@@ -333,7 +333,7 @@ _scratch_mkfs_sized()
 	_scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
 	;;
     ext2|ext3|ext4|ext4dev)
-	/sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+	yes | ${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
 	;;
     btrfs)
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
-- 
1.7.4.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2011-09-03  8:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03  8:32 Prasad Joshi [this message]
2011-09-03  8:32 ` [PATCH] Assume yes when test device is not partitioned Prasad Joshi
2011-09-03 17:14 ` Christoph Hellwig
2011-09-03 17:14   ` Christoph Hellwig
2011-09-03 17:52 ` Ted Ts'o
2011-09-03 17:52   ` Ted Ts'o

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=1315038723-2009-1-git-send-email-prasadjoshi.linux@gmail.com \
    --to=prasadjoshi.linux@gmail.com \
    --cc=chaitanyakulkarni15@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.