From 9991894b2106b068ac8b4c066f7bbc277113b75b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 20 Jan 2009 21:34:09 -0800 Subject: [PATCH 1/2] Minor script fix --- scripts/zpios.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/zpios.sh b/scripts/zpios.sh index 5ba97b0a68..bfce363a81 100755 --- a/scripts/zpios.sh +++ b/scripts/zpios.sh @@ -158,6 +158,7 @@ if check_modules; then fi fi +# Wait for device creation while [ ! -c /dev/zpios ]; do sleep 1 done @@ -181,12 +182,18 @@ echo date zpios_start zpios_stop -print_stats + +if [ ${VERBOSE} ]; then + print_stats +fi # Destroy the zpool configuration ./zpool-create.sh ${VERBOSE_FLAG} -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} -d || exit 1 -# Unload the test module stack +# Unload the test module stack and wait for device removal unload_modules +while [ -c /dev/zpios ]; do + sleep 1 +done exit 0 From 39fe5b1cf9406a83e2eb2f892363edc32d40494b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 20 Jan 2009 21:34:29 -0800 Subject: [PATCH 2/2] Minor script fixes --- scripts/zpool-config/file-raidz.sh | 4 ++-- scripts/zpool-config/file-raidz2.sh | 4 ++-- scripts/zpool-config/lo-raid0.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/zpool-config/file-raidz.sh b/scripts/zpool-config/file-raidz.sh index 6867489079..e7e4a46358 100644 --- a/scripts/zpool-config/file-raidz.sh +++ b/scripts/zpool-config/file-raidz.sh @@ -16,8 +16,8 @@ zpool_create() { die "Error $? creating ${FILE}" done - msg ${CMDDIR}/zpool/zpool create raidz ${ZPOOL_NAME} ${FILES} - ${CMDDIR}/zpool/zpool create raidz ${ZPOOL_NAME} ${FILES} || exit 1 + msg ${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} raidz ${FILES} + ${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} raidz ${FILES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/file-raidz2.sh b/scripts/zpool-config/file-raidz2.sh index 09b20e4c9c..1dd97d3eea 100644 --- a/scripts/zpool-config/file-raidz2.sh +++ b/scripts/zpool-config/file-raidz2.sh @@ -16,8 +16,8 @@ zpool_create() { die "Error $? creating ${FILE}" done - msg ${CMDDIR}/zpool/zpool create raidz2 ${ZPOOL_NAME} ${FILES} - ${CMDDIR}/zpool/zpool create raidz2 ${ZPOOL_NAME} ${FILES} || exit 1 + msg ${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} raidz2 ${FILES} + ${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} raidz2 ${FILES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/lo-raid0.sh b/scripts/zpool-config/lo-raid0.sh index cecdf86502..84c355266c 100644 --- a/scripts/zpool-config/lo-raid0.sh +++ b/scripts/zpool-config/lo-raid0.sh @@ -14,7 +14,7 @@ zpool_create() { DEVICE=`/sbin/losetup -f` msg "Creating ${FILE} using loopback device ${DEVICE}" rm -f ${FILE} || exit 1 - dd if=/dev/zero of=${FILE} bs=1024k count=256 status=noxfer &>/dev/null || + dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null || die "Error $? creating ${FILE}" losetup ${DEVICE} ${FILE} || die "Error $? creating ${FILE} -> ${DEVICE} loopback" @@ -30,7 +30,7 @@ zpool_destroy() { ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME} for FILE in ${FILES}; do - DEVICE=`/sbin/losetup -a | grep ${FILE} | head -n1 | cut -f1 -d:` + DEVICE=`/sbin/losetup -a | grep ${FILE} | head -n1|cut -f1 -d:` msg "Removing ${FILE} using loopback device ${DEVICE}" losetup -d ${DEVICE} || die "Error $? destroying ${FILE} -> ${DEVICE} loopback"