[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/15: system: grub: Adjust eye-candy to work on non-Intel systems.
From: |
Mark H. Weaver |
Subject: |
10/15: system: grub: Adjust eye-candy to work on non-Intel systems. |
Date: |
Thu, 20 Aug 2015 06:55:05 +0000 |
mhw pushed a commit to branch wip-loongson2f
in repository guix.
commit 077acb769e1a958bff069270c1acf06bb35d9c07
Author: Mark H Weaver <address@hidden>
Date: Sun Aug 9 18:45:49 2015 -0400
system: grub: Adjust eye-candy to work on non-Intel systems.
* gnu/system/grub.scm (eye-candy): Accept additional 'system' argument. Add
local 'intel?' variable. Replace the 'load_video' grub function with
'setup_gfxterm', which includes everything in the 'if loadfont' form on
Intel systems, but is empty on non-Intel.
(grub-configuration-file): Pass 'system' to 'eye-candy.
---
gnu/system/grub.scm | 36 +++++++++++++++++++++++-------------
1 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm
index 1378f5f..4e095c5 100644
--- a/gnu/system/grub.scm
+++ b/gnu/system/grub.scm
@@ -167,10 +167,14 @@ WIDTH/HEIGHT, or #f if none was found."
(with-monad %store-monad
(return #f)))))
-(define (eye-candy config port)
+(define (eye-candy config system port)
"Return in %STORE-MONAD a gexp that writes to PORT (a port-valued gexp) the
'grub.cfg' part concerned with graphics mode, background images, colors, and
all that."
+ (define intel? (or (string-prefix? "x86_64-" system)
+ (string-prefix? "i686-" system)
+ (string-prefix? "i586-" system)))
+
(define (theme-colors type)
(let* ((theme (grub-configuration-theme config))
(colors (type theme)))
@@ -178,22 +182,27 @@ all that."
(symbol->string (assoc-ref colors 'bg)))))
(mlet* %store-monad ((image (grub-background-image config)))
- (return (and image #~(format #$port "
-function load_video {
+ (return (and image
+ #~(let ((setup-gfxterm-body
+ (if #$intel?
+ "
+ set gfxmode=640x480
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
-}
+ insmod gfxterm
+ terminal_output gfxterm
+"
+ "")))
+ (format #$port "
+function setup_gfxterm {~a}
# Set 'root' to the partition that contains /gnu/store.
search --file --set ~a/share/grub/unicode.pf2
if loadfont ~a/share/grub/unicode.pf2; then
- set gfxmode=640x480
- load_video
- insmod gfxterm
- terminal_output gfxterm
+ setup_gfxterm
fi
insmod png
@@ -204,10 +213,11 @@ else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi~%"
- #$grub #$grub
- #$image
- #$(theme-colors grub-theme-color-normal)
- #$(theme-colors grub-theme-color-highlight))))))
+ setup-gfxterm-body
+ #$grub #$grub
+ #$image
+ #$(theme-colors grub-theme-color-normal)
+ #$(theme-colors grub-theme-color-highlight)))))))
;;;
@@ -244,7 +254,7 @@ entries corresponding to old generations of the system."
#$linux #$linux-image-name (string-join (list address@hidden))
#$initrd))))
- (mlet %store-monad ((sugar (eye-candy config #~port)))
+ (mlet %store-monad ((sugar (eye-candy config system #~port)))
(define builder
#~(call-with-output-file #$output
(lambda (port)
- 01/15: gnu: linux-libre: Add case for ARCH=mips., (continued)
- 01/15: gnu: linux-libre: Add case for ARCH=mips., Mark H. Weaver, 2015/08/20
- 05/15: gnu: grub: Update to 2.02-beta2-500-gba218c1., Mark H. Weaver, 2015/08/20
- 03/15: gnu: grub: Use modify-phases and other minor cleanups., Mark H. Weaver, 2015/08/20
- 02/15: gnu: Add linux-libre-loongson2f., Mark H. Weaver, 2015/08/20
- 06/15: gnu: grub: Install documentation., Mark H. Weaver, 2015/08/20
- 04/15: gnu: grub: Add comment noting that 'fuse' would be a desirable input., Mark H. Weaver, 2015/08/20
- 14/15: MIPS_ONLY: services: xorg: Remove several drivers (for Yeeloong)., Mark H. Weaver, 2015/08/20
- 13/15: MIPS_ONLY: Don't try to copy modules that don't exist in the loongson2f kernel., Mark H. Weaver, 2015/08/20
- 07/15: gnu: grub: Add support for Loongson-based machines., Mark H. Weaver, 2015/08/20
- 11/15: gnu: gst-plugins-base: Disable tests on MIPS and ARM., Mark H. Weaver, 2015/08/20
- 10/15: system: grub: Adjust eye-candy to work on non-Intel systems.,
Mark H. Weaver <=
- 15/15: MIPS_ONLY: file-systems: Remove hugetlb cgroup filesystem., Mark H. Weaver, 2015/08/20
- 12/15: PRELIMINARY: Fix problem with 'guix system init --nogrub'., Mark H. Weaver, 2015/08/20
- 09/15: system: grub: Convert grub background using rsvg-convert, not inkscape., Mark H. Weaver, 2015/08/20