[PATCH] bootloader: grub: Add resolution override.

  • Done
  • quality assurance status badge
Details
5 participants
  • Alex Griffin
  • Brett Gilio
  • Danny Milosavljevic
  • Jan Nieuwenhuizen
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Jan Nieuwenhuizen
Severity
normal

Debbugs page

J
J
Jan Nieuwenhuizen wrote on 30 Dec 2019 02:33
(address . guix-patches@gnu.org)
87lfquhzmi.fsf@gnu.org
Hi,

With this patch I finally have a readable GRUB menu. 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?

Greetings,
janneke
From dfceb5702b0de5787f79e1098b4787e9d3adbe4e Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 30 Dec 2019 11:25:40 +0100
Subject: [PATCH] bootloader: grub: Add resolution override.

* gnu/bootloader/grub.scm (<grub-theme>): Add `resolution' entry.
(eye-candy): Use it.
* doc/guix.texi (Bootloader Configuration): Document it.
---
doc/guix.texi | 26 ++++++++++++++++++++++++--
gnu/bootloader/grub.scm | 11 +++++++----
2 files changed, 31 insertions(+), 6 deletions(-)

Toggle diff (90 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index efc59c1aaf..02cecae043 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25923,9 +25923,20 @@ 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{resolution} (default: @code{"auto"})
+The @code{gfxmode} to set (@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 +25947,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)
+ (resolution "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 fd62f627a0..70de3edeb5 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@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))))
+ (resolution grub-resolution
+ (default "auto")))
(define %background-image
(grub-image
@@ -149,8 +152,8 @@ 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=" (grub-resolution (bootloader-configuration-theme config)) "
insmod video_bochs
insmod video_cirrus
insmod gfxterm
@@ -166,7 +169,7 @@ system string---e.g., \"x86_64-linux\"."
insmod vbe
insmod vga
fi
-"
+")
""))
(define (setup-gfxterm config font-file)
--
2.24.0
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
B
B
Brett Gilio wrote on 3 Jan 2020 20:39
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 38809@debbugs.gnu.org)
87eewfzvfm.fsf@gnu.org
Jan Nieuwenhuizen <janneke@gnu.org> writes:

Toggle quote (113 lines)
> Hi,
>
> With this patch I finally have a readable GRUB menu. 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?
>
> Greetings,
> janneke
>
>>From dfceb5702b0de5787f79e1098b4787e9d3adbe4e Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Mon, 30 Dec 2019 11:25:40 +0100
> Subject: [PATCH] bootloader: grub: Add resolution override.
>
> * gnu/bootloader/grub.scm (<grub-theme>): Add `resolution' entry.
> (eye-candy): Use it.
> * doc/guix.texi (Bootloader Configuration): Document it.
> ---
> doc/guix.texi | 26 ++++++++++++++++++++++++--
> gnu/bootloader/grub.scm | 11 +++++++----
> 2 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index efc59c1aaf..02cecae043 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -25923,9 +25923,20 @@ 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{resolution} (default: @code{"auto"})
> +The @code{gfxmode} to set (@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 +25947,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)
> + (resolution "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 fd62f627a0..70de3edeb5 100644
> --- a/gnu/bootloader/grub.scm
> +++ b/gnu/bootloader/grub.scm
> @@ -3,6 +3,7 @@
> ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
> ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
> +;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@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))))
> + (resolution grub-resolution
> + (default "auto")))
>
> (define %background-image
> (grub-image
> @@ -149,8 +152,8 @@ 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=" (grub-resolution (bootloader-configuration-theme config)) "
> insmod video_bochs
> insmod video_cirrus
> insmod gfxterm
> @@ -166,7 +169,7 @@ system string---e.g., \"x86_64-linux\"."
> insmod vbe
> insmod vga
> fi
> -"
> +")
> ""))
>
> (define (setup-gfxterm config font-file)
> --
> 2.24.0

Hi Jan,

This seems like a sensible change, and is something other distributions
seem to implement in their own manner, as well. I am in favor of this
change, and will test it ASAP.

--
Brett M. Gilio
GNU Guix, Contributor | GNU Project, Webmaster
[DFC0 C7F7 9EE6 0CA7 AE55 5E19 6722 43C4 A03F 0EEE]
<brettg@gnu.org> <brettg@posteo.net>
T
T
Tobias Geerinckx-Rice wrote on 4 Jan 2020 02:41
87lfqn8pwf.fsf@nckx
Jan Nieuwenhuizen 写道:
Toggle quote (2 lines)
> 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.

Toggle quote (4 lines)
> 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.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl4Qa+AACgkQ2Imw8BjF
STxfzw//U0NLd2qwRyWJGE238fw1jEuj7STLag921qyR4qKVZRuw3xNkgG4DZBf/
gUvYcbjQfevgPmtYsq/qF5yOlDSbYqQX9f/40I8tTTO94t7D1GD5G7cZcWoppZe4
VUr0FDmTpmAjZh85KkeznOcTxx1RGg0sFXcPMtF7H5cPlyPN4VaZch1mkChdxEET
gISQd9T7sMwkZiP73NwrHOk60WKazFuVKjQAUve1AGqBHGwVu8p0MdF9VJ4DV1Va
wnbOEOsj0cqBpYDsN2dTZGYwT5arM6W2Kebi1hxE/QacsIaJznRHobAC9zlD1G1z
liXauQ4aqJdmMoX8i/QYeh4MQ80IeTfoodZ6EL91F7nwDbTB1KqfVYtaXylWx52L
Qx38BMyiyx7DQ0ZRIE/q8Kq22NgxWxUMinLUAImGNT1wHmRCqFWxquoRW1AcalMP
r/mKGyC2nJN2ID4LmM438jwLxkO3thzi33ITF1RTUwK02JDLJXz+gMptI/vWGYka
tJfhWjcKcHBRjWF7Z7KSTYi29t6ugjVhNFJ24BPsu8Bjzz/L2ie1orvdx7nrtPWz
VLsCVa2giLlmqTAfQ2W5UTQdl2DgTF+JKebq2hlzk1N817XB/sQ7d+YCGB38+3q0
h6Lc+bA1xqxrQhmd7v+IlivyLJJ8rszH+T3o230R4P28oQQknyw=
=ClaN
-----END PGP SIGNATURE-----

J
J
Jan Nieuwenhuizen wrote on 4 Jan 2020 03:48
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 38809@debbugs.gnu.org)
87ftgvv3wp.fsf@gnu.org
Tobias Geerinckx-Rice writes:

