Merge commit 'refs/top-bases/linux-have-uio-rw' into linux-have-uio-rw

This commit is contained in:
Brian Behlendorf 2009-02-06 15:01:48 -08:00
commit eb5e5a572f
1 changed files with 29 additions and 3 deletions

View File

@ -16,7 +16,9 @@ OPTIONS:
-v Verbose -v Verbose
-c Configuration for zpool -c Configuration for zpool
-p Name for zpool -p Name for zpool
-d Destroy zpool (default create) -d Destroy zpool (default create)
-l Additional zpool options
-s Additional zfs options
EOF EOF
} }
@ -41,8 +43,10 @@ check_config() {
ZPOOL_CONFIG=zpool_config.sh ZPOOL_CONFIG=zpool_config.sh
ZPOOL_NAME=tank ZPOOL_NAME=tank
ZPOOL_DESTROY= ZPOOL_DESTROY=
ZPOOL_OPTIONS=""
ZFS_OPTIONS=""
while getopts 'hvc:p:d' OPTION; do while getopts 'hvc:p:dl:s:' OPTION; do
case $OPTION in case $OPTION in
h) h)
usage usage
@ -60,9 +64,15 @@ while getopts 'hvc:p:d' OPTION; do
d) d)
ZPOOL_DESTROY=1 ZPOOL_DESTROY=1
;; ;;
l)
ZPOOL_OPTIONS=${OPTARG}
;;
s)
ZFS_OPTIONS=${OPTARG}
;;
?) ?)
usage usage
exit exit 1
;; ;;
esac esac
done done
@ -79,6 +89,22 @@ if [ ${ZPOOL_DESTROY} ]; then
else else
zpool_create zpool_create
if [ "${ZPOOL_OPTIONS}" ]; then
if [ ${VERBOSE} ]; then
echo
echo "${CMDDIR}/zpool/zpool ${ZPOOL_OPTIONS} ${ZPOOL_NAME}"
fi
${CMDDIR}/zpool/zpool ${ZPOOL_OPTIONS} ${ZPOOL_NAME} || exit 1
fi
if [ "${ZFS_OPTIONS}" ]; then
if [ ${VERBOSE} ]; then
echo
echo "${CMDDIR}/zfs/zfs ${ZFS_OPTIONS} ${ZPOOL_NAME}"
fi
${CMDDIR}/zfs/zfs ${ZFS_OPTIONS} ${ZPOOL_NAME} || exit 1
fi
if [ ${VERBOSE} ]; then if [ ${VERBOSE} ]; then
echo echo
echo "zpool list" echo "zpool list"