Catch return errors from zpool commands
authorZachary Bedell <zac@thebedells.org>
Sun, 24 Jul 2011 20:53:15 +0000 (16:53 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 25 Jul 2011 17:43:44 +0000 (10:43 -0700)
commita4719e54e8628564ffda33cffee59812b61f273b
treeee591dd43648ca9cee98e1f676a6883e2b474af0
parent1ef5e8296a07a0d208d0663ae966c8b0206f7e6a
Catch return errors from zpool commands

This fixes a bug that can effect first reboot after install
using Dracut.  The Dracut module didn't check the return
value from several calls to z* functions.  This resulted in
"Using no pools available as root" on boot if the ZFS module
didn't auto-import the pools.  It's most likely to happen on
initial restart after a fresh install & requires juggling in
the Dracut emergency holographic shell to fix.

This patch checks return codes & output from zpool list and
related functions and correctly falls into the explicit zpool
import code branch if the module didn't import the pool at load.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
dracut/90zfs/mount-zfs.sh