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.
This commit is contained in:
parent
665900a389
commit
adf594cc44
3 changed files with 46 additions and 28 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
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>
|
2011-04-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* include/grub/offsets.h (GRUB_KERNEL_I386_PC_RAW_SIZE): Let a bit more
|
* 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");
|
theme_path = grub_env_get ("theme");
|
||||||
if (! theme_path)
|
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));
|
instance = grub_zalloc (sizeof (*instance));
|
||||||
if (!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);
|
err = grub_video_get_info (&mode_info);
|
||||||
if (err)
|
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
|
if (!cached_view || grub_strcmp (cached_view->theme_path, theme_path) != 0
|
||||||
|| cached_view->screen.width != mode_info.width
|
|| 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)
|
if (! cached_view)
|
||||||
{
|
{
|
||||||
grub_free (instance);
|
grub_free (instance);
|
||||||
grub_error_push ();
|
|
||||||
grub_gfxterm_fullscreen ();
|
|
||||||
grub_error_pop ();
|
|
||||||
return grub_errno;
|
return grub_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
#include <grub/term.h>
|
#include <grub/term.h>
|
||||||
#include <grub/script_sh.h>
|
#include <grub/script_sh.h>
|
||||||
|
#include <grub/gfxterm.h>
|
||||||
|
|
||||||
/* Time to delay after displaying an error message about a default/fallback
|
/* Time to delay after displaying an error message about a default/fallback
|
||||||
entry failing to boot. */
|
entry failing to boot. */
|
||||||
|
@ -345,18 +346,44 @@ static void
|
||||||
menu_init (int entry, grub_menu_t menu, int nested)
|
menu_init (int entry, grub_menu_t menu, int nested)
|
||||||
{
|
{
|
||||||
struct grub_term_output *term;
|
struct grub_term_output *term;
|
||||||
|
int gfxmenu = 0;
|
||||||
|
|
||||||
|
FOR_ACTIVE_TERM_OUTPUTS(term)
|
||||||
|
if (grub_strcmp (term->name, "gfxterm") == 0)
|
||||||
|
{
|
||||||
|
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)
|
FOR_ACTIVE_TERM_OUTPUTS(term)
|
||||||
{
|
{
|
||||||
grub_err_t err;
|
grub_err_t err;
|
||||||
|
|
||||||
if (grub_gfxmenu_try_hook && grub_strcmp (term->name, "gfxterm") == 0)
|
if (grub_strcmp (term->name, "gfxterm") == 0 && gfxmenu)
|
||||||
{
|
break;
|
||||||
err = grub_gfxmenu_try_hook (entry, menu, nested);
|
|
||||||
if(!err)
|
|
||||||
continue;
|
|
||||||
grub_errno = GRUB_ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = grub_menu_try_text (term, entry, menu, nested);
|
err = grub_menu_try_text (term, entry, menu, nested);
|
||||||
if(!err)
|
if(!err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue