[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/17: system: grub: Adjust eye-candy to work on non-Intel systems.
From: |
Mark H. Weaver |
Subject: |
02/17: system: grub: Adjust eye-candy to work on non-Intel systems. |
Date: |
Fri, 28 Aug 2015 15:56:03 +0000 |
mhw pushed a commit to branch wip-loongson2f
in repository guix.
commit 685f144b96138ff49c0802035876ad07d3353649
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 'setup-gfxterm-body' 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 | 45 ++++++++++++++++++++++++++++-----------------
1 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm
index 7f85adf..e0717cc 100644
--- a/gnu/system/grub.scm
+++ b/gnu/system/grub.scm
@@ -30,6 +30,7 @@
#:autoload (gnu packages imagemagick) (imagemagick)
#:autoload (gnu packages compression) (gzip)
#:use-module (ice-9 match)
+ #:use-module (ice-9 regex)
#:use-module (srfi srfi-1)
#:export (grub-image
grub-image?
@@ -152,10 +153,26 @@ 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 setup-gfxterm-body
+ ;; Intel systems need to be switched into graphics mode, whereas 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)
+ "
+ set gfxmode=640x480
+ insmod vbe
+ insmod vga
+ insmod video_bochs
+ insmod video_cirrus
+ insmod gfxterm
+ terminal_output gfxterm
+"
+ ""))
+
(define (theme-colors type)
(let* ((theme (grub-configuration-theme config))
(colors (type theme)))
@@ -163,22 +180,15 @@ all that."
(symbol->string (assoc-ref colors 'bg)))))
(mlet* %store-monad ((image (grub-background-image config)))
- (return (and image #~(format #$port "
-function load_video {
- insmod vbe
- insmod vga
- insmod video_bochs
- insmod video_cirrus
-}
+ (return (and image
+ #~(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
@@ -189,10 +199,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))))))
;;;
@@ -229,7 +240,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)
- branch wip-loongson2f created (now d6c78a5), Mark H. Weaver, 2015/08/28
- 04/17: gnu: linux-libre: Add 'supported-systems' field: Intel only for now., Mark H. Weaver, 2015/08/28
- 03/17: linux-initrd: Use pata_acpi, pata_atiixp, and isci modules only on Intel., Mark H. Weaver, 2015/08/28
- 08/17: gnu: grub: Use modify-phases and other minor cleanups., Mark H. Weaver, 2015/08/28
- 01/17: system: grub: On MIPS, the linux image name is vmlinuz, not bzImage., Mark H. Weaver, 2015/08/28
- 09/17: gnu: grub: Install documentation., Mark H. Weaver, 2015/08/28
- 06/17: gnu: linux-libre: On MIPS, the linux image name is vmlinuz, not bzImage., Mark H. Weaver, 2015/08/28
- 02/17: system: grub: Adjust eye-candy to work on non-Intel systems.,
Mark H. Weaver <=
- 12/17: TEMPORARY_HACK: gnu: qemu: Disable tests on MIPS., Mark H. Weaver, 2015/08/28
- 10/17: gnu: grub: Update to 2.02-beta2-500-gba218c1., Mark H. Weaver, 2015/08/28
- 05/17: gnu: linux-libre: Add case for ARCH=mips., Mark H. Weaver, 2015/08/28
- 16/17: NON_INTEL_ONLY: services: xorg: Remove xf86-video-intel., Mark H. Weaver, 2015/08/28
- 14/17: PRELIMINARY: system: grub: Convert grub background using rsvg-convert, not inkscape., Mark H. Weaver, 2015/08/28
- 11/17: gnu: grub: Add support for Loongson-based machines., Mark H. Weaver, 2015/08/28
- 15/17: PRELIMINARY: Attempts to get VMs working on MIPS., Mark H. Weaver, 2015/08/28
- 17/17: MIPS_ONLY: Modify installation-os for Loongson., Mark H. Weaver, 2015/08/28
- 13/17: TEMPORARY_HACK: gnu: gst-plugins-base: Disable tests on MIPS and ARM., Mark H. Weaver, 2015/08/28
- 07/17: gnu: Add linux-libre-loongson2f., Mark H. Weaver, 2015/08/28