unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Miguel <rosen644835@gmail.com>
To: 35394@debbugs.gnu.org
Subject: [bug#35394] [PATCH 4/4] system: Use locale information in grub.cfg.
Date: Fri, 26 Apr 2019 12:51:23 +0200	[thread overview]
Message-ID: <20190426125123.22f810f4@gmail.com> (raw)
In-Reply-To: <20190423151702.05258473@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

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(+)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-system-Use-locale-information-in-grub.cfg.patch --]
[-- Type: text/x-patch, Size: 2984 bytes --]

From 216f818bb27d3c491681c4d67e483279c3065b2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 <rosen644835@gmail.com>
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 © 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Miguel Ángel Arruga Vivas <rosen644835@gmail.com>
 ;;;
 ;;; 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))))
 
+(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=~a
+set lang=~a~%"
+                 #$(strip-mount-point store-mount-point (locale-dir))
+                 #$(lang-id))))
+
 \f
 ;;;
 ;;; 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-entries))
+                           #:locale locale #:port #~port))
 
   (define builder
     #~(call-with-output-file #$output
@@ -374,6 +401,7 @@ keymap ~a~%" keymap)))))
 ")
           #$sugar
           #$keyboard-layout-config
+          #$locale-config
           (format port "
 set default=~a
 set timeout=~a~%"
-- 
2.21.0


  parent reply	other threads:[~2019-04-26 10:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 13:17 [bug#35394] [PATCH 0/3] Bootloader localization Miguel
2019-04-23 13:26 ` [bug#35394] [PATCH 1/3] system: Add locale to boot-parameters Miguel
2019-04-23 13:26 ` [bug#35394] [PATCH 2/3] system: Provide locale information to the bootloader Miguel
2019-04-23 13:26 ` [bug#35394] [PATCH 3/3] system: Use locale information in grub.cfg Miguel
2019-04-26 10:50 ` [bug#35394] [PATCH 3/4] gnu: grub: Add locale output for bootloading Miguel
2019-05-03 12:27   ` Miguel
2019-04-26 10:51 ` Miguel [this message]
2019-05-03 12:27   ` [bug#35394] [PATCH 4/4] system: Use locale information in grub.cfg Miguel
2019-04-29  7:56 ` [bug#35394] [PATCH 0/3] Bootloader localization Ludovic Courtès
     [not found]   ` <20191021124035.531bed75@gmail.com>
2019-10-21 10:46     ` [bug#35394] [PATCH 1/3] system: Add locale to boot-parameters Miguel Arruga Vivas
2019-10-21 10:46     ` [bug#35394] [PATCH 2/3] system: Provide locale information to the bootloader Miguel Arruga Vivas
2019-10-21 10:46     ` [bug#35394] [PATCH 3/3] system: Use locale information in grub.cfg Miguel Arruga Vivas
2020-10-11 14:18 ` [bug#35394] [PATCH 1/1 v4] Grub i18n Miguel Ángel Arruga Vivas
2020-10-17 16:32   ` Ludovic Courtès
2020-10-18 15:09     ` [bug#35394] [PATCH 4/4 " Miguel Ángel Arruga Vivas
2020-10-18 15:43       ` Miguel Ángel Arruga Vivas
2020-10-19  8:50         ` Ludovic Courtès
2020-10-19 11:41           ` Miguel Ángel Arruga Vivas
2020-10-19 13:21             ` Ludovic Courtès
2020-10-19 13:44               ` Miguel Ángel Arruga Vivas
2020-10-20 20:50                 ` Ludovic Courtès
2020-10-20 21:19                   ` bug#35394: " Miguel Ángel Arruga Vivas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190426125123.22f810f4@gmail.com \
    --to=rosen644835@gmail.com \
    --cc=35394@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).