From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: bug#39607: GRUB module all_video required to get video on 4K monitor Date: Wed, 19 Feb 2020 21:55:54 -0500 Message-ID: <87d0aa9dc5.fsf@gmail.com> References: <877e0pj7ax.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37430) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4c1P-0007st-GM for bug-guix@gnu.org; Wed, 19 Feb 2020 21:57:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4c1O-00075D-85 for bug-guix@gnu.org; Wed, 19 Feb 2020 21:57:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4c1O-00074S-0L for bug-guix@gnu.org; Wed, 19 Feb 2020 21:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4c1N-0001fK-V9 for bug-guix@gnu.org; Wed, 19 Feb 2020 21:57:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877e0pj7ax.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 14 Feb 2020 14:30:14 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: 39607@debbugs.gnu.org --=-=-= Content-Type: text/plain Hello, Maxim Cournoyer writes: > Hello, > > I installed Guix System on a new machine, which displays on a 4K (3840 x > 2160 pixels) monitor. > > Unless I go to the GRUB command prompt with 'c' at boot and type 'insmod > all_video', the video cuts early after booting a GRUB entry with 'No > suitable video mode found', or similar. > > I think we should include this GRUB module in our default GRUB > package/configuration. > > Maxim I think the attached patches fixes this issue, and makes the GRUB configuration a bit simpler too! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-bootloader-grub-Use-the-all_video-module-in-graphic-.patch >From 115cc43361c72b3bae0d89e03f328e4383d9e9be Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 19 Feb 2020 15:35:46 -0500 Subject: [PATCH 1/2] bootloader: grub: Use the all_video module in graphic mode. Fixes . * gnu/bootloader/grub.scm (eye-candy): Load the module 'all_video' which automatically loads all the available and relevant video modules. --- gnu/bootloader/grub.scm | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 3ec960abd8..c1cee78a16 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -163,21 +163,8 @@ system string---e.g., \"x86_64-linux\"." (string-append "set gfxmode=" (string-join gfxmode ";")) "# Leave 'gfxmode' to 'auto'.")) " - insmod video_bochs - insmod video_cirrus + insmod all_video insmod gfxterm - - if [ \"${grub_platform}\" == efi ]; then - # This is for (U)EFI systems (these modules are unavailable in the - # non-EFI GRUB.) If we don't load them, GRUB boots in \"blind mode\", - # which isn't convenient. - insmod efi_gop - insmod efi_uga - else - # These are specific to non-EFI Intel machines. - insmod vbe - insmod vga - fi ") "")) -- 2.25.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-bootloader-grub-Refactor-eye-candy-a-bit.patch >From 5892917e2e56535deba9579a3013b54177fadc57 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 19 Feb 2020 15:59:06 -0500 Subject: [PATCH 2/2] bootloader: grub: Refactor eye-candy a bit. * gnu/bootloader/grub.scm (eye-candy)[setup-gfxterm-body]: Define the GFXMODE binding using AND-LET* instead of chained AND=>. Add a comment about supporting graphical mode on other systems than x86. Generate configuration string using FORMAT rather than STRING-APPEND. --- gnu/bootloader/grub.scm | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index c1cee78a16..d81e990cea 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -36,6 +36,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-2) #:export (grub-image grub-image? grub-image-aspect-ratio @@ -149,24 +150,26 @@ STORE-MOUNT-POINT is its mount point; these are used to determine where the background image and fonts must be searched for. SYSTEM must be the target system string---e.g., \"x86_64-linux\"." (define setup-gfxterm-body - ;; Intel and EFI systems need to be switched into graphics mode, whereas - ;; most other modern architectures have no other mode and therefore don't - ;; need to be switched. - (if (string-match "^(x86_64|i[3-6]86)-" system) - (string-append - " -" - (let ((gfxmode (and=> - (and=> config bootloader-configuration-theme) - grub-gfxmode))) - (if gfxmode - (string-append "set gfxmode=" (string-join gfxmode ";")) - "# Leave 'gfxmode' to 'auto'.")) - " + (let ((gfxmode + (or (and-let* ((theme (bootloader-configuration-theme config)) + (gfxmode (grub-gfxmode theme))) + (string-join gfxmode ";")) + "auto"))) + + ;; Intel and EFI systems need to be switched into graphics mode, whereas + ;; most other modern architectures have no other mode and therefore + ;; don't need to be switched. + + ;; XXX: Do we really need to restrict to x86 systems? We could imitate + ;; what the GRUB default configuration does and decide based on whether + ;; a user provided 'gfxterm' in the terminal-outputs field of their + ;; bootloader-configuration record. + (if (string-match "^(x86_64|i[3-6]86)-" system) + (format #f " + set gfxmode=~a insmod all_video - insmod gfxterm -") - "")) + insmod gfxterm~%" gfxmode) + ""))) (define (setup-gfxterm config font-file) (if (memq 'gfxterm (bootloader-configuration-terminal-outputs config)) -- 2.25.0 --=-=-=--