diff options
author | Rudd-O <[email protected]> | 2016-10-16 03:30:53 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-10-15 20:30:53 -0700 |
commit | 7e8a2d0b755ea67291d3f576069706e43abc5e31 (patch) | |
tree | 34da0d6956d0a72c47652eaf51e77726959f86ff | |
parent | dabb6f4fab38f5a729e8241425a5394ae7fd96d4 (diff) |
Use -F to export pools so as not to dirty up device labels
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Manuel Amador (Rudd-O) <[email protected]>
Closes #5228
Closes #5238
-rwxr-xr-x | contrib/dracut/90zfs/export-zfs.sh.in | 15 | ||||
-rwxr-xr-x | contrib/dracut/90zfs/module-setup.sh.in | 2 | ||||
-rwxr-xr-x | contrib/dracut/90zfs/mount-zfs.sh.in | 2 | ||||
-rwxr-xr-x | contrib/dracut/90zfs/zfs-lib.sh.in | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/contrib/dracut/90zfs/export-zfs.sh.in b/contrib/dracut/90zfs/export-zfs.sh.in index 393753fbf..8747c1cbc 100755 --- a/contrib/dracut/90zfs/export-zfs.sh.in +++ b/contrib/dracut/90zfs/export-zfs.sh.in @@ -4,18 +4,19 @@ _do_zpool_export() { local ret=0 + local errs="" local final="${1}" - local opts="" - if [ "x${final}" != "x" ]; then - opts="-f" + info "ZFS: Exporting ZFS storage pools..." + errs=$(export_all -F 2>&1) + ret=$? + [ -z "${errs}" ] || echo "${errs}" | vwarn + if [ "x${ret}" != "x0" ]; then + info "ZFS: There was a problem exporting pools." fi - info "Exporting ZFS storage pools." - export_all ${opts} || ret=$? - if [ "x${final}" != "x" ]; then - info "zpool list" + info "ZFS: pool list" zpool list 2>&1 | vinfo fi diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in index 9c88b3245..240847a77 100755 --- a/contrib/dracut/90zfs/module-setup.sh.in +++ b/contrib/dracut/90zfs/module-setup.sh.in @@ -58,7 +58,7 @@ install() { inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator fi inst_hook mount 98 "${moddir}/mount-zfs.sh" - inst_hook shutdown 30 "${moddir}/export-zfs.sh" + inst_hook shutdown 20 "${moddir}/export-zfs.sh" inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh" if [ -e @sysconfdir@/zfs/zpool.cache ]; then diff --git a/contrib/dracut/90zfs/mount-zfs.sh.in b/contrib/dracut/90zfs/mount-zfs.sh.in index 3b6be314c..db5ccddf2 100755 --- a/contrib/dracut/90zfs/mount-zfs.sh.in +++ b/contrib/dracut/90zfs/mount-zfs.sh.in @@ -44,7 +44,7 @@ if [ "${root}" = "zfs:AUTO" ] ; then ZFS_DATASET="$(find_bootfs)" if [ $? -ne 0 ] ; then warn "ZFS: No bootfs attribute found in importable pools." - export_all || export_all "-f" + export_all -F rootok=0 return 1 diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in index c822ddb9d..c988dfe60 100755 --- a/contrib/dracut/90zfs/zfs-lib.sh.in +++ b/contrib/dracut/90zfs/zfs-lib.sh.in @@ -90,7 +90,7 @@ mount_dataset() { # export_all OPTS # exports all imported zfs pools. export_all() { - local opts="${1}" + local opts="${@}" local ret=0 IFS="${NEWLINE}" |