[Bug 1176652] [NEW] 40grub2 gets confused for menuentry generated in other languages

keestux kees.bakker at xs4all.nl
Sun May 5 20:09:00 UTC 2013


Public bug reported:

The script in 40grub2 has some code to skip certain entries from
grub.cfg. It goes like this:

    elif echo "$title" | grep -q '(on /dev/[^)]*)$'; then
        log "Skipping entry '$title':"
       log "appears to be an automatic reference taken from another menu.lst"
       ignore_item=1

(( Notice the "on" ))

However, if the grub.cfg was created on a system with a non standard
LANG the grep does not find the match. This is particular nasty on a
system with one boot partition and a few Linux root partitions. The end
result of update-grub is a bigger grub.cfg after each run. It gets
bigger and bigger. Also update-grub takes longer and longer to finish.

Here is an example of a menuentry on my system

    menuentry 'Ubuntu 11.04 (11.04) (op /dev/mapper/vol1-root1004)'
--class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-
gnulinux-/vmlinuz-3.5.0-28-generic--29cff8d9-4fb2-49ec-
8c62-e13f2a961abd' {

Here is a session with running update-grub twice in a row.

root at rockie:~# echo $LANG
nl_NL.UTF-8
root at rockie:~# grep menuentry /boot/grub/grub.cfg|wc -l
34
root at rockie:~# update-grub
Aanmaken van 'grub.cfg'...
Linux-afbeelding is gevonden: /boot/vmlinuz-3.5.0-28-generic
Initrd-image gevonden: /boot/initrd.img-3.5.0-28-generic
Found memtest86+ image: /memtest86+.bin
Ubuntu 10.04.2 LTS (10.04) is gevonden op /dev/sda2
Ubuntu 11.04 (11.04) is gevonden op /dev/mapper/vol1-clayrootbackup
Ubuntu 10.04.1 LTS (10.04) is gevonden op /dev/mapper/vol1-root1004
voltooid
root at rockie:~# grep menuentry /boot/grub/grub.cfg|wc -l
88

** Affects: os-prober (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to os-prober in Ubuntu.
https://bugs.launchpad.net/bugs/1176652

Title:
  40grub2 gets confused for menuentry generated in other languages

Status in “os-prober” package in Ubuntu:
  New

Bug description:
  The script in 40grub2 has some code to skip certain entries from
  grub.cfg. It goes like this:

      elif echo "$title" | grep -q '(on /dev/[^)]*)$'; then
          log "Skipping entry '$title':"
         log "appears to be an automatic reference taken from another menu.lst"
         ignore_item=1

  (( Notice the "on" ))

  However, if the grub.cfg was created on a system with a non standard
  LANG the grep does not find the match. This is particular nasty on a
  system with one boot partition and a few Linux root partitions. The
  end result of update-grub is a bigger grub.cfg after each run. It gets
  bigger and bigger. Also update-grub takes longer and longer to finish.

  Here is an example of a menuentry on my system

      menuentry 'Ubuntu 11.04 (11.04) (op /dev/mapper/vol1-root1004)'
  --class gnu-linux --class gnu --class os $menuentry_id_option
  'osprober-gnulinux-/vmlinuz-3.5.0-28-generic--29cff8d9-4fb2-49ec-
  8c62-e13f2a961abd' {

  Here is a session with running update-grub twice in a row.

  root at rockie:~# echo $LANG
  nl_NL.UTF-8
  root at rockie:~# grep menuentry /boot/grub/grub.cfg|wc -l
  34
  root at rockie:~# update-grub
  Aanmaken van 'grub.cfg'...
  Linux-afbeelding is gevonden: /boot/vmlinuz-3.5.0-28-generic
  Initrd-image gevonden: /boot/initrd.img-3.5.0-28-generic
  Found memtest86+ image: /memtest86+.bin
  Ubuntu 10.04.2 LTS (10.04) is gevonden op /dev/sda2
  Ubuntu 11.04 (11.04) is gevonden op /dev/mapper/vol1-clayrootbackup
  Ubuntu 10.04.1 LTS (10.04) is gevonden op /dev/mapper/vol1-root1004
  voltooid
  root at rockie:~# grep menuentry /boot/grub/grub.cfg|wc -l
  88

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1176652/+subscriptions




More information about the foundations-bugs mailing list