contrib/dracut: fix syntax error in module-setup.sh

The dracut/02zfsexpandknowledge/module-setup.sh.in has a syntax error
which makes the script unusable by a POSIX compliant shell like Dash
on Debian based systems.

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Aron Xu <happyaron.xu@gmail.com>
Closes #5712
This commit is contained in:
Aron Xu 2017-02-01 06:25:49 +08:00 committed by Brian Behlendorf
parent b81a3ddc32
commit 3d91261599

View File

@ -22,6 +22,7 @@ get_pool_devices() {
poolconfigoutput=$(cat "$poolconfigtemp")
dinfo "zfsexpandknowledge: pool $1 cannot be listed: $poolconfigoutput"
else
cat "$poolconfigtemp" | awk -F '\t' '/\t\/dev/ { print $2 }' | \
while read pooldev ; do
if [ -n "$pooldev" -a -e "$pooldev" ] ; then
if [ -h "$pooldev" ] ; then
@ -32,7 +33,7 @@ get_pool_devices() {
dinfo "zfsexpandknowledge: pool $1 has device $pooldev (which resolves to $resolved)"
echo "$resolved"
fi
done < <(cat "$poolconfigtemp" | awk -F '\t' '/\t\/dev/ { print $2 }')
done
fi
rm -f "$poolconfigtemp"
}