From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: grub.cfg parser still doesn't abort on error
Date: Sun, 3 Feb 2008 15:53:42 +0100 [thread overview]
Message-ID: <20080203145342.GA24436@thorin> (raw)
In-Reply-To: <20080203132955.GA5989@thorin>
[-- Attachment #1: Type: text/plain, Size: 928 bytes --]
On Sun, Feb 03, 2008 at 02:29:55PM +0100, Robert Millan wrote:
> On Sun, Feb 03, 2008 at 09:05:38PM +0800, Bean wrote:
> >
> > if font (xxx)/some-file.pff ; then
> > # graphic mode setting
> > else
> > # text mode setting
> > fi
> >
> > i think this behavior is consistent with sh, an error code returned
> > from command should not cause the script to abort.
>
> Urg, part of update-grub was written with the idea that this ought to be
> handled in "build" time. I guess I'll have to overhaul some of it...
Well, it wasn't such a big change after all. The sanity checks done at grub.cfg
generation time are worth keeping, IMHO, since they off-load GRUB from
performing them (and it is more practical to add logic in bash when possible).
This should address the problem.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
[-- Attachment #2: font_fallback.diff --]
[-- Type: text/x-diff, Size: 1027 bytes --]
* util/grub.d/00_header.in: Issue scripting commands for GRUB to
only setup gfxterm when `font' command has succeeded.
diff -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/grub.d/00_header.in ./util/grub.d/00_header.in
--- ../grub2/util/grub.d/00_header.in 2008-01-12 16:11:56.000000000 +0100
+++ ./util/grub.d/00_header.in 2008-02-03 15:50:58.000000000 +0100
@@ -42,15 +42,14 @@ if [ "x${GRUB_DRIVE}" = "x" ] ; then : ;
echo "set root=${GRUB_DRIVE}"
fi
-if [ "x${GRUB_FONT_PATH}" = "x" ] ; then : ; else
- echo "font ${GRUB_FONT_PATH}"
-fi
-
case ${platform}:${GRUB_TERMINAL} in
pc:gfxterm) cat << EOF
-set gfxmode=640x480
-insmod gfxterm
-insmod vbe
+if font ${GRUB_FONT_PATH} ; then
+ set gfxmode=640x480
+ insmod gfxterm
+ insmod vbe
+ terminal gfxterm
+fi
EOF
;;
*:serial)
@@ -59,7 +58,9 @@ EOF
GRUB_SERIAL_COMMAND=serial
fi
echo "${GRUB_SERIAL_COMMAND}"
+ echo "terminal serial"
+ ;;
+ *:*)
+ echo "terminal ${GRUB_TERMINAL}"
;;
esac
-
-echo "terminal ${GRUB_TERMINAL}"
next prev parent reply other threads:[~2008-02-03 14:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 20:44 grub.cfg parser still doesn't abort on error Robert Millan
2008-02-02 20:59 ` Marco Gerards
2008-02-02 21:07 ` Robert Millan
2008-02-03 3:05 ` Bean
2008-02-03 10:55 ` Robert Millan
2008-02-03 13:05 ` Bean
2008-02-03 13:29 ` Robert Millan
2008-02-03 14:53 ` Robert Millan [this message]
2008-02-03 18:26 ` Robert Millan
2008-02-03 13:09 ` Yoshinori K. Okuji
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=20080203145342.GA24436@thorin \
--to=rmh@aybabtu.com \
--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.