Commit adf594cc authored by Vladimir 'phcoder' Serbinenko's avatar Vladimir 'phcoder' Serbinenko
Browse files

Output errors if theme loading failed.

	* grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Move the call to
	grub_gfxterm_fullscreen on error paths to ...
	* grub-core/normal/menu.c (menu_init): ...here. Wait after showing
	theme loading error.
parent 665900a3
2011-04-06 Vladimir Serbinenko <phcoder@gmail.com>
Output errors if theme loading failed.
* grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Move the call to
grub_gfxterm_fullscreen on error paths to ...
* grub-core/normal/menu.c (menu_init): ...here. Wait after showing
theme loading error.
2011-04-06 Vladimir Serbinenko <phcoder@gmail.com>
 
* include/grub/offsets.h (GRUB_KERNEL_I386_PC_RAW_SIZE): Let a bit more
......@@ -56,30 +56,15 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
theme_path = grub_env_get ("theme");
if (! theme_path)
{
grub_error_push ();
grub_gfxterm_fullscreen ();
grub_error_pop ();
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no theme specified");
}
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no theme specified");
instance = grub_zalloc (sizeof (*instance));
if (!instance)
{
grub_error_push ();
grub_gfxterm_fullscreen ();
grub_error_pop ();
return grub_errno;
}
return grub_errno;
err = grub_video_get_info (&mode_info);
if (err)
{
grub_error_push ();
grub_gfxterm_fullscreen ();
grub_error_pop ();
return err;
}
return err;
if (!cached_view || grub_strcmp (cached_view->theme_path, theme_path) != 0
|| cached_view->screen.width != mode_info.width
......@@ -94,9 +79,6 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
if (! cached_view)
{
grub_free (instance);
grub_error_push ();
grub_gfxterm_fullscreen ();
grub_error_pop ();
return grub_errno;
}
......
......@@ -30,6 +30,7 @@
#include <grub/i18n.h>
#include <grub/term.h>
#include <grub/script_sh.h>
#include <grub/gfxterm.h>
/* Time to delay after displaying an error message about a default/fallback
entry failing to boot. */
......@@ -345,19 +346,45 @@ static void
menu_init (int entry, grub_menu_t menu, int nested)
{
struct grub_term_output *term;
int gfxmenu = 0;
FOR_ACTIVE_TERM_OUTPUTS(term)
{
grub_err_t err;
if (grub_gfxmenu_try_hook && grub_strcmp (term->name, "gfxterm") == 0)
if (grub_strcmp (term->name, "gfxterm") == 0)
{
err = grub_gfxmenu_try_hook (entry, menu, nested);
if(!err)
continue;
if (grub_env_get ("theme"))
{
if (!grub_gfxmenu_try_hook)
{
grub_dl_load ("gfxmenu");
grub_print_error ();
}
if (grub_gfxmenu_try_hook)
{
grub_err_t err;
err = grub_gfxmenu_try_hook (entry, menu, nested);
if(!err)
{
gfxmenu = 1;
break;
}
}
else
grub_error (GRUB_ERR_BAD_MODULE, "no gfxmenu found");
grub_print_error ();
grub_wait_after_message ();
}
grub_errno = GRUB_ERR_NONE;
grub_gfxterm_fullscreen ();
break;
}
FOR_ACTIVE_TERM_OUTPUTS(term)
{
grub_err_t err;
if (grub_strcmp (term->name, "gfxterm") == 0 && gfxmenu)
break;
err = grub_menu_try_text (term, entry, menu, nested);
if(!err)
continue;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment