From 98c7f34bed7668ef202b62ba5c330701f43c309040e087596b60de334fa6f7d1 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 14 Jun 2019 07:19:55 +0000 Subject: [PATCH] Accepting request 709899 from home:michael-chang:branches:Base:System - Avoid high resolution when trying to keep current mode (bsc#1133842) * grub2-video-limit-the-resolution-for-fixed-bimap-font.patch - Make GRUB_SAVEDEFAULT working with btrfs (bsc#1128592) * grub2-grubenv-in-btrfs-header.patch OBS-URL: https://build.opensuse.org/request/show/709899 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=334 --- grub2-grubenv-in-btrfs-header.patch | 17 ++++-- ...-the-resolution-for-fixed-bimap-font.patch | 57 ++++++++++++++----- grub2.changes | 8 +++ 3 files changed, 64 insertions(+), 18 deletions(-) diff --git a/grub2-grubenv-in-btrfs-header.patch b/grub2-grubenv-in-btrfs-header.patch index 3311068..61ebb4c 100644 --- a/grub2-grubenv-in-btrfs-header.patch +++ b/grub2-grubenv-in-btrfs-header.patch @@ -2,6 +2,8 @@ GRUB cannot write Btrfs file systems from the bootloader, so it cannot modify values set from userspace (e.g. "next_entry" set by grub2-once). As a workaround use the Btrfs header to store known data of the GRUB environment block. + +v2: export env_block and make sure to use the device of grubenv --- Index: grub-2.02/grub-core/kern/fs.c =================================================================== @@ -447,19 +449,21 @@ Index: grub-2.02/util/grub.d/00_header.in =================================================================== --- grub-2.02.orig/util/grub.d/00_header.in +++ grub-2.02/util/grub.d/00_header.in -@@ -46,6 +46,11 @@ cat << EOF +@@ -46,6 +46,13 @@ cat << EOF if [ -s \$prefix/grubenv ]; then load_env fi + +if [ "\${env_block}" ] ; then ++ set env_block="(\${root})\${env_block}" ++ export env_block + load_env -f "\${env_block}" +fi + EOF if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then cat <mode->info && +- (!avoid_low_resolution || +- (gop->mode->info->width >= 800 && gop->mode->info->height >= 600))) ++ (!avoid_extreme_resolution || ++ ((gop->mode->info->width >= 800 && gop->mode->info->height >= 600) && ++ (gop->mode->info->width <= 1920 && gop->mode->info->height <= 1080)))) + { + bpp = grub_video_gop_get_bpp (gop->mode->info); + if (bpp && ((width == gop->mode->info->width +@@ -456,9 +464,9 @@ again: + + if (!found) + { +- if (avoid_low_resolution && gop->mode->info) ++ if (avoid_extreme_resolution && gop->mode->info) + { +- avoid_low_resolution = 0; ++ avoid_extreme_resolution = 0; + goto again; + } + grub_dprintf ("video", "GOP: no mode found\n"); +Index: grub-2.02/grub-core/video/i386/pc/vbe.c +=================================================================== +--- grub-2.02.orig/grub-core/video/i386/pc/vbe.c ++++ grub-2.02/grub-core/video/i386/pc/vbe.c +@@ -994,7 +994,13 @@ grub_video_vbe_setup (unsigned int width { grub_vbe_get_preferred_mode (&width, &height); if (grub_errno == GRUB_ERR_NONE) @@ -54,6 +88,3 @@ index b0d3190..68700ec 100644 else { /* Fall back to 640x480. This is conservative, but the largest --- -2.12.3 - diff --git a/grub2.changes b/grub2.changes index b31531b..dece89e 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jun 14 06:13:58 UTC 2019 - mchang@suse.com + +- Avoid high resolution when trying to keep current mode (bsc#1133842) + * grub2-video-limit-the-resolution-for-fixed-bimap-font.patch +- Make GRUB_SAVEDEFAULT working with btrfs (bsc#1128592) + * grub2-grubenv-in-btrfs-header.patch + ------------------------------------------------------------------- Fri May 17 13:57:29 UTC 2019 - rw@suse.com