--- grub-2.00/util/grub.d/10_linux.in.orig	2014-03-25 15:48:02.553172947 -0400
+++ grub-2.00/util/grub.d/10_linux.in	2014-03-25 15:50:34.747467953 -0400
@@ -108,8 +108,8 @@
   # FIXME: We need an interface to select vesafb in case efifb can't be used.
   if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
       echo "	load_video" | sed "s/^/$submenu_indentation/"
-      if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
-	  && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
+      if grep -qE "^CONFIG_FB_EFI=y$" "${config}" 2> /dev/null \
+	  && grep -qE "^CONFIG_VT_HW_CONSOLE_BINDING=y$" "${config}" 2> /dev/null; then
 	  echo "	set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
       fi
   else
@@ -246,7 +246,7 @@
                 "single ${GRUB_CMDLINE_LINUX}"
   fi
 
-  list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+  list=`echo $list | tr ' ' '\n' | grep -vE "^$linux$" | tr '\n' ' '`
   is_first_entry=false
 done
 
--- grub-2.00/util/grub.d/20_linux_xen.in.orig	2014-03-25 15:48:02.554172923 -0400
+++ grub-2.00/util/grub.d/20_linux_xen.in	2014-03-25 15:51:02.884782756 -0400
@@ -150,7 +150,7 @@
 		break
 	    fi
 	done
-        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
+        if (grep -qE "^CONFIG_XEN_DOM0=y$" "${config}" 2> /dev/null || grep -qE "^CONFIG_XEN_PRIVILEGED_GUEST=y$" "${config}" 2> /dev/null); then echo -n "$i " ; fi
     fi
     done`
 if [ "x${linux_list}" = "x" ] ; then
@@ -254,12 +254,12 @@
 		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
 	fi
 
-	list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+	list=`echo $list | tr ' ' '\n' | grep -vE "^$linux$" | tr '\n' ' '`
     done
     if [ x"$is_first_entry" != xtrue ]; then
 	echo '	}'
     fi
-    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
+    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vE "^$current_xen$" | tr '\n' ' '`
 done
 
 # If at least one kernel was found, then we need to
--- grub-2.00/util/grub.d/10_kfreebsd.in.orig	2014-03-25 15:48:02.555172899 -0400
+++ grub-2.00/util/grub.d/10_kfreebsd.in	2014-03-25 15:51:09.795614454 -0400
@@ -227,7 +227,7 @@
     kfreebsd_entry "${OS}" "${version}" recovery "-s"
   fi
 
-  list=`echo $list | tr ' ' '\n' | grep -vx $kfreebsd | tr '\n' ' '`
+  list=`echo $list | tr ' ' '\n' | grep -vE "^$kfreebsd$" | tr '\n' ' '`
   is_first_entry=false
 done
 
--- grub-2.00/util/grub-install.in.orig	2014-03-25 15:48:02.556172875 -0400
+++ grub-2.00/util/grub-install.in	2014-03-25 15:51:19.116387455 -0400
@@ -629,7 +629,7 @@
 
 if [ "x${devabstraction_module}" = "x" ] ; then
     if [ x"${install_device}" != x ]; then
-      if echo "${install_device}" | grep -qx "(.*)" ; then
+      if echo "${install_device}" | grep -qE "^(.*)$" ; then
         install_drive="${install_device}"
       else
         install_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${install_device}"`" || exit 1
--- grub-2.00/util/grub-mkconfig_lib.in.orig	2014-03-25 15:48:02.558172826 -0400
+++ grub-2.00/util/grub-mkconfig_lib.in	2014-03-25 15:51:31.131094837 -0400
@@ -220,7 +220,7 @@
     version_test_numeric_a="$version_test_numeric_b"
     version_test_numeric_b="$version_test_numeric_c"
   fi
-  if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
+  if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qE "^$version_test_numeric_b$" ; then
     return 0
   else
     return 1
