From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:48930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMXKI-0000Be-PI for guix-patches@gnu.org; Fri, 03 May 2019 08:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMXKG-0004bV-Sr for guix-patches@gnu.org; Fri, 03 May 2019 08:30:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34445) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMXKE-0004XU-GV for guix-patches@gnu.org; Fri, 03 May 2019 08:30:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMXKE-00054g-Bk for guix-patches@gnu.org; Fri, 03 May 2019 08:30:02 -0400 Subject: [bug#35394] [PATCH 4/4] system: Use locale information in grub.cfg. Resent-Message-ID: Date: Fri, 3 May 2019 14:27:41 +0200 From: Miguel Message-ID: <20190503142741.10918dc2@gmail.com> In-Reply-To: <20190426125123.22f810f4@gmail.com> References: <20190426125123.22f810f4@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/5Q5JLwO37U5/0aM8vCCbsJf" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 35394@debbugs.gnu.org --MP_/5Q5JLwO37U5/0aM8vCCbsJf Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline This patch fixes the module uses. --- system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (module-declaration): Add dependencies. (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) --MP_/5Q5JLwO37U5/0aM8vCCbsJf Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0004-system-Use-locale-information-in-grub.cfg.patch =46rom d8cd9d98670570e0a29892c8988d5b84b23662d2 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Fri, 26 Apr 2019 11:58:43 +0200 Subject: [PATCH 4/4] system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (module-declaration): Add dependencies. (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 446f90157c..13f4e57414 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -3,6 +3,7 @@ ;;; Copyright =C2=A9 2016 Chris Marusich ;;; Copyright =C2=A9 2017 Leo Famulari ;;; Copyright =C2=A9 2017 Mathieu Othacehe +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ =20 (define-module (gnu bootloader grub) #:use-module (guix records) + #:use-module (guix packages) #:use-module ((guix utils) #:select (%current-system)) #:use-module (guix gexp) #:use-module (gnu artwork) @@ -28,6 +30,7 @@ #:use-module (gnu system uuid) #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) + #:use-module (gnu system locale) #:autoload (gnu packages bootloaders) (grub) #:autoload (gnu packages gtk) (guile-cairo guile-rsvg) #:autoload (gnu packages xorg) (xkeyboard-config) @@ -216,6 +219,27 @@ fi~%" #$(theme-colors grub-theme-color-normal) #$(theme-colors grub-theme-color-highlight)))) =20 +(define* (locale-config-entries config store-mount-point #:key locale port) + "Return a gexp that writes to PORT (a port-valued gexp) the +'grub.cfg' part concerned with locale configuration." + (define grub (bootloader-package + (bootloader-configuration-bootloader config))) + (define (locale-dir) + #~(let ((dir #$grub:locale)) + dir)) + (define (lang-id) + (let ((definition (locale-name->definition locale))) + (locale-definition-source definition))) + + (and locale + (member "locale" (package-outputs grub)) + #~(format #$port " +# Configure GRUB with the selected locale. +set locale_dir=3D~a +set lang=3D~a~%" + #$(strip-mount-point store-mount-point (locale-dir)) + #$(lang-id)))) + =0C ;;; ;;; Configuration file. @@ -364,6 +388,10 @@ entries corresponding to old generations of the system= ." terminal_input at_keyboard insmod keylayouts keymap ~a~%" keymap))))) + (define locale-config + (locale-config-entries config + (menu-entry-device-mount-point (first all-entri= es)) + #:locale locale #:port #~port)) =20 (define builder #~(call-with-output-file #$output @@ -374,6 +402,7 @@ keymap ~a~%" keymap))))) ") #$sugar #$keyboard-layout-config + #$locale-config (format port " set default=3D~a set timeout=3D~a~%" --=20 2.21.0 --MP_/5Q5JLwO37U5/0aM8vCCbsJf--