Update to use the zpool-create.sh script
This commit is contained in:
parent
7c98f76d30
commit
0289edb7e6
|
@ -90,23 +90,6 @@ print_stats() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_config() {
|
|
||||||
|
|
||||||
if [ ! -f ${ZPOOL_CONFIG} ]; then
|
|
||||||
local NAME=`basename ${ZPOOL_CONFIG} .cfg`
|
|
||||||
ERROR="Unknown config '${NAME}', available configs are:\n"
|
|
||||||
|
|
||||||
for CFG in `ls ${TOPDIR}/scripts/zpool-config/`; do
|
|
||||||
local NAME=`basename ${CFG} .cfg`
|
|
||||||
ERROR="${ERROR}${NAME}\n"
|
|
||||||
done
|
|
||||||
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
check_test() {
|
check_test() {
|
||||||
|
|
||||||
if [ ! -f ${ZPIOS_TEST} ]; then
|
if [ ! -f ${ZPIOS_TEST} ]; then
|
||||||
|
@ -141,7 +124,7 @@ while getopts 'hvpc:t:' OPTION; do
|
||||||
PROFILE=1
|
PROFILE=1
|
||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
ZPOOL_CONFIG=${TOPDIR}/scripts/zpool-config/${OPTARG}.cfg
|
ZPOOL_CONFIG=${OPTARG}
|
||||||
;;
|
;;
|
||||||
t)
|
t)
|
||||||
ZPIOS_TEST=${TOPDIR}/scripts/zpios-test/${OPTARG}.cfg
|
ZPIOS_TEST=${TOPDIR}/scripts/zpios-test/${OPTARG}.cfg
|
||||||
|
@ -157,8 +140,7 @@ if [ $(id -u) != 0 ]; then
|
||||||
die "Must run as root"
|
die "Must run as root"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate your using a known config and test
|
# Validate your using a known test
|
||||||
check_config || die "${ERROR}"
|
|
||||||
check_test || die "${ERROR}"
|
check_test || die "${ERROR}"
|
||||||
|
|
||||||
# Pull in the zpios test module is not loaded. If this fails it is
|
# Pull in the zpios test module is not loaded. If this fails it is
|
||||||
|
@ -175,8 +157,8 @@ if [ ${VERBOSE} ]; then
|
||||||
print_zfs_info
|
print_zfs_info
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Source the zpool configuration
|
# Create the zpool configuration
|
||||||
. ${ZPOOL_CONFIG}
|
./zpool-create.sh -c ${ZPOOL_CONFIG} || exit 1
|
||||||
|
|
||||||
msg "${CMDDIR}/zpool/zpool status zpios"
|
msg "${CMDDIR}/zpool/zpool status zpios"
|
||||||
${CMDDIR}/zpool/zpool status zpios || exit 1
|
${CMDDIR}/zpool/zpool status zpios || exit 1
|
||||||
|
|
Loading…
Reference in New Issue