Ubuntu

Grub2 menu doesn't list entries with foreign characters

Reported by Yves Lavoie on 2009-07-29
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: grub2

Description: Ubuntu karmic (development branch)
Release: 9.10

grub-pc:
  Installed: 1.96+20090611-1ubuntu4
  Candidate: 1.96+20090611-1ubuntu4
  Version table:
 *** 1.96+20090611-1ubuntu4 0
        500 http://archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

  Grub2 menu won't display entries with foreign characters. The entry is accounted for and the previous entry is displayed instead.

  I suggest that grub_isprint and grub_isalpha be corrected to include accented characters. UTF and multibyte characters will definetely be a challenge but ISO8859-* should be feasible.

Felix Zielcke (fzielcke) wrote :

I can't reproduce this with current Debian sid version.
Maybe the parser bug fixes fixed that too.
Even with ascii.pf2 instead of unicode.pf2 they still get shown but of course with ? instead of the character.

On 09-07-29 05:03 PM, Felix Zielcke wrote:
> I can't reproduce this with current Debian sid version.
> Maybe the parser bug fixes fixed that too.
> Even with ascii.pf2 instead of unicode.pf2 they still get shown but of course with ? instead of the character.
>
Current code in kernel/misc.c ( grub_alpha and grub_isprint) explicitly
forbid ASCII codes greater than '~'. Thus, entry shouldn't be recognized.
Am I right?

Here is the relevant grub.cfg. Last entry is never shown. It is supposed
to be "Microsoft Windows XP Édition familiale (on /dev/hda4)" and is
pulled in by update-grub.
====================================================
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=saved
set timeout=5
set root=(hd0,5)
search --no-floppy --fs-uuid --set 1ce6cdc3-9b2b-442c-a211-524ee530f607
if loadfont /share/grub/ascii.pf2 ; then
   set gfxmode=640x480
   insmod gfxterm
   insmod vbe
   if terminal_output gfxterm ; then true ; else
     # For backward compatibility with versions of terminal.mod that don't
     # understand terminal_output
     terminal gfxterm
   fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set root=(hd0,6)
search --no-floppy --fs-uuid --set 36aa4a22-2385-4df3-9ca6-ca9c8c720574
insmod png
if background_image /boot/grub/moreblue-orbit-grub.png ; then
   set color_normal=black/black
   set color_highlight=magenta/black
else
   set menu_color_normal=cyan/blue
   set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-rc4 (recovery mode)" {
     set root=(hd0,6)
     search --no-floppy --fs-uuid --set 36aa4a22-2385-4df3-9ca6-ca9c8c720574
     linux /boot/vmlinuz-2.6.31-rc2 root=/dev/hda6 ro single
