From patchwork Wed Jan 8 08:21:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 19689 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1CD7B179BF; Wed, 8 Jan 2020 08:22:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id AB1AD1798F for ; Wed, 8 Jan 2020 08:22:10 +0000 (GMT) Received: from localhost ([::1]:39696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ip6bS-0002RX-3o for patchwork@mira.cbaines.net; Wed, 08 Jan 2020 03:22:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54904) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ip6bM-0002QA-E2 for guix-patches@gnu.org; Wed, 08 Jan 2020 03:22:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ip6bK-0005uv-Lo for guix-patches@gnu.org; Wed, 08 Jan 2020 03:22:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ip6bK-0005uq-IM for guix-patches@gnu.org; Wed, 08 Jan 2020 03:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ip6bK-0000hw-Bm for guix-patches@gnu.org; Wed, 08 Jan 2020 03:22:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38809] reopened (Re: [bug#38809] [PATCH] bootloader: grub: Add resolution override.) Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2020 08:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38809 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Tobias Geerinckx-Rice Cc: 38809@debbugs.gnu.org Received: via spool by 38809-submit@debbugs.gnu.org id=B38809.15784717182711 (code B ref 38809); Wed, 08 Jan 2020 08:22:02 +0000 Received: (at 38809) by debbugs.gnu.org; 8 Jan 2020 08:21:58 +0000 Received: from localhost ([127.0.0.1]:49729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ip6bB-0000hW-4X for submit@debbugs.gnu.org; Wed, 08 Jan 2020 03:21:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ip6b9-0000hK-51 for 38809@debbugs.gnu.org; Wed, 08 Jan 2020 03:21:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ip6b2-0005m1-GO; Wed, 08 Jan 2020 03:21:44 -0500 Received: from mx.verum.com ([31.223.170.65]:41115 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ip6b2-0002tq-5B; Wed, 08 Jan 2020 03:21:44 -0500 From: Jan Nieuwenhuizen References: <87muazt3gm.fsf@gnu.org> <87lfquhzmi.fsf@gnu.org> Date: Wed, 08 Jan 2020 09:21:33 +0100 In-Reply-To: (GNU bug Tracking System's message of "Tue, 07 Jan 2020 20:31:01 +0000") Message-ID: <87d0butl2q.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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--- --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 From 76bc0b8ef3370a4f98e63f6630c14c55613426f7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 30 Dec 2019 11:25:40 +0100 Subject: [PATCH] bootloader: grub: Add gfxmode (resolution) override. * gnu/bootloader/grub.scm (): 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 ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; ;;; 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