Toggle quote (13 lines)
> 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
From 333ba3ee53e1c359a01aed80c24d17ece39ad975 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@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(-)

Toggle diff (93 lines)
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@gmail.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@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
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
D
D
Danny Milosavljevic wrote on 4 Jan 2020 07:45
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 38809@debbugs.gnu.org)
20200104164512.7589fa36@scratchpost.org
Hi janneke,

On Mon, 30 Dec 2019 11:33:09 +0100
Jan Nieuwenhuizen <janneke@gnu.org> wrote:

Toggle quote (4 lines)
> With this patch I finally have a readable GRUB menu. 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?

Especially with HiDPI, the word "resolution" is ambiguous.

Also, gfxmode values are not standardized (f.e. u-boot would not know what
to do with them), so using a non-grub-specific key doesn't bring us anything.

I much prefer lists instead of one string. But grub apparently has "," and
";" as separators--presumably with the same meaning?

It also has the special value "keep" as possible first item.

In view of this complication it's maybe better not to use lists.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl4QswgACgkQ5xo1VCww
uqXyWwf/QRLaIhas5nDXA6Vzeg9mC7O5ByxEGCAHX6NWr7aA6PmN8pkcbLKbgnZB
/kKEKeBkCVmDDxyRdV2Ee44vfe2pi9IQx5jWDJN7UyYSudGbBtMpD7UQcmzd6OjQ
qMGdwjhBbj45WX/yLMfDcRyCTiHQxTf1Tm0e3vB+KeJKQfL797QQpHf/ssin3J+v
8oSSv0ba+0FG5yjvlk22hgNq4fGF5ZKogV3R+VcDLGZQazDHqoOwfg7o7a2SJmtx
LDTkAzwpwwNjj5waArK+6Y1bhKA6mTPKeoCMeb1ZwaCH6pcPHvaYfyKnyJC5XfsC
IOxNmQToOyqMKTepFV/rLn2gOOVq/A==
=mLUt
-----END PGP SIGNATURE-----


J
J
Jan Nieuwenhuizen wrote on 4 Jan 2020 08:07
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 38809@debbugs.gnu.org)
87tv5btdc3.fsf@gnu.org
Danny Milosavljevic writes:

Hi Danny,

