diff --git a/grub2-efi-gop-add-blt.patch b/grub2-efi-gop-add-blt.patch new file mode 100644 index 0000000..7acf273 --- /dev/null +++ b/grub2-efi-gop-add-blt.patch @@ -0,0 +1,59 @@ +From dc56925653819582777ddc5c761a56f52dddd8f1 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Wed, 1 Feb 2017 23:10:45 +0100 +Subject: [PATCH] grub-core/video/efi_gop.c: Add support for BLT_ONLY adapters + +EFI GOP has support for multiple different bitness types of frame buffers +and for a special "BLT only" type which is always defined to be RGBx. + +Because grub2 doesn't ever directly access the frame buffer but instead +only renders graphics via the BLT interface anyway, we can easily support +these adapters. + +The reason this has come up now is the emerging support for virtio-gpu +in OVMF. That adapter does not have the notion of a memory mapped frame +buffer and thus is BLT only. + +Signed-off-by: Alexander Graf +--- + grub-core/video/efi_gop.c | 2 ++ + include/grub/efi/graphics_output.h | 3 ++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c +index 7f9d1c2..c9e40e8 100644 +--- a/grub-core/video/efi_gop.c ++++ b/grub-core/video/efi_gop.c +@@ -121,6 +121,7 @@ grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *in) + { + case GRUB_EFI_GOT_BGRA8: + case GRUB_EFI_GOT_RGBA8: ++ case GRUB_EFI_GOT_BLT_ONLY: + return 32; + + case GRUB_EFI_GOT_BITMASK: +@@ -187,6 +188,7 @@ grub_video_gop_fill_real_mode_info (unsigned mode, + switch (in->pixel_format) + { + case GRUB_EFI_GOT_RGBA8: ++ case GRUB_EFI_GOT_BLT_ONLY: + out->red_mask_size = 8; + out->red_field_pos = 0; + out->green_mask_size = 8; +diff --git a/include/grub/efi/graphics_output.h b/include/grub/efi/graphics_output.h +index 1297774..e438812 100644 +--- a/include/grub/efi/graphics_output.h ++++ b/include/grub/efi/graphics_output.h +@@ -28,7 +28,8 @@ typedef enum + { + GRUB_EFI_GOT_RGBA8, + GRUB_EFI_GOT_BGRA8, +- GRUB_EFI_GOT_BITMASK ++ GRUB_EFI_GOT_BITMASK, ++ GRUB_EFI_GOT_BLT_ONLY, + } + grub_efi_gop_pixel_format_t; + +-- +1.8.5.6 + diff --git a/grub2-systemd-sleep.sh b/grub2-systemd-sleep.sh index 06a76a3..354991f 100644 --- a/grub2-systemd-sleep.sh +++ b/grub2-systemd-sleep.sh @@ -18,7 +18,7 @@ error_quit() check-system() { - [ -x "${GRUB_ONCE}" ] || error_quit "ERROR: cannot find or execute ${GRUB_EDITENV}" + [ -x "${GRUB_ONCE}" ] || error_quit "ERROR: cannot find or execute ${GRUB_ONCE}" [ -x "${GRUB_EDITENV}" ] || error_quit "ERROR: cannot find or execute ${GRUB_EDITENV}" [ -x "${BLKID}" ] || error_quit "ERROR: cannot find or execute ${BLKID}" [ -r "${GRUB_CONF}" ] || error_quit "ERROR: cannot find or read ${GRUB_CONF}" @@ -60,7 +60,7 @@ get-kernels() ;; linux*noresume*|module*xen*noresume*) - echo " Skipping grub entry #${J}, because it has the noresume option" >&2 + echo " Skipping ${MENU_ENTRIES[$I]}, because it has the noresume option" >&2 ;; linux*root=*|module*xen*root=*) local ROOT @@ -71,15 +71,20 @@ get-kernels() if [ x"${ROOT:0:5}" = "xUUID=" ]; then UUID=${ROOT#UUID=} if [ -n "$UUID" ]; then - ROOT=$($BLKID -U $UUID) + ROOT=$($BLKID -U $UUID || true) + if [ -z "$ROOT" ]; then + echo " Skipping ${MENU_ENTRIES[$I]}, because its root device $UUID is not found" >&2 + continue + fi fi fi - if [ "$(stat -Lc '%t:%T' $ROOT)" != "$(stat -Lc '%t:%T' $ROOTDEV)" ]; then - echo " Skipping grub entry #${J}, because its root= parameter ($ROOT)" >&2 + if [ "$(stat -Lc '%t:%T' $ROOT || true)" != "$(stat -Lc '%t:%T' $ROOTDEV || true)" ]; then + echo " Skipping ${MENU_ENTRIES[$I]}, because its root= parameter ($ROOT)" >&2 echo " does not match the current root device ($ROOTDEV)." >&2 continue fi + DUMMY=($LINE) # kernel (hd0,1)/boot/vmlinuz-ABC root=/dev/hda2 KERNELS[$I]=${DUMMY[1]##*/} # vmlinuz-ABC # DEBUG "Found kernel entry #${I}: '${DUMMY[1]##*/}'" INFO @@ -87,7 +92,7 @@ get-kernels() ;; linux*|module*xen*) # a kernel without "root="? We better skip that one... - echo " Skipping grub entry #${J}, because it has no root= option" >&2 + echo " Skipping ${MENU_ENTRIES[$I]}, because it has no root= option" >&2 ;; *) ;; esac diff --git a/grub2.changes b/grub2.changes index 9db156a..50b16b5 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Feb 3 08:18:30 UTC 2017 - mchang@suse.com + +- grub2-systemd-sleep.sh: Fix prematurely abort by commands error return code + and skip the offending menu entry (bsc#1022880) + +------------------------------------------------------------------- +Wed Feb 1 21:42:49 UTC 2017 - agraf@suse.com + +- Add support for BLT only EFI GOP adapters (FATE#322332) + * grub2-efi-gop-add-blt.patch + ------------------------------------------------------------------- Wed Jan 25 09:58:20 UTC 2017 - schwab@linux-m68k.org diff --git a/grub2.spec b/grub2.spec index 96ccc2b..b037776 100644 --- a/grub2.spec +++ b/grub2.spec @@ -244,6 +244,8 @@ Patch307: 0008-xen-factor-out-allocation-of-page-tables-into-separa.patch Patch308: 0009-xen-add-capability-to-load-initrd-outside-of-initial.patch Patch309: 0010-xen-modify-page-table-construction.patch Patch310: 0011-xen-add-capability-to-load-p2m-list-outside-of-kerne.patch +# Fix GOP BLT support (FATE#322332) +Patch311: grub2-efi-gop-add-blt.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140 @@ -497,6 +499,7 @@ swap partition while in resuming %patch308 -p1 %patch309 -p1 %patch310 -p1 +%patch311 -p1 # This simplifies patch handling without need to use git to create patch # that renames file