GNU bug report logs - #38809
[PATCH] bootloader: grub: Add resolution override.

Previous Next

Package: guix-patches;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38809 in the body.
You can then email your comments to 38809 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Mon, 30 Dec 2019 10:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 30 Dec 2019 10:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] bootloader: grub: Add resolution override.
Date: Mon, 30 Dec 2019 11:33:09 +0100
[Message part 1 (text/plain, inline)]
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

[0001-bootloader-grub-Add-resolution-override.patch (text/x-patch, inline)]
From dfceb5702b0de5787f79e1098b4787e9d3adbe4e 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 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 <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))))
+  (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

[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

Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Sat, 04 Jan 2020 04:40:01 GMT) Full text and rfc822 format available.

Message #8 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Brett Gilio <brettg <at> gnu.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 38809 <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Fri, 03 Jan 2020 22:39:57 -0600
Jan Nieuwenhuizen <janneke <at> gnu.org> writes:

> 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 <at> 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 <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))))
> +  (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 <at> gnu.org> <brettg <at> posteo.net>




Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Sat, 04 Jan 2020 10:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 38809 <at> debbugs.gnu.org, Jan Nieuwenhuizen <janneke <at> gnu.org>
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Sat, 04 Jan 2020 11:41:36 +0100
[Message part 1 (text/plain, inline)]
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.

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Sat, 04 Jan 2020 11:49:02 GMT) Full text and rfc822 format available.

Message #14 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 38809 <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Sat, 04 Jan 2020 12:48:06 +0100
[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

Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Sat, 04 Jan 2020 15:46:02 GMT) Full text and rfc822 format available.

Message #17 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 38809 <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Sat, 4 Jan 2020 16:45:12 +0100
[Message part 1 (text/plain, inline)]
Hi janneke,

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

> 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.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Sat, 04 Jan 2020 16:08:01 GMT) Full text and rfc822 format available.

Message #20 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 38809 <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Sat, 04 Jan 2020 17:07:24 +0100
Danny Milosavljevic writes:

Hi Danny,

>> 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.

> 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.

> 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 <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Sun, 05 Jan 2020 12:28:01 GMT) Full text and rfc822 format available.

Message #23 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 38809 <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Sun, 5 Jan 2020 13:27:25 +0100
[Message part 1 (text/plain, inline)]
Hi janneke,

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

> 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.

[Message part 2 (application/pgp-signature, inline)]

Reply sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
You have taken responsibility. (Tue, 07 Jan 2020 20:31:01 GMT) Full text and rfc822 format available.

Notification sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
bug acknowledged by developer. (Tue, 07 Jan 2020 20:31:01 GMT) Full text and rfc822 format available.

Message #28 received at 38809-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Tobias Geerinckx-Rice <me <at> tobias.gr>, 38809-done <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Tue, 07 Jan 2020 21:29:45 +0100
Danny Milosavljevic writes:

Hi Danny, Tobias,

> Yes, it should be fine.  Thanks!  LGTM.

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

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 08 Jan 2020 06:00:02 GMT) Full text and rfc822 format available.

Removed tag(s) patch. Request was from Jan Nieuwenhuizen <janneke <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 08 Jan 2020 06:00:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Wed, 08 Jan 2020 08:22:02 GMT) Full text and rfc822 format available.

Message #35 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 38809 <at> debbugs.gnu.org
Subject: Re: bug#38809: reopened (Re: [bug#38809] [PATCH] bootloader: grub:
 Add resolution override.)
Date: Wed, 08 Jan 2020 09:21:33 +0100
[Message part 1 (text/plain, inline)]
GNU bug Tracking System writes:

Hi Tobias,

As reported by oscar123123 on irc, this broke guix pull

To reproduce:

--8<---------------cut here---------------start------------->8---
guix pull --commit=a23091880d4dc6115acbfa3b7ef09d731fc5abb0
--8<---------------cut here---------------end--------------->8---

Tobias reverted the commit (thanks!).

I found this test to also show the failure.

--8<---------------cut here---------------start------------->8---
make check TESTS=tests/guix-system.sh
--8<---------------cut here---------------end--------------->8---

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:

--8<---------------cut here---------------start------------->8---
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
--8<---------------cut here---------------end--------------->8---

This fixes make check and I also tested that

--8<---------------cut here---------------start------------->8---
guix pull --url=$PWD
--8<---------------cut here---------------end--------------->8---

now succeeds.

Greetings,
janneke

[0001-bootloader-grub-Add-gfxmode-resolution-override.patch (text/x-patch, inline)]
From 76bc0b8ef3370a4f98e63f6630c14c55613426f7 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           | 28 ++++++++++++++++++++++++++--
 gnu/bootloader/grub.scm | 19 +++++++++++++++----
 2 files changed, 41 insertions(+), 6 deletions(-)

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 <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,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

[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

Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Thu, 23 Jan 2020 15:14:01 GMT) Full text and rfc822 format available.

Message #38 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: "Alex Griffin" <a <at> ajgrf.com>
To: 38809 <at> debbugs.gnu.org
Subject: Re: [PATCH] bootloader: grub: Add resolution override.
Date: Thu, 23 Jan 2020 15:12:36 +0000
I've been using the updated patch for a couple weeks now without issue. Maybe it's time to commit it again?

-- 
Alex Griffin




Information forwarded to guix-patches <at> gnu.org:
bug#38809; Package guix-patches. (Thu, 23 Jan 2020 23:01:02 GMT) Full text and rfc822 format available.

Message #41 received at 38809 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 38809 <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Fri, 24 Jan 2020 00:00:54 +0100
[Message part 1 (text/plain, inline)]
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,

T G-R
[signature.asc (application/pgp-signature, inline)]

Reply sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
You have taken responsibility. (Sat, 25 Jan 2020 15:12:02 GMT) Full text and rfc822 format available.

Notification sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
bug acknowledged by developer. (Sat, 25 Jan 2020 15:12:02 GMT) Full text and rfc822 format available.

Message #46 received at 38809-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 38809-done <at> debbugs.gnu.org
Subject: Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Sat, 25 Jan 2020 16:10:52 +0100
Tobias Geerinckx-Rice writes:

> 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 <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Feb 2020 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.