/dev/hda7 resume=/dev/hda7
}
menuentry "Ubuntu, Linux 2.6.30" {
     set root=(hd0,6)
     search --no-floppy --fs-uuid --set 36aa4a22-2385-4df3-9ca6-ca9c8c720574
     linux /boot/vmlinuz-2.6.30 root=/dev/hda6 ro /dev/hda7
resume=/dev/hda7 quiet splash
}
menuentry "Ubuntu, Linux 2.6.29" {
     set root=(hd0,6)
     search --no-floppy --fs-uuid --set 36aa4a22-2385-4df3-9ca6-ca9c8c720574
     linux /boot/vmlinuz-2.6.29 root=/dev/hda6 ro /dev/hda7
resume=/dev/hda7 quiet splash
}
menuentry "Ubuntu, Linux 2.6.28" {
     set root=(hd0,6)
     search --no-floppy --fs-uuid --set 36aa4a22-2385-4df3-9ca6-ca9c8c720574
     linux /boot/vmlinuz-2.6.28 root=/dev/hda6 ro /dev/hda7
resume=/dev/hda7 quiet splash
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP dition familiale (on /dev/hda4)" {
     set root=(hd0,4)
     search --no-floppy --fs-uuid --set 753ff7ca669f0ede
     drivemap -s (hd0) ${root}
     chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file is an example on how to add custom entries
### END /etc/grub.d/40_custom ###
=================================================

Felix Zielcke (fzielcke) wrote :

Am Mittwoch, den 29.07.2009, 21:28 +0000 schrieb Yves Lavoie:
> On 09-07-29 05:03 PM, Felix Zielcke wrote:
> > I can't reproduce this with current Debian sid version.
> > Maybe the parser bug fixes fixed that too.
> > Even with ascii.pf2 instead of unicode.pf2 they still get shown but of course with ? instead of the character.
> >
> Current code in kernel/misc.c ( grub_alpha and grub_isprint) explicitly
> forbid ASCII codes greater than '~'. Thus, entry shouldn't be recognized.
> Am I right?
>

They're not used for printing the menu.
I'm not familiar with the menu and graphical subsystem but
`rgrep grub_alpha normal/' doestn't show anything
and `rgrep grub_isprintf normal/' only shows normal/cmdline.c
(grub_cmdline_get) and normal/menu_entry.c (grub_menu_entry_run)
and the command above that function says:
/* Edit a menu entry with an Emacs-like interface. */

normal/menu_text.c (print_entry) has this:
  len = grub_utf8_to_ucs4 (unicode_title, title_len,
                           (grub_uint8_t *) title, -1, 0);

So UTF8 should be supported as long as unicode.pf2 of course is used.
Maybe your grub.cfg has wrong encoding?

--
Felix Zielcke
Proud Debian Maintainer

Yves Lavoie (yves-lavoie-ing) wrote :

On 09-07-29 05:48 PM, Felix Zielcke wrote:
> So UTF8 should be supported as long as unicode.pf2 of course is used.
> Maybe your grub.cfg has wrong encoding
Shame on me for nor reading the fine manual. After digging on the net, I
found the article on fonts (http://grub.enbug.org/gfxterm) and will
correct my setup.
A note in /usr/share/doc/grub-pc would have been helpful though. I
installed grub through apt-get many years ago and one day, after a bunch
of upgrade, the Window entry stop showing on reboots.

Thanks for your kind help,

Yves

Felix Zielcke (fzielcke) wrote :

Am Mittwoch, den 29.07.2009, 23:26 +0000 schrieb Yves Lavoie:
> On 09-07-29 05:48 PM, Felix Zielcke wrote:
> > So UTF8 should be supported as long as unicode.pf2 of course is used.
> > Maybe your grub.cfg has wrong encoding
> Shame on me for nor reading the fine manual. After digging on the net, I
> found the article on fonts (http://grub.enbug.org/gfxterm) and will
> correct my setup.
> A note in /usr/share/doc/grub-pc would have been helpful though. I
> installed grub through apt-get many years ago and one day, after a bunch
> of upgrade, the Window entry stop showing on reboots.
>
> Thanks for your kind help,
>
> Yves
>

I just put your special char in grub.cfg in a menuentry and even with
ascii.pf2 it gets shown just with 4 ?
I tried now even the karmic version and it gets shown.
So the only thing that I can think of why this happens is that grub.cfg
isn't valid UTF-8.

--
Felix Zielcke
Proud Debian Maintainer

Colin Watson (cjwatson) wrote :

When we're extracting the operating system name from Windows, we typically don't have any clear idea what its encoding is, so it's indeed quite common for os-prober not to produce UTF-8 output. In this case it's probably ISO-8859-1 or something.

Anton¡o Sch¡fano (skiantoz) wrote :

I have the same problem. The entries with non-ASCII characters are not displayed, an empty line is displayed instead.
Although not visible, the empty line is selectable with the cursor keys + enter and will bring up the corresponding OS.

Anton¡o Sch¡fano (skiantoz) wrote :

For me the problem is solved with the latest version, it uses a generic "Windows NT/2000/XP" description now.

grub-pc:
  Installed: 1.97~beta4-1ubuntu2
  Candidate: 1.97~beta4-1ubuntu2
  Version table:
 *** 1.97~beta4-1ubuntu2 0
        500 http://archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Is this still a problem in a supported release (10.04 onwards)?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers