From: Felix Zielcke <fzielcke@z-51.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] move functionality of font_path() directly to util/grub-mkconfig.in and prefer unicode.pf2 over ascii.pf2
Date: Thu, 06 Aug 2009 11:39:11 +0200 [thread overview]
Message-ID: <1249551551.3663.7.camel@fz.local> (raw)
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
As discussed with Robert on IRC I moved the font_path function directly
to grub-mkconfig where it's only used.
And now the unicode font gets prefered over the ascii one.
And LANG=C gets exported if ascii.pf2 gets used, which is the main
reason for the move of it.
--
Felix Zielcke
Proud Debian Maintainer
[-- Attachment #2: font.diff --]
[-- Type: text/x-patch, Size: 2668 bytes --]
2009-08-06 Felix Zielcke <fzielcke@z-51.de>
* util/grub-mkconfig_lib.in (font_path): Move the functionality
of it to ...
* util/grub-mkconfig.in: ... here. Prefer unicode.pf2 and
unifont.pf2 over ascii.pf2. Export LANG=C in case ascii.pf2 gets used.
Index: util/grub-mkconfig.in
===================================================================
--- util/grub-mkconfig.in (revision 2469)
+++ util/grub-mkconfig.in (working copy)
@@ -24,6 +24,8 @@ sbindir=@sbindir@
libdir=@libdir@
sysconfdir=@sysconfdir@
package_version=@PACKAGE_VERSION@
+datadir=@datadir@
+pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
grub_prefix=`echo /boot/grub | sed ${transform}`
grub_cfg=""
grub_mkconfig_dir=${sysconfdir}/grub.d
@@ -151,22 +153,30 @@ esac
# check for terminals that require fonts
case ${GRUB_TERMINAL_OUTPUT} in
gfxterm)
- if path=`font_path` ; then
- GRUB_FONT_PATH="${path}"
- else
- # fallback to the native terminal for this platform
- unset GRUB_TERMINAL_OUTPUT
+ for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do
+ for basename in unicode unifont ascii; do
+ path="${dir}/${basename}.pf2"
+ if is_path_readable_by_grub ${path} > /dev/null ; then
+ GRUB_FONT_PATH=${path}
+ else
+ continue
+ fi
+ if [ "${basename}" = "ascii"] ; then
+ # make sure all our children behave in conformance with ascii..
+ export LANG=C
+ fi
+ break 2
+ done
+ done
+ if [ -z "${GRUB_FONT_PATH}" ] ; then
+ # fallback to the native terminal for this platform
+ unset GRUB_TERMINAL_OUTPUT
+ fi
fi
;;
-esac
-
-# does our terminal support utf-8 ?
-case ${GRUB_TERMINAL_OUTPUT} in
- gfxterm) ;;
*)
# make sure all our children behave in conformance with ascii..
export LANG=C
- ;;
esac
# These are defined in this script, export them here so that user can
Index: util/grub-mkconfig_lib.in
===================================================================
--- util/grub-mkconfig_lib.in (revision 2470)
+++ util/grub-mkconfig_lib.in (working copy)
@@ -148,23 +148,6 @@ prepare_grub_to_access_device ()
fi
}
-font_path ()
-{
- for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do
- # FIXME: We prefer ascii because loading complete fonts is too slow (and
- # we don't yet provide the gettext magic that would make unicode useful).
- for basename in ascii unicode unifont ; do
- path="${dir}/${basename}.pf2"
- if is_path_readable_by_grub ${path} > /dev/null ; then
- echo "${path}"
- return 0
- fi
- done
- done
-
- return 1
-}
-
grub_file_is_not_garbage ()
{
if test -f "$1" ; then
next reply other threads:[~2009-08-06 9:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 9:39 Felix Zielcke [this message]
2009-08-07 11:39 ` [PATCH] move functionality of font_path() directly to util/grub-mkconfig.in and prefer unicode.pf2 over ascii.pf2 Robert Millan
2009-08-07 12:02 ` Felix Zielcke
2009-08-07 12:57 ` Felix Zielcke
2009-08-08 5:12 ` Pavel Roskin
2009-08-08 5:36 ` Felix Zielcke
2009-08-08 5:41 ` Felix Zielcke
2009-08-08 5:49 ` Pavel Roskin
2009-08-08 6:04 ` Felix Zielcke
2009-08-08 6:35 ` Pavel Roskin
2009-08-08 6:41 ` Felix Zielcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1249551551.3663.7.camel@fz.local \
--to=fzielcke@z-51.de \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.