From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: [PATCH] system: grub: Adjust eye-candy to work on non-Intel systems Date: Sun, 23 Aug 2015 14:29:46 -0400 Message-ID: <876145x3hh.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTa24-0007t9-5i for guix-devel@gnu.org; Sun, 23 Aug 2015 14:30:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTa20-00027Y-UX for guix-devel@gnu.org; Sun, 23 Aug 2015 14:30:16 -0400 Received: from world.peace.net ([50.252.239.5]:47903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTa20-00027S-QA for guix-devel@gnu.org; Sun, 23 Aug 2015 14:30:12 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain This patch adjusts the 'eye-candy' portion of our GRUB configuration to work properly on non-Intel systems, and specially on Loongson machines. Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-system-grub-Adjust-eye-candy-to-work-on-non-Intel-sy.patch Content-Description: [PATCH] system: grub: Adjust eye-candy to work on non-Intel systems >From 943a4a9e30e1e659a6e1591e965d215bf8e8f351 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 9 Aug 2015 18:45:49 -0400 Subject: [PATCH] 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 file 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 #$@arguments)) #$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) -- 2.5.0 --=-=-=--