GNU bug report logs -
#38809
[PATCH] bootloader: grub: Add resolution override.
Previous Next
Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>
Date: Mon, 30 Dec 2019 10:34:02 UTC
Severity: normal
Done: Jan Nieuwenhuizen <janneke <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 38809 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tobias Geerinckx-Rice writes:
> Jan Nieuwenhuizen 写道:
>> With this patch I finally have a readable GRUB menu.
>
> Thanks! Perhaps it will help solve my EFI framebuffer woes (probably
> not but who knows.
>
>> I am not sure about the name and semantics of `resolution':
>> Better to use `gfxmode', and/or use a list of strings
>> '("1024x768x32" "auto"), ... WDYT?
>
> Yes please, on both counts. Grub-theme should expose the GRUB
> variable, not a lossy abstraction.
Okay, I think I just wished the GRUB name would be more meaningful for
casual users (such as myself). I'm terrible with TLAwords, and very
happy I found and fixed this ;-)
Greetings,
janneke
[0001-bootloader-grub-Add-gfxmode-resolution-override.patch (text/x-patch, inline)]
From 333ba3ee53e1c359a01aed80c24d17ece39ad975 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke <at> gnu.org>
Date: Mon, 30 Dec 2019 11:25:40 +0100
Subject: [PATCH] bootloader: grub: Add gfxmode (resolution) override.
* gnu/bootloader/grub.scm (<grub-theme>): Add `gfxmode' entry.
(eye-candy): Use it.
* doc/guix.texi (Bootloader Configuration): Document it.
---
doc/guix.texi | 27 +++++++++++++++++++++++++--
gnu/bootloader/grub.scm | 13 +++++++++----
2 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 70e3dfea6a..eaa4e7ab97 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25923,9 +25923,21 @@ must @emph{not} be an OS device name such as @file{/dev/sda1}.
@end table
@end deftp
+@cindex HDPI
+@cindex resolution
@c FIXME: Write documentation once it's stable.
-For now only GRUB has theme support. GRUB themes are created using
-the @code{grub-theme} form, which is not documented yet.
+For now only GRUB has theme support. GRUB themes are created using
+the @code{grub-theme} form, which is not fully documented yet.
+
+@deftp {Data Type} grub-theme
+Data type representing the configuration of the GRUB theme.
+
+@table @asis
+@item @code{gfxmode} (default: @code{'("auto")})
+The GRUB @code{gfxmode} to set (a list of screen resolution strings, see
+@pxref{gfxmode,,, grub, GNU GRUB manual}).
+@end table
+@end deftp
@defvr {Scheme Variable} %default-theme
This is the default GRUB theme used by the operating system if no
@@ -25936,6 +25948,17 @@ It comes with a fancy background image displaying the GNU and Guix
logos.
@end defvr
+For example, to override the default resolution, you may use something
+like
+
+@lisp
+(bootloader
+ (grub-configuration
+ ;; @dots{}
+ (theme (grub-theme
+ (inherit %default-theme)
+ (gfxmode '("1024x786x32" "auto"))))))
+@end lisp
@node Invoking guix system
@section Invoking @code{guix system}
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index adcdbdbab0..229bba96ad 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2016 Chris Marusich <cmmarusich <at> gmail.com>
;;; Copyright © 2017 Leo Famulari <leo <at> famulari.name>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe <at> gmail.com>
+;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -88,7 +89,9 @@ denoting a file name."
(color-normal grub-theme-color-normal
(default '((fg . cyan) (bg . blue))))
(color-highlight grub-theme-color-highlight
- (default '((fg . white) (bg . blue)))))
+ (default '((fg . white) (bg . blue))))
+ (gfxmode grub-gfxmode
+ (default '("auto")))) ;list of string
(define %background-image
(grub-image
@@ -149,8 +152,10 @@ system string---e.g., \"x86_64-linux\"."
;; 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)
- "
- # Leave 'gfxmode' to 'auto'.
+ (string-append "
+ set gfxmode=" (string-join
+ (grub-gfxmode (bootloader-configuration-theme config))
+ ";") "
insmod video_bochs
insmod video_cirrus
insmod gfxterm
@@ -166,7 +171,7 @@ system string---e.g., \"x86_64-linux\"."
insmod vbe
insmod vga
fi
-"
+")
""))
(define (setup-gfxterm config font-file)
--
2.24.0
[Message part 3 (text/plain, inline)]
--
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
This bug report was last modified 5 years and 169 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.