[Bug 615769] Re: fonts should be installed to /boot/grub
KEYofR
brian at aljex.com
Wed Sep 26 21:14:46 UTC 2012
Previously the best work-around I found was creating a file
/boot/grub/custom.cfg with this in it:
[CODE]
# Manually re-load gfxterm
# update-grub generates a grub.cfg that thinks grub can see the SD card reader
# (where "/" lives) at boot time to get the font for gfxterm from /usr/share/...
# So we do manually here what update-grub fails to do automatically in grub.cfg
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 12E2D580E2D5688D
if loadfont /linux_boot/grub/fonts/unicode.pf2 ; then
set locale_dir=($root)/linux_boot/grub/locale
set lang=en_US
set gfxmode=1600x768x16
set gfxterm_font=unicode
load_video
insmod gfxterm
insmod gettext
insmod png
terminal_output gfxterm
background_image /linux_boot/grub/VaioP_Green.png
fi
[/CODE]
That's arcane and full of ugly hard-coded stuff that will break and update-grub will not update when the underlying details change.
That root= and uuid point to the windows ntfs partition C: drive on the main pata drive.
The path /linux_boot is a directory C:\linux_boot on that ntfs filesystem.
(/boot is symlinked to /windows/linux_boot. Remember / is not visible to grub at boot time.)
This works, but I finally found instead of all that junk you don't need
any custom.cfg at all unless you need it for other stuff.
Recent versions of grub2 copy unicode.pf2 to /boot/grub/fonts.
As long as that's there, then all you need to do is one time run this:
grub-editenv - set feature_default_font_path=y
Now update-grub still produces a grub.cfg that points to /usr/share , but now this part gets invoked instead of the part that tries to use the unreachable path:
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
You only have to run it once and subsequent update-grub doesn't break
it.
As far as I'm concerned this is almost as good as a variable in
/etc/default/grub. It's main problem is it's unfindable in any
documentation. But it satisfies my request above for "a way to tell it
not to try to use /" .
There does seem to be an undocumented variable GRUB_FONT that you can
put in /etc/default/grub, but I couldn't figure out how to make it work.
No matter what I put in there, it would just break update-grub.
root at noexcuse:~# update-grub
Generating grub.cfg ...
/usr/sbin/grub-probe: error: failed to get canonical path of unicode.pf2.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for . Check your device.map.
root at noexcuse:~#
unicode
unicode.pf2
fonts/unicode.pf2
grub/fonts/unicode.pf2
/linux_boot/grub/fonts/unicode.pf2
/boot/grub/fonts/unicode.pf2
all failed the same way
And pinfo grub does not say anything about it. It didn't say anything
about feature_default_font_path either, I found that by reading the
scripts and the generated grub.cfg and GUESSING.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubiquity in Ubuntu.
https://bugs.launchpad.net/bugs/615769
Title:
fonts should be installed to /boot/grub
Status in “grub2” package in Ubuntu:
Triaged
Status in “ubiquity” package in Ubuntu:
New
Bug description:
Binary package hint: grub2
fonts for GRUB 2 are installed to /usr/share/
if / is not readable for grub (i.e. because / is a btrfs filesystem),
GRUB can only use fonts in a separate /boot partition
I stumbled over this when I tried to set a GRUB background image on a
btrfs system. It didn't work because GRUB started in text mode. And it
took me a while to find out why (because it could not find a font
file).
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/615769/+subscriptions
More information about the foundations-bugs
mailing list