Updating init scripts to have more robust grepping

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
This commit is contained in:
Matthew Thode 2013-11-06 16:56:50 -06:00 committed by Brian Behlendorf
parent fd4f76160c
commit 760ec997df
5 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@ export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
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

View File

@ -5,7 +5,7 @@
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()

View File

@ -38,7 +38,7 @@ ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
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()

View File

@ -16,7 +16,7 @@ ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
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

View File

@ -27,7 +27,7 @@ export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
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