summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi28
-rw-r--r--gnu/bootloader/grub.scm19
2 files changed, 41 insertions, 6 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index d674b9484fa..3141c4582f8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -26101,9 +26101,22 @@ must @emph{not} be an OS device name such as @file{/dev/sda1}.
26101@end table 26101@end table
26102@end deftp 26102@end deftp
26103 26103
26104@cindex HDPI
26105@cindex HiDPI
26106@cindex resolution
26104@c FIXME: Write documentation once it's stable. 26107@c FIXME: Write documentation once it's stable.
26105For now only GRUB has theme support. GRUB themes are created using 26108For now only GRUB has theme support. GRUB themes are created using
26106the @code{grub-theme} form, which is not documented yet. 26109the @code{grub-theme} form, which is not fully documented yet.
26110
26111@deftp {Data Type} grub-theme
26112Data type representing the configuration of the GRUB theme.
26113
26114@table @asis
26115@item @code{gfxmode} (default: @code{'("auto")})
26116The GRUB @code{gfxmode} to set (a list of screen resolution strings, see
26117@pxref{gfxmode,,, grub, GNU GRUB manual}).
26118@end table
26119@end deftp
26107 26120
26108@defvr {Scheme Variable} %default-theme 26121@defvr {Scheme Variable} %default-theme
26109This is the default GRUB theme used by the operating system if no 26122This is the default GRUB theme used by the operating system if no
@@ -26114,6 +26127,17 @@ It comes with a fancy background image displaying the GNU and Guix
26114logos. 26127logos.
26115@end defvr 26128@end defvr
26116 26129
26130For example, to override the default resolution, you may use something
26131like
26132
26133@lisp
26134(bootloader
26135 (grub-configuration
26136 ;; @dots{}
26137 (theme (grub-theme
26138 (inherit %default-theme)
26139 (gfxmode '("1024x786x32" "auto"))))))
26140@end lisp
26117 26141
26118@node Invoking guix system 26142@node Invoking guix system
26119@section Invoking @code{guix system} 26143@section Invoking @code{guix system}
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index f13685ac9dd..b99f5fa4f4b 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -3,6 +3,7 @@
3;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com> 3;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
4;;; Copyright © 2017 Leo Famulari <leo@famulari.name> 4;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
5;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> 5;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
6;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6;;; 7;;;
7;;; This file is part of GNU Guix. 8;;; This file is part of GNU Guix.
8;;; 9;;;
@@ -88,7 +89,9 @@ denoting a file name."
88 (color-normal grub-theme-color-normal 89 (color-normal grub-theme-color-normal
89 (default '((fg . cyan) (bg . blue)))) 90 (default '((fg . cyan) (bg . blue))))
90 (color-highlight grub-theme-color-highlight 91 (color-highlight grub-theme-color-highlight
91 (default '((fg . white) (bg . blue))))) 92 (default '((fg . white) (bg . blue))))
93 (gfxmode grub-gfxmode
94 (default '("auto")))) ;list of string
92 95
93(define %background-image 96(define %background-image
94 (grub-image 97 (grub-image
@@ -149,8 +152,16 @@ system string---e.g., \"x86_64-linux\"."
149 ;; most other modern architectures have no other mode and therefore don't 152 ;; most other modern architectures have no other mode and therefore don't
150 ;; need to be switched. 153 ;; need to be switched.
151 (if (string-match "^(x86_64|i[3-6]86)-" system) 154 (if (string-match "^(x86_64|i[3-6]86)-" system)
152 " 155 (string-append
153 # Leave 'gfxmode' to 'auto'. 156 "
157"
158 (let ((gfxmode (and=>
159 (and=> config bootloader-configuration-theme)
160 grub-gfxmode)))
161 (if gfxmode
162 (string-append "set gfxmode=" (string-join gfxmode ";"))
163 "# Leave 'gfxmode' to 'auto'."))
164 "
154 insmod video_bochs 165 insmod video_bochs
155 insmod video_cirrus 166 insmod video_cirrus
156 insmod gfxterm 167 insmod gfxterm
@@ -166,7 +177,7 @@ system string---e.g., \"x86_64-linux\"."
166 insmod vbe 177 insmod vbe
167 insmod vga 178 insmod vga
168 fi 179 fi
169" 180")
170 "")) 181 ""))
171 182
172 (define (setup-gfxterm config font-file) 183 (define (setup-gfxterm config font-file)