unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brett Gilio <brettg@gnu.org>
To: Jan Nieuwenhuizen <janneke@gnu.org>
Cc: 38809@debbugs.gnu.org
Subject: [bug#38809] [PATCH] bootloader: grub: Add resolution override.
Date: Fri, 03 Jan 2020 22:39:57 -0600	[thread overview]
Message-ID: <87eewfzvfm.fsf@gnu.org> (raw)
In-Reply-To: <87lfquhzmi.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Mon, 30 Dec 2019 11:33:09 +0100")

Jan Nieuwenhuizen <janneke@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@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>

  reply	other threads:[~2020-01-04  4:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 10:33 [bug#38809] [PATCH] bootloader: grub: Add resolution override Jan Nieuwenhuizen
2020-01-04  4:39 ` Brett Gilio [this message]
2020-01-04 10:41 ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-04 11:48   ` Jan Nieuwenhuizen
2020-01-04 15:45 ` Danny Milosavljevic
2020-01-04 16:07   ` Jan Nieuwenhuizen
2020-01-05 12:27     ` Danny Milosavljevic
2020-01-07 20:29       ` bug#38809: " Jan Nieuwenhuizen
     [not found] ` <handler.38809.D38809.157842900518542.notifdone@debbugs.gnu.org>
2020-01-08  8:21   ` [bug#38809] reopened (Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.) Jan Nieuwenhuizen
2020-01-23 15:12 ` [bug#38809] [PATCH] bootloader: grub: Add resolution override Alex Griffin
2020-01-23 23:00   ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-25 15:10     ` bug#38809: " Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eewfzvfm.fsf@gnu.org \
    --to=brettg@gnu.org \
    --cc=38809@debbugs.gnu.org \
    --cc=janneke@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).