Toggle quote (9 lines)
>> With this patch I finally have a readable GRUB menu. 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?
>
> Especially with HiDPI, the word "resolution" is ambiguous.
>
> Also, gfxmode values are not standardized (f.e. u-boot would not know what
> to do with them), so using a non-grub-specific key doesn't bring us anything.

That's another good argument; thank you for chiming in! I think we all
agree now. I sent an updated patch using `gfxmode' in another mail.

Toggle quote (3 lines)
> I much prefer lists instead of one string. But grub apparently has "," and
> ";" as separators--presumably with the same meaning?

Yes, that was also Tobias' wish, so we now have it as a list too.

Toggle quote (4 lines)
> It also has the special value "keep" as possible first item.
>
> In view of this complication it's maybe better not to use lists.

Hmm, yes that's why I had some doubts too. After Tobias' comment I now
chose to use a list, and the example now says

(gfxmode '("1024x786x32" "auto"))

I hope that people can imagine prepending "keep"?

Greetings,
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
D
D
Danny Milosavljevic wrote on 5 Jan 2020 04:27
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 38809@debbugs.gnu.org)
20200105132725.69d1afaa@scratchpost.org
Hi janneke,

On Sat, 04 Jan 2020 17:07:24 +0100
Jan Nieuwenhuizen <janneke@gnu.org> wrote:

Toggle quote (7 lines)
> Hmm, yes that's why I had some doubts too. After Tobias' comment I now
> chose to use a list, and the example now says
>
> (gfxmode '("1024x786x32" "auto"))
>
> I hope that people can imagine prepending "keep"?

Yes, it should be fine. Thanks! LGTM.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl4R1i0ACgkQ5xo1VCww
uqW0FAgAkbn8Nozgt1E5nVJftPcVDWZBQH5YoomY/swpN0+9XWPGo0y2VEOU5JL9
fFd27oQVfHwM2DBYTNHOSaxjueMAiyu/oa2e5jqrPCR/vzi0fViAk1y+iUJ1Nvj5
YhGUvFcENoMYgLPMxXrPWkNywsdZxkpoBtGP02IA0Sby1fwdBudj/Y256V33cL3j
GVhwJ7M6Z8eI0SooMbyfnf1Y3gBaRsgDJtpKVSgV/dsi2E+51qGOjfmM5NAM25x6
4kvE8Uj/ZJ+e+PktM0i6vMhukmn9jHl6gBJ5xQCy95uxmMO/hH5HfawgNKzWZQxp
G+qAfD09/bpCxpwrBV3BysY9gs31PQ==
=+bCA
-----END PGP SIGNATURE-----


J
J
Jan Nieuwenhuizen wrote on 7 Jan 2020 12:29
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87muazt3gm.fsf@gnu.org
Danny Milosavljevic writes:

Hi Danny, Tobias,

Toggle quote (2 lines)
> Yes, it should be fine. Thanks! LGTM.

After chatting with Tobias on irc, pushed to master as a23091880d4dc6115acbfa3b7ef09d731fc5abb0

Greetings,
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
Closed
J
J
Jan Nieuwenhuizen wrote on 7 Jan 2020 21:59
control message for bug #38809
(address . control@debbugs.gnu.org)
87h816trnd.fsf@gnu.org
reopen 38809
tags 38809 - fixed patch
quit
J
J
Jan Nieuwenhuizen wrote on 8 Jan 2020 00:21
Re: bug#38809: reopened (Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.)
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 38809@debbugs.gnu.org)
87d0butl2q.fsf_-_@gnu.org
GNU bug Tracking System writes:

Hi Tobias,

As reported by oscar123123 on irc, this broke guix pull

To reproduce:

Toggle snippet (3 lines)
guix pull --commit=a23091880d4dc6115acbfa3b7ef09d731fc5abb0

Tobias reverted the commit (thanks!).

I found this test to also show the failure.

Toggle snippet (3 lines)
make check TESTS=tests/guix-system.sh

It turns out that this test creates a grub bootsloader with #f for
config.

Attached is a new version of the patch, that is robust against this;
this being the difference:

Toggle snippet (27 lines)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 55e6344285..b99f5fa4f4 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -152,10 +152,16 @@ 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)
- (string-append "
- set gfxmode=" (string-join
- (grub-gfxmode (bootloader-configuration-theme config))
- ";") "
+ (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'."))
+ "
insmod video_bochs
insmod video_cirrus
insmod gfxterm

This fixes make check and I also tested that

Toggle snippet (3 lines)
guix pull --url=$PWD

now succeeds.

Greetings,
janneke
From 76bc0b8ef3370a4f98e63f6630c14c55613426f7 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@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 | 28 ++++++++++++++++++++++++++--
gnu/bootloader/grub.scm | 19 +++++++++++++++----
2 files changed, 41 insertions(+), 6 deletions(-)

Toggle diff (100 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index df1ba428a5..6e3f175488 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25923,9 +25923,22 @@ must @emph{not} be an OS device name such as @file{/dev/sda1}.
@end table
@end deftp
+@cindex HDPI
+@cindex HiDPI
+@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 +25949,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 f13685ac9d..b99f5fa4f4 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@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,16 @@ 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
+ "
+"
+ (let ((gfxmode (and=>
+ (and=> config bootloader-configuration-theme)
+ grub-gfxmode)))
+ (if gfxmode
+ (string-append "set gfxmode=" (string-join gfxmode ";"))
+ "# Leave 'gfxmode' to 'auto'."))
+ "
insmod video_bochs
insmod video_cirrus
insmod gfxterm
@@ -166,7 +177,7 @@ system string---e.g., \"x86_64-linux\"."
insmod vbe
insmod vga
fi
-"
+")
""))
(define (setup-gfxterm config font-file)
--
2.24.0
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
A
A
Alex Griffin wrote on 23 Jan 2020 07:12
Re: [PATCH] bootloader: grub: Add resolution override.
(address . 38809@debbugs.gnu.org)
c73e85c9-30bb-40db-9250-59bbb327fcfb@www.fastmail.com
I've been using the updated patch for a couple weeks now without issue. Maybe it's time to commit it again?

--
Alex Griffin
T
T
Tobias Geerinckx-Rice wrote on 23 Jan 2020 15:00
Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
(address . 38809@debbugs.gnu.org)
878slxwzfd.fsf@nckx
Alex Griffin 写道:
Toggle quote (3 lines)
> I've been using the updated patch for a couple weeks now without
> issue. Maybe it's time to commit it again?

Yes. I think I LGTM'd this on IRC already, but regardless: LGTM!

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl4qJaYACgkQ2Imw8BjF
STw3yhAAmH/3BMSmu+ay5/2E/hOr37uMWkaD81oKWTG6okmImHHWVoPBenyR+rtm
SDU4QQwnrtEClua1IMoHdUcjbEYCtOKBqRitbUREXHOvtcg3BAp0X/G0E7Li7Ps9
vzy9RKagE2vWaXPybA55EUUgav1ra0saFVTey3R2PfWdX0FZYMgyw0pm16IrWPJ4
5gFUs2xFCMeipjwtpWCx7/QnN8OLm52drPsdjd54MUcqibOU6BRNV4vmxPhxr+04
qBC+JEBJONgrlG1l9/e8u+lazpiB+188tg8GbF6bo4lCwQnpD1c+hqRsuFauEcY8
vufnQ4ddP3ait62JaYZwZXJf8hK/JPxuh/db5LmtoKDA8gPw4eNTLQ66EJ3gfZeD
KuB7i8NhkroQgjKDGFhl58SF5n2GT46W9TTRdNL4R+WCukNNgatyRuZqWKuBPzie
NKCYJQJG61DA/xi5Dr4Vqu+Zd6uxOKXW3CPI7892gIw2TsuS1zRM9ilKpu2Np0/R
AWtxbkXvIkk/T7y1GlbgQ7fAG/V8Gb0q2Jx/7bT4z/1AKP103zGQSUPZeC5j0d5k
ocss4r5Rt0GocU8eGbaOyR9W3TUg60F6NMGdkhnZXDdGJhxx23FjXGL480yLRRVC
g54Nrm1+Qgn3ZutSCGeFT+ozi2GyAQYJgM59R2m8LRfywTYNZ/c=
=WMtz
-----END PGP SIGNATURE-----

J
J
Jan Nieuwenhuizen wrote on 25 Jan 2020 07:10
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 38809-done@debbugs.gnu.org)
87wo9ffu6b.fsf@gnu.org
Tobias Geerinckx-Rice writes:

Toggle quote (8 lines)
> Alex Griffin 写道:
>> I've been using the updated patch for a couple weeks now without
>> issue. Maybe it's time to commit it again?
>
> Yes. I think I LGTM'd this on IRC already, but regardless: LGTM!
>
> Kind regards,

Thank you both, pushed to master as f52fe7c3f29dfd0804c9d1f297b91287eabcdfb2

janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 38809@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 38809
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch