Am Samstag, den 08.08.2009, 01:49 -0400 schrieb Pavel Roskin:
> On Sat, 2009-08-08 at 07:36 +0200, Felix Zielcke wrote:
> 
> > > Could you please explain what I should do to keep using ascii.pf2?  I
> > > checked the script, but don't see any variable controlling that.  "make
> > > install" would install both unicode.pf2 and ascii.pf2, so unicode.pf2
> > > would always be preferred.
> > 
> > With the old code ascii.pf2 would be always preferred.
> > There wasn't either a way to specify it.
> 
> I see. Maybe that's what we should have fixed first.
> 
> > > If changing the default, it's a good style to provide an easy way for
> > > users to keep the old setting, and I just don't see it, short or
> > > removing /usr/src/unifont.bdf and /usr/local/share/grub/unicode.pf2 so
> > > that they are never reinstalled or detected by GRUB.
> > 
> > Here's now a patch which allows users to specifiy the used font with
> > GRUB_FONT=ascii
> 
> First of all, I hope that the patch you will actually commit will use
> sane formatting.  Diffs that ignore spacing changes are OK for review,
> but not for applying as is.

Yes.

> I think it would be more natural to let the user specify the full path
> to the file.  Setting LANG=C seems unneeded in this case.  After all,
> it's the user's choice, and we cannot examine the font file to check
> which characters it has.

Ok here's a new one.


-- 
Felix Zielcke
Proud Debian Maintainer
2009-08-08  Felix Zielcke  <fziel...@z-51.de>

        * util/grub-mkconfig.in: Allow the user to specify the used font
        with GRUB_FONT.

Index: util/grub-mkconfig.in
===================================================================
--- util/grub-mkconfig.in       (revision 2482)
+++ util/grub-mkconfig.in       (working copy)
@@ -154,6 +154,14 @@ esac
 # check for terminals that require fonts
 case ${GRUB_TERMINAL_OUTPUT} in
   gfxterm)
+    if [ -n "$GRUB_FONT" ] ; then
+      if is_path_readable_by_grub ${GRUB_FONT} > /dev/null ; then
+        GRUB_FONT_PATH=${GRUB_FONT}
+       else
+         echo "No such font or not readable by grub: ${GRUB_FONT}" >&2
+         exit 1
+       fi
+    else
     for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do
       for basename in unicode unifont ascii; do
        path="${dir}/${basename}.pf2"
@@ -169,6 +177,7 @@ case ${GRUB_TERMINAL_OUTPUT} in
        break 2
       done
     done
+    fi
     if [ -z "${GRUB_FONT_PATH}" ] ; then
       # fallback to the native terminal for this platform
       unset GRUB_TERMINAL_OUTPUT
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to