[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: grub-mkconfig loop

[For the future, it's generally better to file bug reports about this
kind of thing.  As luck would have it I manage to read -devel
occasionally ...]

On Tue, Jul 08, 2014 at 02:21:12PM +0200, Heimo Stranner wrote:
> I use a self compiled linux kernel (make-kpkg) with a somewhat unusual
> name (/boot/vmlinuz-3.15.4+ and /boot/initrd.img-3.15.4+) on debian sid.
> It worked previously (sadly I can't be more precise here) but today
> update-grub ran into a loop where my custom kernel was detected by
> /etc/grub.d/10_linux over and over again.
> The variable $list contained the correctly detected installed kernels
> but my kernel would not be removed from $list at the end of the big
> while loop in the line with "list=`echo $list | tr ' ' '\n' | grep -vx
> $linux | tr '\n' ' '` . (line 349 for me)
> Therefore $linux in the next round of this big while loop would be my
> custom kernel again and again.
> For me changing the line to "list=`echo $list | tr ' ' '\n' | grep -v
> $linux | tr '\n' ' '` fixed the problem.
> Is there any reason the x option was used in the first place or $linux
> was not put in quotes? Is my fix a bad idea for some reason?

Thanks for your report.  Dropping -x isn't quite the right answer.  The
bug is that using grep for this interprets regular expression
metacharacters in the path.  Using fgrep instead fixes this (and quoting
is of course a good idea too; the whole loop could probably use a
rewrite IMO, but this will do for now).  I've fixed this upstream:


... and cherry-picked it into the Debian packaging for my next upload:


Colin Watson                                       [cjwatson@debian.org]

Reply to: