public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/grub/0.97: 002_all_grub-0.97-splashimage-safety.patch
@ 2009-06-26 23:39 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; only message in thread
From: Robin H. Johnson (robbat2) @ 2009-06-26 23:39 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/06/26 23:39:07

  Added:                002_all_grub-0.97-splashimage-safety.patch
  Log:
  Prototype patch to fix bug #200505 secondary issue - do not start graphics mode unless the splashimage file is actually present.

Revision  Changes    Path
1.1                  src/patchsets/grub/0.97/002_all_grub-0.97-splashimage-safety.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/grub/0.97/002_all_grub-0.97-splashimage-safety.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/grub/0.97/002_all_grub-0.97-splashimage-safety.patch?rev=1.1&content-type=text/plain

Index: 002_all_grub-0.97-splashimage-safety.patch
===================================================================
Only start graphics mode if, and only if the splashimage file is available.
This saves trying to fall back to the original text mode and failing.

X-WARNING: untested, waiting for feedback on bug #200505.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

diff -Nuar grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
--- grub-0.97.orig/stage2/graphics.c	2009-06-26 16:21:05.000000000 -0700
+++ grub-0.97/stage2/graphics.c	2009-06-26 16:29:28.162450103 -0700
@@ -108,7 +108,11 @@
  * mode.  */
 int graphics_init()
 {
-    if (!graphics_inited) {
+    if(!grub_file_exists(splashimage)) {
+        return 0;
+    }
+
+    if (!graphics_inited) {
         saved_videomode = set_videomode(0x12);
     }
 
@@ -549,4 +553,11 @@
     MapMask(15);
 }
 
+int grub_file_exists(char *s) {
+    if (!grub_open(s))
+        return 0;
+    grub_close();
+    return 1;
+}
+
 #endif /* SUPPORT_GRAPHICS */
diff -Nuar grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
--- grub-0.97.orig/stage2/graphics.h	2009-06-26 16:21:05.000000000 -0700
+++ grub-0.97/stage2/graphics.h	2009-06-26 16:34:03.302014350 -0700
@@ -36,6 +36,9 @@
 void set_int1c_handler();
 void unset_int1c_handler();
 
+/* Only to check for safe opening before we start */
+int grub_file_exists(char *s);
+
 extern short cursorX, cursorY;
 extern char cursorBuf[16];
 






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-26 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-26 23:39 [gentoo-commits] gentoo commit in src/patchsets/grub/0.97: 002_all_grub-0.97-splashimage-safety.patch Robin H. Johnson (robbat2)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox