summaryrefslogtreecommitdiffstats
path: root/scripts/zpool-create.sh
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-07-22 14:43:22 -0700
committerBrian Behlendorf <[email protected]>2014-07-25 11:58:31 -0700
commit093219a6b333d9e04dde3cbb282d262016ad5ef6 (patch)
treed91c6a8ddd3cfa950b7ea3c6e23cc56e04885d57 /scripts/zpool-create.sh
parent1139491da702a160a2ea927d1d737a2cb45e51e8 (diff)
zpool-create.sh: allow features to be disabled
The zimport.sh script makes use of the zpool-create.sh script to construct test pools for importing with older versions of ZoL. It is desirable to have a way to disable all the features so new pools can be imported with older code. The simplest and most flexible way to achieve this was to merge the VERBOSE_FLAG and FORCE_FLAG in to a single ZPOOL_FLAGS variable. The contents of this variable will be used in the 'zpool create' allowing us to easily pass arbitrary flags. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Prakash Surya <[email protected]> Closes #2524
Diffstat (limited to 'scripts/zpool-create.sh')
-rwxr-xr-xscripts/zpool-create.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/zpool-create.sh b/scripts/zpool-create.sh
index d6b301e32..16ee67146 100755
--- a/scripts/zpool-create.sh
+++ b/scripts/zpool-create.sh
@@ -14,7 +14,7 @@ PROG=zpool-create.sh
usage() {
cat << EOF
USAGE:
-$0 [hvcp]
+$0 [hvfxcp]
DESCRIPTION:
Create one of several predefined zpool configurations.
@@ -23,6 +23,7 @@ OPTIONS:
-h Show this message
-v Verbose
-f Force everything
+ -x Disable all zpool features
-c Configuration for zpool
-p Name for zpool
-d Destroy zpool (default create)
@@ -52,10 +53,11 @@ check_config() {
ZPOOL_CONFIG=unknown
ZPOOL_NAME=tank
ZPOOL_DESTROY=
+ZPOOL_FLAGS=${ZPOOL_FLAGS:-""}
ZPOOL_OPTIONS=""
ZFS_OPTIONS=""
-while getopts 'hvfc:p:dl:s:' OPTION; do
+while getopts 'hvfxc:p:dl:s:' OPTION; do
case $OPTION in
h)
usage
@@ -67,7 +69,11 @@ while getopts 'hvfc:p:dl:s:' OPTION; do
;;
f)
FORCE=1
- FORCE_FLAG="-f"
+ ZPOOL_FLAGS="$ZPOOL_FLAGS -f"
+ ;;
+ x)
+ NO_FEATURES=1
+ ZPOOL_FLAGS="$ZPOOL_FLAGS -d"
;;
c)
ZPOOL_CONFIG=${ZPOOLDIR}/${OPTARG}.sh