Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:michael-chang:bsc:1218104
grub2
0001-gfxmenu-Resolve-false-grub_errno-disruptin...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-gfxmenu-Resolve-false-grub_errno-disrupting-boot-pro.patch of Package grub2
From 34660a9761261bc990c4233e58cac8fca643158b Mon Sep 17 00:00:00 2001 From: Michael Chang <mchang@suse.com> Date: Thu, 28 Dec 2023 17:31:31 +0800 Subject: [PATCH] gfxmenu: Resolve false grub_errno disrupting boot process When enabling gfxmenu and choosing to boot the Xen hypervisor from its menu, an error occurred: "error: ../../grub-core/video/bitmap_scale.c:42:null src bitmap in grub_video_create_scaled." The error is returned by grub_video_bitmap_create_scaled() when the source pixmap is not there. The init_background() uses it to scale up the background image so it can fully fit into the screen resolution. However not all backgrounds are set by a image, ie the "desktop-image" property of the theme file. Instead a color code may be used, for example openSUSE's green background uses "desktop-color" property: desktop-color: "#0D202F" So it is absolutely fine to call init_background() without a raw pixmap if color code is used. A check has to be added to ensure that it returns early in this case so that the grub_error will not be erroneously set and gets in the way of ensuing error check and handling. The reason it happens sporadically is due to grub_error is reset to GRUB_ERR_NONE in many places if a function's error return can be ignored. In particular this hunk in grub_gfxmenu_create_box() does the majority of the reset of grub_errno returned by init_background(), but not always. grub_video_bitmap_load (&box->raw_pixmaps[i], path); grub_free (path); /* Ignore missing pixmaps. */ grub_errno = GRUB_ERR_NONE; In any case, we cannot account on such random behavior and should only return grub_errno if it is justified. Siged-off-by: Michael Chang <mchang@suse.com> --- grub-core/gfxmenu/view.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grub-core/gfxmenu/view.c b/grub-core/gfxmenu/view.c index 6e5c206d9..54966903a 100644 --- a/grub-core/gfxmenu/view.c +++ b/grub-core/gfxmenu/view.c @@ -605,6 +605,11 @@ init_background (grub_gfxmenu_view_t view) if (view->scaled_desktop_image) return; + /* You don't have to scale a raw image if it's not present; this prevents + * setting grub_errno and disrupting a command's execution. */ + if (view->raw_desktop_image == NULL) + return; + struct grub_video_bitmap *scaled_bitmap; if (view->desktop_image_scale_method == GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH) -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor