From e883ecadcfbd2879e8a3b0fbb7027ac1d375a7ed Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 8 Jul 2014 23:54:30 +0100 Subject: Fix an infinite loop in grub-mkconfig * util/grub.d/10_hurd.in: Make kernel list progression not fail on kernels whose paths contain regex metacharacters. * util/grub.d/10_kfreebsd.in: Likewise. * util/grub.d/10_linux.in: Likewise. * util/grub.d/20_linux_xen.in: Likewise. Reported by: Heimo Stranner. Origin: upstream, http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=0901e7855f922e770cbfeb58262cb8fded518190 Last-Update: 2014-07-08 Patch-Name: mkconfig-kernels-infloop.patch --- util/grub.d/10_hurd.in | 2 +- util/grub.d/10_kfreebsd.in | 2 +- util/grub.d/10_linux.in | 2 +- util/grub.d/20_linux_xen.in | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 6fafe1a..4adf981 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -168,7 +168,7 @@ while [ "x$kernels" != "x" ] ; do hurd_entry "$kernel" advanced hurd_entry "$kernel" recovery - kernels=`echo $kernels | tr ' ' '\n' | grep -vx $kernel | tr '\n' ' '` + kernels=`echo $kernels | tr ' ' '\n' | fgrep -vx "$kernel" | tr '\n' ' '` done # If at least one kernel was found, then we need to diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in index 7b04a87..0af384c 100644 --- a/util/grub.d/10_kfreebsd.in +++ b/util/grub.d/10_kfreebsd.in @@ -228,7 +228,7 @@ while [ "x$list" != "x" ] ; do kfreebsd_entry "${OS}" "${version}" recovery "-s" fi - list=`echo $list | tr ' ' '\n' | grep -vx $kfreebsd | tr '\n' ' '` + list=`echo $list | tr ' ' '\n' | fgrep -vx "$kfreebsd" | tr '\n' ' '` done # If at least one kernel was found, then we need to diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 024a89e..79fa03a 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -344,7 +344,7 @@ while [ "x$list" != "x" ] ; do "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}" fi - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` + list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` done # If at least one kernel was found, then we need to diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 10a3db5..a5e5e50 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -260,12 +260,12 @@ while [ "x${xen_list}" != "x" ] ; do "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" fi - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` + list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` done if [ x"$is_top_level" != xtrue ]; then echo ' }' fi - xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '` + xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '` done # If at least one kernel was found, then we need to