zfs-functions: skip lines where mntpnt is 'none'

This fixes zfs-mount initscript trying to mount swap volumes
as filesystems or anything that has 'none' as a mountpoint
in /etc/fstab.  Additionally, fixes trying to mount swap volumes
as a filesystem on RHEL.  RHEL defines mountpoint for swap
as `swap`.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Georgy Yakovlev <ya@sysdump.net>
Closes #7346
Closes #7347
This commit is contained in:
Georgy Yakovlev 2018-03-30 11:05:24 -08:00 committed by Brian Behlendorf
parent 5e00213e43
commit 2f291ebaed

View File

@ -393,6 +393,8 @@ read_fstab()
i=0
while read -r fs mntpnt fstype opts; do
echo "$fs" | egrep -qE '^#|^$' && continue
echo "$mntpnt" | egrep -qE '^none|^swap' && continue
echo "$fstype" | egrep -qE '^swap' && continue
if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
eval export FSTAB_dev_$i="$fs"