Comment 2 for bug 1176652

Revision history for this message
Benno Schulenberg (bennoschulenberg) wrote : Re: 40grub2 gets confused for menuentry generated in other languages

Indeed, grub.cfg gets larger and larger with _every_ run of the script (all my systems are localized to Dutch, which uses "op" not "on"). Yesterday, booting on my old laptop had become so slow, that I finally looked into it. It resulted that grub.cfg had grown to *seventeen thousand* lines, with hundreds and hundreds of repetitions of "[name of distro] (op /dev/sda3) (op /dev/sda7) (op /dev/sda3) ...". The grub.cfg files on the other partitions looked similar -- whenever any of them gets a new kernel, it copies all menu and submenu items from the other grub.cfg files, which of course include its own items, plus older copies of those items, plus still older copies, plus... A horrendous tangle.

So, I would suggest to change:

  elif echo "$title" | grep -q '(on /dev/[^)]*)$'; then

to:

  elif echo "$title" | grep -q '(\w\+ /dev/\w\+)$'; then

to hopefully make it translation resistant.