]> granicus.if.org Git - zfs/commitdiff
contrib/dracut: fix syntax error in module-setup.sh
authorAron Xu <happyaron@users.noreply.github.com>
Tue, 31 Jan 2017 22:25:49 +0000 (06:25 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Jan 2017 22:25:49 +0000 (14:25 -0800)
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

contrib/dracut/02zfsexpandknowledge/module-setup.sh.in

index e694ae0d02a931ec52f903c31ba8a862e0fa13c2..981beb301725ef49f437e3e04b6d41a247919884 100755 (executable)
@@ -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"
 }