Skip to content

Commit

Permalink
contrib/dracut: zfs-lib: export_all: replace with inline zpool export -a
Browse files Browse the repository at this point in the history
07a3312, which introduced this in
October of 2014, didn't have zpool export -a available; we do

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13093
  • Loading branch information
nabijaczleweli authored and andrewc12 committed Sep 23, 2022
1 parent 009dd06 commit 77757e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
4 changes: 1 addition & 3 deletions contrib/dracut/90zfs/export-zfs.sh.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/sh

. /lib/dracut-zfs-lib.sh

_do_zpool_export() {
info "ZFS: Exporting ZFS storage pools..."
errs=$(export_all -F 2>&1)
errs=$(zpool export -aF 2>&1)
ret=$?
echo "${errs}" | vwarn
if [ "${ret}" -ne 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion contrib/dracut/90zfs/mount-zfs.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [ "${root}" = "zfs:AUTO" ] ; then
zpool import -N -a ${ZPOOL_IMPORT_OPTS}
if ! ZFS_DATASET="$(find_bootfs)" ; then
warn "ZFS: No bootfs attribute found in importable pools."
export_all -F
zpool export -aF

rootok=0
return 1
Expand Down
16 changes: 0 additions & 16 deletions contrib/dracut/90zfs/zfs-lib.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,6 @@ for_relevant_root_children() {
)
}

# export_all OPTS
# exports all imported zfs pools.
export_all() {
ret=0

IFS="${NEWLINE}"
for pool in $(zpool list -H -o name) ; do
if zpool list -H "${pool}" > /dev/null 2>&1; then
zpool export "${pool}" "$@" || ret=$?
fi
done
IFS="${OLDIFS}"

return "${ret}"
}

# ask_for_password
#
# Wraps around plymouth ask-for-password and adds fallback to tty password ask
Expand Down

0 comments on commit 77757e5

Please sign in to comment.