From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:46450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJySi-0003SY-7X for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJySe-00028O-CH for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJySY-00024u-Lo for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJySY-0004aY-D3 for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:02 -0400 Subject: [bug#35394] [PATCH 4/4] system: Use locale information in grub.cfg. References: <20190423151702.05258473@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> Resent-Message-ID: Date: Fri, 26 Apr 2019 12:51:23 +0200 From: Miguel Message-ID: <20190426125123.22f810f4@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/zmdmvC/XDq7FjUedvaItX41" 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_/zmdmvC/XDq7FjUedvaItX41 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (module-declaration): Add (gnu system locale). (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) --MP_/zmdmvC/XDq7FjUedvaItX41 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0004-system-Use-locale-information-in-grub.cfg.patch =46rom 216f818bb27d3c491681c4d67e483279c3065b2f 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 (gnu system locale). (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 446f90157c..92c33063c3 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. ;;; @@ -28,6 +29,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 +218,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 +387,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 +401,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_/zmdmvC/XDq7FjUedvaItX41--