]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Allow specifying
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 3 May 2013 12:08:51 +0000 (14:08 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 3 May 2013 12:08:51 +0000 (14:08 +0200)
the theme path relative to $prefix/themes.

ChangeLog
grub-core/gfxmenu/gfxmenu.c

index c26b110f253317bc5b4f40c54b36a714080626a3..ed99c80430b65276f2f66f3fa70dc1da27897985 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-03  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Allow specifying
+       the theme path relative to $prefix/themes.
+
 2013-05-03  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/video/fb/fbblit.c (grub_video_fbblit_blend_BGR888_RGBA8888):
index 09e86213ff854e447754a7898da4daa0aa4a8333..51110a6f8be7b43db037c674fc12f56b17aaaa78 100644 (file)
@@ -53,6 +53,7 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
 {
   grub_gfxmenu_view_t view = NULL;
   const char *theme_path;
+  char *full_theme_path = 0;
   struct grub_menu_viewer *instance;
   grub_err_t err;
   struct grub_video_mode_info mode_info;
@@ -70,15 +71,27 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
   if (err)
     return err;
 
-  if (!cached_view || grub_strcmp (cached_view->theme_path, theme_path) != 0
+  if (theme_path[0] != '/' && theme_path[0] != '(')
+    {
+      const char *prefix;
+      prefix = grub_env_get ("prefix");
+      full_theme_path = grub_xasprintf ("%s/themes/%s",
+                                       prefix,
+                                       theme_path);
+    }
+
+  if (!cached_view || grub_strcmp (cached_view->theme_path,
+                                  full_theme_path ? : theme_path) != 0
       || cached_view->screen.width != mode_info.width
       || cached_view->screen.height != mode_info.height)
     {
       grub_free (cached_view);
       /* Create the view.  */
-      cached_view = grub_gfxmenu_view_new (theme_path, mode_info.width,
+      cached_view = grub_gfxmenu_view_new (full_theme_path ? : theme_path,
+                                          mode_info.width,
                                           mode_info.height);
     }
+  grub_free (full_theme_path);
 
   if (! cached_view)
     {