The previous pattern could accidentally match on things like
'real_root=ZFS=node02-zp00/ROOT/rootfs' due to the 'ZFS=no'
substring.
Signed-off-by: Matthew Thode <mthode@mthode.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1837
if [ -z "$init" ]; then
# Not interactive
- grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
+ grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi
# Source function library & LSB routines
if [ -z "$init" ]; then
# Not interactive
- grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
+ grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi
depend()
if [ -z "$init" ]; then
# Not interactive
- grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
+ grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi
start()
if [ -z "$init" ]; then
# Not interactive
- grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
+ grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi
case $1 in
if [ -z "$init" ]; then
# Not interactive
- grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
+ grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi
# Source function library & LSB routines