From 0901e7855f922e770cbfeb58262cb8fded518190 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 8 Jul 2014 23:54:30 +0100 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ 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 ++-- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5109c5a61..ccd8ac1f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-07-08 Colin Watson + + * 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. + 2014-06-26 Colin Watson * docs/grub-dev.texi (Finding your way around): The build system no diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 82dfe193f..29b455423 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 a524762fc..ba7175bd7 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 00d193159..d2e2a8fd3 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -241,7 +241,7 @@ while [ "x$list" != "x" ] ; do "single ${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 a60843500..2e777584c 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -255,12 +255,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