From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 0/3] Bootloader localization Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Apr 2019 13:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org X-Debbugs-Original-To: Guix-devel Received: via spool by submit@debbugs.gnu.org id=B.155602544626656 (code B ref -1); Tue, 23 Apr 2019 13:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Apr 2019 13:17:26 +0000 Received: from localhost ([127.0.0.1]:52730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvIb-0006vr-SD for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:17:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvIZ-0006vW-N8 for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:17:23 -0400 Received: from lists.gnu.org ([209.51.188.17]:50663) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIvIP-0001t6-AB for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:17:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvIN-00044U-8k for guix-patches@gnu.org; Tue, 23 Apr 2019 09:17:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIvIL-0001p0-QI for guix-patches@gnu.org; Tue, 23 Apr 2019 09:17:10 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIvIL-0001nC-5I for guix-patches@gnu.org; Tue, 23 Apr 2019 09:17:09 -0400 Received: by mail-wr1-x42a.google.com with SMTP id g3so20161634wrx.9 for ; Tue, 23 Apr 2019 06:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=88xHXOthoArGra05AlKrpaKo05jOeki3GS9dmWa1QYI=; b=dTh+PJmtHMfG+ovkxpDm8qdtB3P7lVUdNgi1mNwnaYZbwjWOH8hxUNUPDIDQorqj1N +7663WhCUyAYy07NBq4N+AZ755vlxAcsCahO5LRopizGcXDCJsPOkwrj666f171csy4b 49b9HgA8p41YOUhMHZtN80wHSeUu9p54o6OcVPAATlg6i8zfdBAWbVW8Mw0IQNBDI0F4 LOQpcLAaYXBSL2w2rOnRp+ZJIQ1s/OpOC9L4/SVcihE0FPTb4haLlyk3SlI5lrl12+MK toIEh+dv35K90+SzyRb1TsBHJsyqAkGj1umYUlrmxda9dPpDCF9t2tWdjzctkOHNVKEk 8mpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=88xHXOthoArGra05AlKrpaKo05jOeki3GS9dmWa1QYI=; b=mSPZF3rhPy1I3obRn5oXZ+Gv8wu3fuvnJx6bJh7JeaUyFMw2C3bBZ+G+csJJJdcEgy qr+/B+d3bhOAL6sGNUNmKLM2sdihRYZMyFqbOlp2nXkEZYOJcMVI6RmJwlLDrqo01lXp ArhimTY0BV+CnO2INOubbGCLiTBiOQdlb94/4pTmvPaGoOfW5L+8k0b4JQ6EBjqfaCD/ D3kh+k8e3UIijBt2ZyTxJd/WHYTJJSZLFa4atK0tjfkn/xGvUAP8jNreTe8KEAI0dYSD GQYl16hwVqzvS9s9pVlwH2r82HfO7CoZdbFnAA2tuRsN2USWGCVYIe9RjcKarYbibnI4 IjrA== X-Gm-Message-State: APjAAAWYsPbGD16epYfmAiMHUdG1+I3agD7b6OiczwVCXmQ1XbYitJrZ 25+rxmLlfeFSeH/DRquRHTaF13tljwYZVw== X-Google-Smtp-Source: APXvYqxbef4pySyIxZ+tujMmJb64DQimjY886g/3fDZGpsuUxU788FuMajqjNhNITUBU+kj0dvKhww== X-Received: by 2002:adf:ee82:: with SMTP id b2mr13083797wro.233.1556025427520; Tue, 23 Apr 2019 06:17:07 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id w11sm31180322wre.15.2019.04.23.06.17.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 06:17:07 -0700 (PDT) Date: Tue, 23 Apr 2019 15:17:02 +0200 From: Miguel Message-ID: <20190423151702.05258473@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hello Guix! As a Grub translator, I've been hacking a little bit in order to provide locale information to Grub. I use Guix in a daily basis, as my main computer operating system, and I this is a key step in order to provide a better experience to the all kind of users, who may do not know other languages than their native one. My current idea, implemented in the following patches, is something along these lines: 1. Store locale information into boot-parameters file. This patch contains a quite silly test that requires wiser review. 2. Provide this information to the bootloader at the configuration time. This, ideally, should provided at installation time too, but I'm stuck seeing my first messages in english when grub asks for the whole-disk encryption passphrase as I don't know how to create a working core.img yet. 3. Add a snippet to the generated grub.cfg file with the language information. Some configurations, as /boot in a separate partition, does not work with this patch, but take it as a proof of concept. Lacking points: 1. No support for other bootloaders yet. I don't know any of them too much, but I'm unaware of their localization support. 2. Grub installation process is not transactional enough. I have some ideas for that, to be discussed in another thread, although one key point is tightly related with this topic: /boot/grub/locale generation. Having this folder as a derivation would make explicit the dependency, but I have to work more on this and I'm open to any ideas. WDYT? Best regards, Miguel From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 1/3] system: Add locale to boot-parameters. References: <20190423151702.05258473@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Apr 2019 13:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155602599227846 (code B ref 35394); Tue, 23 Apr 2019 13:27:01 +0000 Received: (at 35394) by debbugs.gnu.org; 23 Apr 2019 13:26:32 +0000 Received: from localhost ([127.0.0.1]:52744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvRQ-0007F2-4a for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:26:32 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:40020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvRO-0007Em-9b for 35394@debbugs.gnu.org; Tue, 23 Apr 2019 09:26:31 -0400 Received: by mail-wr1-f50.google.com with SMTP id h4so20201080wre.7 for <35394@debbugs.gnu.org>; Tue, 23 Apr 2019 06:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version; bh=KFbtyZhd68nSCNRafsjnUAiwnvPu23SdiwWKyRmSW1o=; b=jYB9tvzyacpEf9MexM6FwOJ0EHq8jeHg8X66/SedZ8UflVSHKBvPzroJ+LXFEy1HpA t9xrizf5oJ1BGEZSi8ZZIqw+ZFq15NkhDJj5hIWC54nSUkzigMjs01QDKi2MdhQhflEd BLEUskTZSgRLGW12kis8BHDXDax6EwJk8VtUUqUSjpN5aRwbZ62vDcqdjnEcCfaKpQIV oSV20J1ThTbMtDSwT5hJDBfKUdLFyU2VGuiTDIJ5+VTtl+w5I7j801sNUOElvTgo+F67 HHBaFKUmADkCuMyOSooUeIuLZ1E8APIi+N9JwbL3r+64x7tptZabs+/M+0nEjuJfC1Pk CYKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=KFbtyZhd68nSCNRafsjnUAiwnvPu23SdiwWKyRmSW1o=; b=G5g3PuDEu5s/+1PckDoiFsKCE2OJFBTnXUqltQxa/ymUmtABttoCBYUHEl5QpfMlp5 rv16fQ1XiMX5UC9s9PNGDdM02Kg9PqIEYqj7JgTffQD5S/tYEjAEUIng/7My7MZ7KqmB 58AWEO673npZphExDh/fjJ2MB9bU4DoUxGJwO2u2QB6vdoWVuTyJs+8Dh/Rlwz/kiy/w V5wBGxTe5yjNLP6D1BJSNQmB6XFmw8i37IGDojleDY/mBNuT9iSd+czNeLDe+Rpt8/cn F2kl/oBvyDvJymwn7gzFFCb0ftBkYmkw+DW8C+V5h2WS5P8CUYmyGA8VUOnByGJxFm0o lCew== X-Gm-Message-State: APjAAAWXc1RJO9/IVqzTH8q/oMfnRrjVa5VDPqGG3fjHheTMgX1Ta2c4 AcaANfQmOVwPbFEoqS+0rFkU2pK63dayZg== X-Google-Smtp-Source: APXvYqycxjDDa/S1aGSy84Ktzr/BRcJjTkmV0tBa6sUXrk98BNm+hlFEvygy4oSVKaaftbIpmwtJyQ== X-Received: by 2002:a5d:52c6:: with SMTP id r6mr17855430wrv.131.1556025984235; Tue, 23 Apr 2019 06:26:24 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id z74sm26670287wmc.2.2019.04.23.06.26.23 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 06:26:23 -0700 (PDT) Date: Tue, 23 Apr 2019 15:26:20 +0200 From: Miguel Message-ID: <20190423152620.2b4fa56b@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/DwKq9TqZjIo/056tOUBUDKj" X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --MP_/DwKq9TqZjIo/056tOUBUDKj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline system: Add locale to boot-parameters. * gnu/system.scm (): New locale field. (boot-parameters-locale): New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Add locale to boot-parameters form. (opeating-system-boot-parameters-file): Add locale to file-like object. * tests/boot-parameters.scm: New test file. * Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm. --- Makefile.am | 1 + gnu/system.scm | 19 +++- tests/boot-parameters.scm | 232 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 248 insertions(+), 4 deletions(-) --MP_/DwKq9TqZjIo/056tOUBUDKj Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-system-Add-locale-to-boot-parameters.patch =46rom ca81983f4fcab05472088b181406f21c80441c57 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Mon, 22 Apr 2019 14:44:11 +0200 Subject: [PATCH 1/3] system: Add locale to boot-parameters. * gnu/system.scm (): New locale field. (boot-parameters-locale): New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Add locale to boot-parameters form. (opeating-system-boot-parameters-file): Add locale to file-like object. * tests/boot-parameters.scm: New test file. * Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm. --- Makefile.am | 1 + gnu/system.scm | 19 +++- tests/boot-parameters.scm | 232 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 248 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 99d6ed64b6..6e174588db 100644 --- a/Makefile.am +++ b/Makefile.am @@ -347,6 +347,7 @@ SCM_TESTS =3D \ tests/base16.scm \ tests/base32.scm \ tests/base64.scm \ + tests/boot-parameters.scm \ tests/channels.scm \ tests/cpan.scm \ tests/cpio.scm \ diff --git a/gnu/system.scm b/gnu/system.scm index 24243eb707..385d93150c 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2016 Chris Marusich ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2019 Meiyo Peng +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas ;;; ;;; This file is part of GNU Guix. ;;; @@ -118,6 +119,7 @@ boot-parameters-kernel boot-parameters-kernel-arguments boot-parameters-initrd + boot-parameters-locale read-boot-parameters read-boot-parameters-file boot-parameters->menu-entry @@ -251,7 +253,8 @@ directly by the user." (store-mount-point boot-parameters-store-mount-point) (kernel boot-parameters-kernel) (kernel-arguments boot-parameters-kernel-arguments) - (initrd boot-parameters-initrd)) + (initrd boot-parameters-initrd) + (locale boot-parameters-locale)) =20 (define (ensure-not-/dev device) "If DEVICE starts with a slash, return #f. This is meant to filter out @@ -329,7 +332,12 @@ file system labels." (('store ('device _) ('mount-point mount-point) _ ...) mount-point) (_ ;the old format - "/"))))) + "/"))) + + (locale + (match (assq 'locale rest) + ((_ locale) locale) + (#f #f))))) (x ;unsupported format (warning (G_ "unrecognized boot parameters at '~a'~%") (port-filename port)) @@ -973,6 +981,7 @@ parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is tru= e, add kernel arguments such as '--root' and '--load' to ." (let* ((initrd (operating-system-initrd-file os)) (store (operating-system-store-file-system os)) + (locale (operating-system-locale os)) (bootloader (bootloader-configuration-bootloader (operating-system-bootloader os))) (bootloader-name (bootloader-name bootloader)) @@ -988,7 +997,8 @@ such as '--root' and '--load' to ." (initrd initrd) (bootloader-name bootloader-name) (store-device (ensure-not-/dev (file-system-device store))) - (store-mount-point (file-system-mount-point store))))) + (store-mount-point (file-system-mount-point store)) + (locale locale)))) =20 (define (device->sexp device) "Serialize DEVICE as an sexp (really, as an object with a read syntax.)" @@ -1031,7 +1041,8 @@ being stored into the \"parameters\" file)." (store (device #$(device->sexp (boot-parameters-store-device params= ))) - (mount-point #$(boot-parameters-store-mount-point par= ams)))) + (mount-point #$(boot-parameters-store-mount-point par= ams))) + (locale #$(boot-parameters-locale params))) #:set-load-path? #f))) =20 (define-gexp-compiler (operating-system-compiler (os ) diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm new file mode 100644 index 0000000000..9ec1e6ddd3 --- /dev/null +++ b/tests/boot-parameters.scm @@ -0,0 +1,232 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +;;; Commentary: +;;; +;;; Test boot parameters value storage and compatibility. +;;; +;;; Code: + +(define-module (test-boot-parameters) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system uuid) + #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix tests) + #:use-module (srfi srfi-64) + #:use-module (rnrs bytevectors)) + +;; For whitebox testing +(define operating-system-boot-parameters + (@@ (gnu system) operating-system-boot-parameters)) + +(define %default-label "GNU with Linux-libre 99.1.2") +(define %default-kernel-path + (string-append (%store-prefix) + "/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-linux-libre-99.1.2")) +(define %default-kernel + (string-append %default-kernel-path "/" (system-linux-image-file-name))) +(define %default-kernel-arguments '()) +(define %default-initrd-path + (string-append (%store-prefix) "/wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww-initrd= ")) +(define %default-initrd (string-append %default-initrd-path "/initrd.cpio.= gz")) +(define %default-root-device (uuid "abcdef12-3456-7890-abcd-ef1234567890")) +(define %default-store-device (uuid "01234567-89ab-cdef-0123-456789abcdef"= )) +(define %default-store-mount-point (%store-prefix)) +(define %default-locale "es_ES.utf8") +(define %root-path "/") + +(define %grub-boot-parameters + (boot-parameters + (bootloader-name 'grub) + (label %default-label) + (root-device %default-root-device) + (kernel %default-kernel) + (kernel-arguments %default-kernel-arguments) + (initrd %default-initrd) + (store-device %default-store-device) + (store-mount-point %default-store-mount-point) + (locale %default-locale))) + +(define %default-operating-system + (operating-system + (host-name "host") + (timezone "Europe/Berlin") + (locale %default-locale) + + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (target "/dev/sda"))) + (file-systems (cons* (file-system + (device %default-root-device) + (mount-point %root-path) + (type "ext4")) + (file-system + (device %default-store-device) + (mount-point %default-store-mount-point) + (type "btrfs")) + %base-file-systems)))) + +(define (quote-uuid uuid) + (list 'uuid (uuid-type uuid) (uuid-bytevector uuid))) + +(define* (test-read-boot-parameters + #:key + (version 0) + (bootloader-name 'grub) + (label %default-label) + (root-device (quote-uuid %default-root-device)) + (kernel %default-kernel) + (kernel-arguments %default-kernel-arguments) + (initrd %default-initrd) + (with-store #t) + (store-device + (quote-uuid %default-store-device)) + (store-mount-point %default-store-mount-point) + (locale %default-locale)) + (define (generate-boot-parameters) + (define (sexp-or-nothing fmt val) + (cond ((eq? 'false val) (format #f fmt #f)) + (val (format #f fmt val)) + (else ""))) + (format #f "(boot-parameters ~a~a~a~a~a~a~a~a~a)" + (sexp-or-nothing "(version ~S) " version) + (sexp-or-nothing "(label ~S) " label) + (sexp-or-nothing "(root-device ~S) " root-device) + (sexp-or-nothing "(kernel ~S) " kernel) + (sexp-or-nothing "(kernel-arguments ~S) " kernel-arguments) + (sexp-or-nothing "(initrd ~S) " initrd) + (if with-store + (format #f "(store ~a~a)" + (sexp-or-nothing "(device ~S) " store-device) + (sexp-or-nothing "(mount-point ~S)" store-mount-po= int)) + "") + (sexp-or-nothing "(locale ~S) " locale) + (sexp-or-nothing "(bootloader-name ~a)" bootloader-name))) + (let ((str (generate-boot-parameters))) + (call-with-input-string str read-boot-parameters))) + +(test-begin "boot-parameters") + +;; XXX: +(test-assert "read, construction, mandatory fields" + (not (or (test-read-boot-parameters #:version #f) + (test-read-boot-parameters #:version 'false) + (test-read-boot-parameters #:version -1) + (test-read-boot-parameters #:version "0") + (test-read-boot-parameters #:root-device #f) + (test-read-boot-parameters #:kernel #f) + (test-read-boot-parameters #:label #f)))) + +(test-assert "read, construction, optional fields" + (and (test-read-boot-parameters #:bootloader-name #f) + (test-read-boot-parameters #:kernel-arguments #f) + (test-read-boot-parameters #:with-store #f) + (test-read-boot-parameters #:store-device #f) + (test-read-boot-parameters #:store-device 'false) + (test-read-boot-parameters #:store-mount-point #f) + (test-read-boot-parameters #:locale #f) + (test-read-boot-parameters #:bootloader-name #f #:kernel-arguments = #f + #:with-store #f #:locale #f))) + +;; No default case, match error +(test-error "read, construction, missing initrd" #t + (test-read-boot-parameters #:initrd #f)) + +(test-equal "read, default equality" + %grub-boot-parameters + (test-read-boot-parameters)) + +(test-equal "read, root-device, label" + (file-system-label "my-root") + (boot-parameters-root-device + (test-read-boot-parameters #:root-device '(file-system-label "my-root")= ))) + +(test-equal "read, root-device, /dev node" + "/dev/sda2" + (boot-parameters-root-device + (test-read-boot-parameters #:root-device "/dev/sda2"))) + +(test-equal "read, kernel, only store path" + %default-kernel + (boot-parameters-kernel + (test-read-boot-parameters #:kernel %default-kernel-path))) + +(test-equal "read, initrd, apply concatenation" + "/a/b" + (boot-parameters-initrd + (test-read-boot-parameters #:initrd (list 'string-append "/a" "/b")))) + +(test-eq "read, bootloader-name, default value" + 'grub + (boot-parameters-bootloader-name + (test-read-boot-parameters #:bootloader-name #f))) + +(test-eq "read, kernel-arguments, default value" + '() + (boot-parameters-kernel-arguments + (test-read-boot-parameters #:kernel-arguments #f))) + +(test-assert "read, store-device, filter /dev" + (not (boot-parameters-store-device + (test-read-boot-parameters #:store-device "/dev/sda3")))) + +(test-assert "read, no-store, filter /dev from root" + (not (boot-parameters-store-device + (test-read-boot-parameters #:root-device "/dev/sda3" #:with-store = #f)))) + +(test-assert "read, no store-device, filter /dev from root" + (not (boot-parameters-store-device + (test-read-boot-parameters #:root-device "/dev/sda3" + #:store-device #f)))) + +(test-assert "read, store-device #f, filter /dev from root" + (not (boot-parameters-store-device + (test-read-boot-parameters #:root-device "/dev/sda3" + #:store-device 'false)))) + +(test-equal "read, store-device, label (legacy)" + (file-system-label "my-store") + (boot-parameters-store-device + (test-read-boot-parameters #:store-device "my-store"))) + +(test-equal "read, store-device, from root" + %default-root-device + (boot-parameters-store-device + (test-read-boot-parameters #:with-store #f))) + +(test-equal "read, no store-mount-point, default" + %root-path + (boot-parameters-store-mount-point + (test-read-boot-parameters #:store-mount-point #f))) + +(test-equal "read, no store, default store-mount-point" + %root-path + (boot-parameters-store-mount-point + (test-read-boot-parameters #:with-store #f))) + +(test-equal "from os, locale" + %default-locale + (boot-parameters-locale + (operating-system-boot-parameters %default-operating-system + %default-root-device))) + +(test-end "boot-parameters") --=20 2.21.0 --MP_/DwKq9TqZjIo/056tOUBUDKj-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 2/3] system: Provide locale information to the bootloader. References: <20190423151702.05258473@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Apr 2019 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155602600227870 (code B ref 35394); Tue, 23 Apr 2019 13:27:02 +0000 Received: (at 35394) by debbugs.gnu.org; 23 Apr 2019 13:26:42 +0000 Received: from localhost ([127.0.0.1]:52747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvRZ-0007FR-SV for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:26:42 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:46985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvRV-0007F3-Hj for 35394@debbugs.gnu.org; Tue, 23 Apr 2019 09:26:38 -0400 Received: by mail-wr1-f46.google.com with SMTP id t17so20162833wrw.13 for <35394@debbugs.gnu.org>; Tue, 23 Apr 2019 06:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version; bh=9PRKRbNJ6H9eZygT3wFOm5TqT+4lHdN0FRI3HMtmzAQ=; b=n7paEEGpRYhaEh17B5okjVCszh4Xb6VzeDQXBrCLskJZgI7pkhT5bEo1EZJonweq1M Sh1AuFX5jvIrRINfln4mGInE9PmB6OdfYLAWIK/Gcq3xo2f+ecCDgUSR3Jl4kda2gjUo b/p6maBkX/muYpFKLTpLVE2q2ogzM7pCkZyu+7uKHh+tD1RYeNpvJ/IlGifwdliQELw7 78lnZ5YwSZTuRZMBhtBXuk8WqC289ZWFBM+zOmZem68XSKdg9Qg88IRo0E0WEFW6YEGx tesRPiyFiM1TAqtoRHsd566yHFZcxpsbjyIeU4etEobIcHTe4uXiwUkDOBlVZN0M/PIr MDOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=9PRKRbNJ6H9eZygT3wFOm5TqT+4lHdN0FRI3HMtmzAQ=; b=Yd5xXRmPmS3OwUS5wR5vHuv/xwdCHMmrCkmK0VqsrZKMivmep7o9tg9iRI75M56O2l ZAM8BqbRMDB1Kes5TugX2uWGL5raEIuGrHZYLcDJm8D7mmUO516n80uw8/SLK4QiFf/z 5LwwRhK/3o7Bw4FvigmXObwO0AYe15eV0JppeCGT5cBK5scLK3uoaMGDJ3iO6muL+4Oh UdDuSCTIITBu1pkL/NaTXr8a4Bh/E2KPNPA+EUbdRJR9D/bRUT6ZRovgRacVcgrnPPTh SMblS0v9BaWljLXgntihEW+zR5YieGdP5Q/uPxxngsna4CmEUDj9HBreBIVLEBNHzkPu NGZA== X-Gm-Message-State: APjAAAXNWlK0LEyrQiisNSiaX4vrD5WPPheh3m6gYYDXdT39u/WiN5DX E8hsyw345UpOOE4OvnGznIJ5nZ7S9FhsRw== X-Google-Smtp-Source: APXvYqx6VK+nfCz50pSFqx6xO1aoroUSvQHJmmTZEo+ZdnK7+DjzZNkzL2Iv3u/ITPM09OCjXTpplw== X-Received: by 2002:adf:fc8f:: with SMTP id g15mr16879562wrr.113.1556025991681; Tue, 23 Apr 2019 06:26:31 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id b8sm9596625wrf.21.2019.04.23.06.26.31 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 06:26:31 -0700 (PDT) Date: Tue, 23 Apr 2019 15:26:28 +0200 From: Miguel Message-ID: <20190423152628.53387a9b@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/kDlw6IwO7UlyOSGJ_Px=W.S" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --MP_/kDlw6IwO7UlyOSGJ_Px=W.S Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline system: Provide locale information to the bootloader. * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Add locale keyword. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. * gnu/bootloader/grub.scm (grub-configuration-file): Likewise. * gnu/system.scm (operating-system-bootcfg): Provide locale information to the bootloader. * guix/system/script.scm (reinstall-bootloader): Use locale information from boot-parameters. --- gnu/bootloader/depthcharge.scm | 3 ++- gnu/bootloader/extlinux.scm | 3 ++- gnu/bootloader/grub.scm | 3 ++- gnu/system.scm | 4 +++- guix/scripts/system.scm | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) --MP_/kDlw6IwO7UlyOSGJ_Px=W.S Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-system-Provide-locale-information-to-the-bootloader.patch >From e5fde74621973e54cdb2983361b90180b5367e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Mon, 22 Apr 2019 14:44:22 +0200 Subject: [PATCH 2/3] system: Provide locale information to the bootloader. * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Add locale keyword. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. * gnu/bootloader/grub.scm (grub-configuration-file): Likewise. * gnu/system.scm (operating-system-bootcfg): Provide locale information to the bootloader. * guix/system/script.scm (reinstall-bootloader): Use locale information from boot-parameters. --- gnu/bootloader/depthcharge.scm | 3 ++- gnu/bootloader/extlinux.scm | 3 ++- gnu/bootloader/grub.scm | 3 ++- gnu/system.scm | 4 +++- guix/scripts/system.scm | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gnu/bootloader/depthcharge.scm b/gnu/bootloader/depthcharge.scm index 58cc3f3932..0e0c17a255 100644 --- a/gnu/bootloader/depthcharge.scm +++ b/gnu/bootloader/depthcharge.scm @@ -82,7 +82,8 @@ (define* (depthcharge-configuration-file config entries #:key (system (%current-system)) - (old-entries '())) + (old-entries '()) + (locale #f)) (match entries ((entry) (let ((kernel (menu-entry-linux entry)) diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 40108584a8..e4ccc47484 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm @@ -28,7 +28,8 @@ (define* (extlinux-configuration-file config entries #:key (system (%current-system)) - (old-entries '())) + (old-entries '()) + (locale #f)) "Return the U-Boot configuration file corresponding to CONFIG, a object, and where the store is available at STORE-FS, a object. OLD-ENTRIES is taken to be a list of menu entries diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index e97a17b3e2..446f90157c 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -316,7 +316,8 @@ code." (define* (grub-configuration-file config entries #:key (system (%current-system)) - (old-entries '())) + (old-entries '()) + (locale #f)) "Return the GRUB configuration file corresponding to CONFIG, a object, and where the store is available at STORE-FS, a object. OLD-ENTRIES is taken to be a list of menu diff --git a/gnu/system.scm b/gnu/system.scm index 385d93150c..5732382a3a 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -962,6 +962,7 @@ entry." a list of , to populate the \"old entries\" menu." (let* ((root-fs (operating-system-root-file-system os)) (root-device (file-system-device root-fs)) + (locale (operating-system-locale os)) (params (operating-system-boot-parameters os root-device #:system-kernel-arguments? #t)) @@ -972,7 +973,8 @@ a list of , to populate the \"old entries\" menu." (bootloader-configuration-bootloader bootloader-conf))) (generate-config-file bootloader-conf (list entry) - #:old-entries old-entries))) + #:old-entries old-entries + #:locale locale))) (define* (operating-system-boot-parameters os root-device #:key system-kernel-arguments?) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 78aa6cf644..d3e0964aa9 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -492,6 +492,7 @@ STORE is an open connection to the store." ;; Make the specified system generation the default entry. (params (profile-boot-parameters %system-profile (list number))) + (locale (boot-parameters-locale params)) (old-generations (delv number (reverse (generation-numbers %system-profile)))) (old-params (profile-boot-parameters @@ -503,7 +504,8 @@ STORE is an open connection to the store." ((bootcfg (lower-object ((bootloader-configuration-file-generator bootloader) bootloader-config entries - #:old-entries old-entries))) + #:old-entries old-entries + #:locale locale))) (bootcfg-file -> (bootloader-configuration-file bootloader)) (target -> "/") (drvs -> (list bootcfg))) -- 2.21.0 --MP_/kDlw6IwO7UlyOSGJ_Px=W.S-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 3/3] system: Use locale information in grub.cfg. References: <20190423151702.05258473@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Apr 2019 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155602600627886 (code B ref 35394); Tue, 23 Apr 2019 13:27:02 +0000 Received: (at 35394) by debbugs.gnu.org; 23 Apr 2019 13:26:46 +0000 Received: from localhost ([127.0.0.1]:52750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvRe-0007Fh-Ca for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:26:46 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:44455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvRc-0007FI-5u for 35394@debbugs.gnu.org; Tue, 23 Apr 2019 09:26:45 -0400 Received: by mail-wr1-f44.google.com with SMTP id c5so11349002wrs.11 for <35394@debbugs.gnu.org>; Tue, 23 Apr 2019 06:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version; bh=cq6J+xMV6/YoCLbw/+qp3drd8apuRv8An+EngfJ/ttM=; b=G/tRb03oqNRyV2JD5ktrjT0CMEoJTWw/v4xeo3k/nVkD0/Bt/CaxCNwLPO3VWoKGqA miaOhS7cvpjcjFtDE63mzVs61lJzqQ4ROLZWGDp0Uu+NHt+7+V1OveYrcZ3oMRgcc5TT Xy4YQhhot0BmN2QjVXUkF84H81TLDzTCZA00+RQRh6pL6fceUNbhsPU3xogxkly/IXc3 u6e8Qdx3ryrnFDZ3CaDJXD1JPIOMGKZ+IIlMAF7a8Vq1523tZ8XKIXb0AWFUu/BfEjUT FCj8VjbjtndTYfIgRWIYIbe33X085IWyWZ+wsAUNcfD5qc1nyWEtgQ1tqQgVbYPh/e3u Rt3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=cq6J+xMV6/YoCLbw/+qp3drd8apuRv8An+EngfJ/ttM=; b=VDXbF5pr9/Ki6t3Oz8A1S7xbcZJZiOZv8qQNC1aEKCtW/5PuvXeXDTceYdqU1SJnCU CTpll3HyEyMzIF6EKg9aLiJMpzvvAb2HRTR7eWMqxARIMOZKA/qRj6yitE497zOGvSKk 5oBmo08BWJFlHcYEDDW7Q12peh0tIu3YauQAxU/cxrjc1qAOaPOBPjD6kVhXFxqAGX7o PibW548OXSyclwHO4p2UmLprNZT4kAQ4lT98LSFjtThIkD1fZZCxEpxiMveg5/S+hxKl oL7t95iI44Wb1Lq7P9qHd0GSLhWmbQBHiTwTItjANpq+Rj27OOAOE1TAPLgycxaf9kei qxuQ== X-Gm-Message-State: APjAAAWi2SilX3jRd73GA2pzJ0ji5qe/kMALS3DTiD9VIXjpEQYmi+L0 xxZnL990dgnvNTGvovY/FbrGU6skuCqwGQ== X-Google-Smtp-Source: APXvYqyKSkB6ZEiJev+MFE03IhdB8jlbux+uu1x9ASjVwMlUvxSbFPru9Qnxu8XdAeSTW9aHpVULDg== X-Received: by 2002:a5d:4483:: with SMTP id j3mr6231203wrq.145.1556025998133; Tue, 23 Apr 2019 06:26:38 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id z11sm14851723wmf.12.2019.04.23.06.26.37 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 06:26:37 -0700 (PDT) Date: Tue, 23 Apr 2019 15:26:35 +0200 From: Miguel Message-ID: <20190423152635.12dbc536@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/KavW6jjP_1SFvJBMk1CS2iO" X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) --MP_/KavW6jjP_1SFvJBMk1CS2iO 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 (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) --MP_/KavW6jjP_1SFvJBMk1CS2iO Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-system-Use-locale-information-in-grub.cfg.patch =46rom 762b00327be7a21ac3e04b10610666b0d323104b Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Tue, 23 Apr 2019 15:03:58 +0200 Subject: [PATCH 3/3] system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 446f90157c..81c4e31e28 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,36 @@ fi~%" #$(theme-colors grub-theme-color-normal) #$(theme-colors grub-theme-color-highlight)))) =20 +(define* (locale-config-entries config store-device 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." + ;; FIXME: /boot in a separate partition is not suported. The prefix must + ;; be removed in order to make it work. GRUB EFI installation contains = an + ;; usable /boot/efi/grub/locale/ folder too, but it is not used, for the + ;; same reason. + (define grub-locale-dir "/boot/grub/locale") + (define (grub-lang-id) + (let ((definition (locale-name->definition locale))) + (locale-definition-source definition))) + (define (grub-locale-file) + (string-append grub-locale-dir "/" (grub-lang-id) ".mo")) + + (and locale + #~(format #$port "# Configure GRUB with the selected locale. + +# Set the root for the locale file +~a + +if [ -d ~a ]; then + set locale_dir=3D~a + set lang=3D~a +fi~%" + #$(grub-root-search store-device (grub-locale-file)) + #$grub-locale-dir + #$grub-locale-dir + #$(grub-lang-id)))) + =0C ;;; ;;; Configuration file. @@ -364,6 +396,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 (first all-entries)) + (menu-entry-device-mount-point (first all-entri= es)) + #:locale locale #:port #~port)) =20 (define builder #~(call-with-output-file #$output @@ -374,6 +410,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_/KavW6jjP_1SFvJBMk1CS2iO-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 3/4] gnu: grub: Add locale output for bootloading. References: <20190423151702.05258473@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Apr 2019 10:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155627586017530 (code B ref 35394); Fri, 26 Apr 2019 10:51:01 +0000 Received: (at 35394) by debbugs.gnu.org; 26 Apr 2019 10:51:00 +0000 Received: from localhost ([127.0.0.1]:60138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyRX-0004Ye-Ru for submit@debbugs.gnu.org; Fri, 26 Apr 2019 06:51:00 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:33670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyRV-0004YR-9W for 35394@debbugs.gnu.org; Fri, 26 Apr 2019 06:50:57 -0400 Received: by mail-wm1-f53.google.com with SMTP id z6so3639653wmi.0 for <35394@debbugs.gnu.org>; Fri, 26 Apr 2019 03:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version; bh=kwFgi5YS7EbzJLvAh50FiJdOLCSVpFLxVEjVvljg9CA=; b=Xr/wLeL4Fg3l6eil08ZmwJLrftsHCqgGvvMVU3BTU6CC5Duv0LmxjiYoU1QQ0yZY0L mi05aUseu9fFamH04jmumTAtRhS8/claf2N1pjICsslCNQUWb41LgMzszgovk9U5gL9J bss68ZkjgNv0auGq/GnPv+WNeovQqVxO8BRZva8IBBDsIYbu1Zo3h2RM22qnSrW2yQGZ o52f8sh9F1tMQqqsmh5L7UAXjiSGZcyN4H6OZmShqW61jb+WfZGtEnXEoYdQvSIf1AVr OctCewSUQtKRrF6Rf1MyH4xKAG3XMDGH3Y6LAYparE/amuxGIOSbEEDWpNJmHmtn7FfC p4Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=kwFgi5YS7EbzJLvAh50FiJdOLCSVpFLxVEjVvljg9CA=; b=lmPoGeXCynrfbCJv4yp5QbPl/izZXNwCQcrX3fw2PthKLQGMEvxUKjYF+1N6jSVZLl aV+Mz0B3jNBATQjPUqFTDpF/ljVNk2hNK2MXzXW2+pTtR8l69fHNf+50sHCT0kEiG37c Exg4MwBDW9GuWJnCtF+4p46U3g4qq53l0NBTzj1pra5gACHhGEA1Ho8/nG4vR/nzR/nj 9P2m8BsIZqf0/35ZrwuKRJ4m9w8z28UT/zx6ENePpDTOer0nqSmTUoS26n4AZzqnleqp WruhgfL/W72icTtfzzjKhRoE+k8uLKOy/k//fBlb2qZJSPyFPpa9eqE9Ecu7UkXR4WQZ vPfQ== X-Gm-Message-State: APjAAAWnVwPI0Pe0/q5VEPnImej3mKaxgsgVefpfERSemR/l4qPrEMBE OiMEbKvJmKA1wC7XiW9KIgkPXae6FXs= X-Google-Smtp-Source: APXvYqx2S/yHMhX+yYBkK9hVEPk8SCSfdpVLVfu+ZNjahBUYWRKLS945EivkIdAnF67vIH0ILqMOqg== X-Received: by 2002:a1c:3d6:: with SMTP id 205mr7784303wmd.66.1556275849609; Fri, 26 Apr 2019 03:50:49 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id 204sm31060374wmc.1.2019.04.26.03.50.48 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 03:50:49 -0700 (PDT) Date: Fri, 26 Apr 2019 12:50:41 +0200 From: Miguel Message-ID: <20190426125041.4bd524e0@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/FCQAfb.sL_W8crdivlyfDtL" X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) --MP_/FCQAfb.sL_W8crdivlyfDtL Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline gnu: grub: Add locale output for bootloading. * gnu/packages/bootloaders.scm (grub): Add needed modules and new output generated with new phase 'install-locale-folder. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) --MP_/FCQAfb.sL_W8crdivlyfDtL Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0003-gnu-grub-Add-locale-output-for-bootloading.patch >From bc6e8168155ea017aece23b3a6f099de4a2d2d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Fri, 26 Apr 2019 11:56:43 +0200 Subject: [PATCH 3/4] gnu: grub: Add locale output for bootloading. * gnu/packages/bootloaders.scm (grub): Add needed modules and new output generated with new phase 'install-locale-folder. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index b4eabaea48..e3baff267d 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -94,7 +94,10 @@ "grub-efi-fat-serial-number.patch")))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases + `(#:modules ((ice-9 ftw) + (guix build utils) + (guix build gnu-build-system)) + #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-stuff (lambda* (#:key inputs #:allow-other-keys) (substitute* "grub-core/Makefile.in" @@ -127,7 +130,30 @@ (substitute* "Makefile.in" (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep") "grub_cmd_date grub_cmd_sleep")) - #t))) + #t)) + (add-after 'install 'install-locale-folder + (lambda* (#:key outputs #:allow-other-keys) + ;; XXX: Better checks are needed here + (define (lang? file) + (not (or (string=? file ".") (string=? file "..")))) + (define (make-lang-installer to) + (lambda (in-file stat flag) + (if (eq? flag 'regular) + (copy-file in-file to) + #t))) + + (let* ((out (assoc-ref outputs "out")) + (locale (string-append out "/share/locale")) + (langs (scandir locale-dir lang?)) + (locale-out (assoc-ref outputs "locale"))) + (mkdir-p locale-out) + (for-each (lambda (lang) + (let ((from (string-append locale "/" lang)) + (to (string-append out-path "/" + lang ".mo"))) + (ftw from (make-lang-installer to)))) + langs) + #t)))) ;; Disable tests on ARM and AARCH64 platforms. #:tests? ,(not (any (cute string-prefix? <> (or (%current-target-system) (%current-system))) @@ -183,6 +209,7 @@ ("parted" ,parted) ("qemu" ,qemu-minimal-2.10) ("xorriso" ,xorriso))) + (outputs '("out" "locale")) (home-page "https://www.gnu.org/software/grub/") (synopsis "GRand Unified Boot loader") (description @@ -249,8 +276,6 @@ menu to select one of the installed operating systems.") ,@(package-inputs grub-efi))) (arguments (substitute-keyword-arguments (package-arguments grub-efi) - ((#:modules modules `((guix build utils) (guix build gnu-build-system))) - `((ice-9 ftw) ,@modules)) ((#:phases phases) `(modify-phases ,phases (add-after 'install 'install-non-efi -- 2.21.0 --MP_/FCQAfb.sL_W8crdivlyfDtL-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org 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-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Apr 2019 10:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155627589517604 (code B ref 35394); Fri, 26 Apr 2019 10:52:02 +0000 Received: (at 35394) by debbugs.gnu.org; 26 Apr 2019 10:51:35 +0000 Received: from localhost ([127.0.0.1]:60142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyS7-0004Zs-96 for submit@debbugs.gnu.org; Fri, 26 Apr 2019 06:51:35 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:34263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyS6-0004Ze-8s for 35394@debbugs.gnu.org; Fri, 26 Apr 2019 06:51:34 -0400 Received: by mail-wr1-f45.google.com with SMTP id v16so1417139wrp.1 for <35394@debbugs.gnu.org>; Fri, 26 Apr 2019 03:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version; bh=aEXMf1lEG1Gq4nKTwqrLyvq/Wj9HnxpqMStu8bmuW5I=; b=WwR3T6QnKgkRh8o8A/Q1rfhcX6PFwynMAkUmowRQO0xMIO8ovU9NJeYPCVH+Cpp6du yHM9+E4GM4aFjG7QAGz7YglvwW9QtN+04Uhzf/UlzW3/cfkl2Vv4JrZU7CedhtZS0fq7 lBDDmx+WB0FlskshYwAY30yWmtb9q/HnzV+6ZIaz2lkdThWirklpP0hJxZG4KF5Gd4a+ 1cwS28r8XmaJueN4xfcd6o76Em2G91Llfz0T9l/WJx4HE+u7/Zk+LXLTZp9CyJh84k6m yFYB7/vkfl99GAc2bvpuFRM6Gy15WZtNB5zlKq6UpDYEAoJ11OTM+oZOpYBpJ8PpdRII Tn4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=aEXMf1lEG1Gq4nKTwqrLyvq/Wj9HnxpqMStu8bmuW5I=; b=Fp259MNZuEvS/zbz1wphqziwSVDgryujfic0NuK0Yf1pP00d+fkLpE3qxoXUwxFhBm npYMfNyq/ihbLYFJ+LZE488uTKkIxItrdtyMljnVOCrOz7ydQeg9qxmDHl8g/ythC4mb YchA+0fM5/Gzaw0lDoQNV5fpuzwZY4x7E0cler7/+Z14VehoKZam8C1uj4rsfczWS1Sa qYIUDSNc4NOtj8Z3yLI4EEQtHDaRvt8SlVwpv9ZoaWi9j0R1umBpEty9Y3oEBh8dCpBG SU1mWpjmgHXjSdtt/suXV4jU+5eKgDnMfRvEbCSEIY7Frqix22L+E5XwD5fj0eHTsog6 hung== X-Gm-Message-State: APjAAAWsaatF1sPdLK1I2yLy+zpshIA3X2rkvdK2V5J+v9H3HkvYmYSV S7xC6nzmGazJ8DlKWzhWF6hDTFbr/Tg= X-Google-Smtp-Source: APXvYqwWQceFlovM9hD+aC+6BOPpO+V08ZOiEyafz/vPBnJB3Os9rG1KLZ8/42+4Oe0LinRWkKiIOA== X-Received: by 2002:a5d:5382:: with SMTP id d2mr18435539wrv.78.1556275887222; Fri, 26 Apr 2019 03:51:27 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id g185sm12079639wmf.30.2019.04.26.03.51.26 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 03:51:26 -0700 (PDT) Date: Fri, 26 Apr 2019 12:51:23 +0200 From: Miguel Message-ID: <20190426125123.22f810f4@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/zmdmvC/XDq7FjUedvaItX41" X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --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-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] Bootloader localization Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Apr 2019 11:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Cc: guix-devel@gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155627636418281 (code B ref 35394); Fri, 26 Apr 2019 11:00:02 +0000 Received: (at 35394) by debbugs.gnu.org; 26 Apr 2019 10:59:24 +0000 Received: from localhost ([127.0.0.1]:60156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyZg-0004kn-Hm for submit@debbugs.gnu.org; Fri, 26 Apr 2019 06:59:24 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:34525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyZe-0004ka-Nk for 35394@debbugs.gnu.org; Fri, 26 Apr 2019 06:59:23 -0400 Received: by mail-wm1-f52.google.com with SMTP id r186so3655427wmf.1 for <35394@debbugs.gnu.org>; Fri, 26 Apr 2019 03:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YL9fpNU+vmXhfoNEG0jb84T5xkZGBURiLoFl6ezp7jc=; b=NI1P8ZnbLGtHOiPxhgzNFnQHB7UOOpmM40fdkfyukfl00nvj566eyZ/I9VzUDFjL8H /4sRs8EPgnJbzCFPssm2HTiSLYX8xYZkYN/01+MwEoUzV4F9qYqx1UDl4RRMPbh/12l/ Mlk6v9VswUJR73Ta2wODJXuEU/JkolWSaqYF52laOy2aMSrnEkg8EeBIu1AKf8VRSIYz rZWqCEEWfokPMxo5Gn9dGVO+hAGfPIWvvbFpS8TTBCej/ePEbrc1+XsBm4fjvJE9SDsd 1AjCUnz9lB3ZndY3BhNqYO0dRB0s55ep1AOi0MTpKAO4U0HTU/FxTKl+Q7+V6yHscIdD Qofw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YL9fpNU+vmXhfoNEG0jb84T5xkZGBURiLoFl6ezp7jc=; b=Mn132SoIqv/h5dDnWT0OFjpudOeI6UPzQgs7Jn7tECzFh8w7Oie403+u84qGYatFB3 UzCHXSU2K4XwdQtopAyF6i6CjE6AO7Nur+RgcpiOZd537gNBpxM+EnMthl9v6XRMPKcB O00awJ/OiUYWngN8iEJHNuKJBzYCUgWfMq1Ily8MaqQigi6HgPfRa3LsWVx6E7wZi65E a+MDLg5OxZUH+ZOkI/TuuBmD1kV7dnNXnnwPl5+/RL2DYIX7QtyCvQ4rxsczJQT7Xz8a fBLE4mj6cDFyWP07pBcWU+J+djaKq7Zu6Bc9Cd7imBTFEZJEAQulShPH3k72KWG7+ZsX mXww== X-Gm-Message-State: APjAAAXNnnb5T25VvKnZSmlQHpXI7Af9U9Dox5V2uY1TdJgfsL4Htl2z fAX5Cq8Dcc1toa0dqZDpoIQ= X-Google-Smtp-Source: APXvYqxgORJwLZJqMia/1ViySSnKnCAr5wl4rZpmMC9UZz201U3x2gCKFVjN9RcKLzIMcryBYq2xNw== X-Received: by 2002:a7b:c1cf:: with SMTP id a15mr7872641wmj.44.1556276356973; Fri, 26 Apr 2019 03:59:16 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id s10sm26270267wmh.0.2019.04.26.03.59.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 03:59:16 -0700 (PDT) Date: Fri, 26 Apr 2019 12:59:13 +0200 From: Miguel Message-ID: <20190426125913.3d8b0ab4@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> References: <20190423151702.05258473@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) Hi everybody! I've been working on these patches and I've been able to generate a derivation with the format expected by Grub during bootloading, use it in the grub.cfg file. I removed the test for the folder inside the configuration file and added a check for the "locale" output during the file generation. Maybe it is not quite elegant, but I'm open to ideas. Now there are 4 patches instead of 3. What do you think? Best regards, Miguel PS: I CC'ed the mailing list too looking for other ideas. El Tue, 23 Apr 2019 15:17:02 +0200 Miguel escribi=C3=B3: > Hello Guix! >=20 > As a Grub translator, I've been hacking a little bit in order to > provide locale information to Grub. I use Guix in a daily basis, as my > main computer operating system, and I this is a key step in order to > provide a better experience to the all kind of users, who may do not > know other languages than their native one. >=20 > My current idea, implemented in the following patches, is something > along these lines: > 1. Store locale information into boot-parameters file. This patch > contains a quite silly test that requires wiser review. > 2. Provide this information to the bootloader at the configuration > time. This, ideally, should provided at installation time too, but > I'm stuck seeing my first messages in english when grub asks for the > whole-disk encryption passphrase as I don't know how to create a > working core.img yet. > 3. Add a snippet to the generated grub.cfg file with the language > information. Some configurations, as /boot in a separate partition, > does not work with this patch, but take it as a proof of concept. >=20 > Lacking points: > 1. No support for other bootloaders yet. I don't know any of them > too much, but I'm unaware of their localization support. > 2. Grub installation process is not transactional enough. I have > some ideas for that, to be discussed in another thread, although one > key point is tightly related with this topic: /boot/grub/locale > generation. Having this folder as a derivation would make explicit > the dependency, but I have to work more on this and I'm open to any > ideas. >=20 > WDYT? >=20 > Best regards, > Miguel From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 0/3] Bootloader localization Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 Apr 2019 07:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.15565245952832 (code B ref 35394); Mon, 29 Apr 2019 07:57:01 +0000 Received: (at 35394) by debbugs.gnu.org; 29 Apr 2019 07:56:35 +0000 Received: from localhost ([127.0.0.1]:38353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL19P-0000jc-Ix for submit@debbugs.gnu.org; Mon, 29 Apr 2019 03:56:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL19N-0000jM-QH for 35394@debbugs.gnu.org; Mon, 29 Apr 2019 03:56:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hL19I-0004iV-Jf; Mon, 29 Apr 2019 03:56:28 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48480 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hL19G-0001sa-MZ; Mon, 29 Apr 2019 03:56:27 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190423151702.05258473@gmail.com> Date: Mon, 29 Apr 2019 09:56:25 +0200 In-Reply-To: <20190423151702.05258473@gmail.com> (Miguel's message of "Tue, 23 Apr 2019 15:17:02 +0200") Message-ID: <87tvehi6s6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Miguel, Miguel skribis: > As a Grub translator, I've been hacking a little bit in order to > provide locale information to Grub. I use Guix in a daily basis, as my > main computer operating system, and I this is a key step in order to > provide a better experience to the all kind of users, who may do not > know other languages than their native one. Thanks a lot for this work. FWIW, I=E2=80=99m holding off review and integration after 1.0, but I=E2=80=99m happy if someone else reviews :-), a= nd I=E2=80=99ll be really happy to see it in master once 1.0 is out. Ludo=E2=80=99. From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4] system: Use locale information in grub.cfg. Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 May 2019 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155688656519413 (code B ref 35394); Fri, 03 May 2019 12:30:02 +0000 Received: (at 35394) by debbugs.gnu.org; 3 May 2019 12:29:25 +0000 Received: from localhost ([127.0.0.1]:47981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMXJc-000533-QN for submit@debbugs.gnu.org; Fri, 03 May 2019 08:29:25 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMXJb-00052p-0Y for 35394@debbugs.gnu.org; Fri, 03 May 2019 08:29:23 -0400 Received: by mail-wr1-f66.google.com with SMTP id c12so7652672wrt.8 for <35394@debbugs.gnu.org>; Fri, 03 May 2019 05:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version; bh=+aeVL9xwdpCxZfaPThMCxNphGhPhlJsgP8xqdEgOLCc=; b=QkC7wN4+OKevoL5SbH2WmmZNW46dEQ9r5HFfi6OrbeaOf1zzzvOPMnLfcji6JpLZkO PUYkA15QEh+Atpmz5Tvai8zyioIS0DkAireiOLtn8q6eNlEeU8RAuvn0XmzBE4mK9sFo yuvyJhkPRCop+BhSgoYFuAsjipbOpLCpp7LFhvy6MRRPa5SKJ0V6f85InUM/h2FHUz8w lf8p/Mfgbe/Sgl0Z17fxDNa83aLabT0ApURMmdmzooCRx5+4ICOVVgOjUNeqU/y0l5fQ zcZFmAEFFmGwUbAv1lTfssMyXYUMYYImk6N7PnK00a5uR1JD5s8TqPQfJIZhOfpzZfxx 2YtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version; bh=+aeVL9xwdpCxZfaPThMCxNphGhPhlJsgP8xqdEgOLCc=; b=LC77BYNInGGHc3kQDgANUZCAGJIBms5KMiRUdBVk7Ms2lvoa0zdvxso85X/NcHcH1o GHWjCcxhjKK2obFJAq5RHzv3FY3M3aZnQORbFgf0Pk+h2Vy4PaBzZEW+dzFgKQXRbrOs +KcUjzyfOGK2MfnZr0d0v7H3VWCDQKyU/uHuRus7xpkN/wFdABnC8G/3zc9Y9xbv2GNp +MvotMOcmmgFQhAyLWNOtOSDrmDyLPbMFL5FdGj11Ktx/omtFWmrmS7JsGmeZ11hadRz 8Jk1p657HhNY91dE2vXaLbFAn7Kqbhs8c4FRWXlRQUI8+zTc5RRQOf2ycvhKRNGx0z8R QsOw== X-Gm-Message-State: APjAAAVn8Ulxrwuq+XLtEycOj7brzqdC4AGVolbHTzK2s8sOO6NPcuCo xTMyYOcRWTbExLYEaRNisVcG155eH88= X-Google-Smtp-Source: APXvYqxU5DRnvz0TmPMZkybn6yE8i1aeoTgS22Zt5dMIAFYYRdz3oUYI2cZc+HCs8ee2BSdC2/1dgA== X-Received: by 2002:a5d:6386:: with SMTP id p6mr7110559wru.59.1556886556699; Fri, 03 May 2019 05:29:16 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id q24sm2340370wmc.18.2019.05.03.05.29.15 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:29:16 -0700 (PDT) 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> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/5Q5JLwO37U5/0aM8vCCbsJf" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --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-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 3/4] gnu: grub: Add locale output for bootloading. Resent-From: Miguel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 May 2019 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.155688657119431 (code B ref 35394); Fri, 03 May 2019 12:30:02 +0000 Received: (at 35394) by debbugs.gnu.org; 3 May 2019 12:29:31 +0000 Received: from localhost ([127.0.0.1]:47984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMXJj-00053L-65 for submit@debbugs.gnu.org; Fri, 03 May 2019 08:29:31 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMXJh-000532-Fj for 35394@debbugs.gnu.org; Fri, 03 May 2019 08:29:30 -0400 Received: by mail-wr1-f66.google.com with SMTP id h15so1955886wrb.2 for <35394@debbugs.gnu.org>; Fri, 03 May 2019 05:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version; bh=fq6V3O3sEgZXS4Rb4uJ25ds2dhN36wdjT1SN6+VqbJM=; b=Y60M4R1NN42z0b1nOt5fWaT3Wae3v1TyS0FKR8yM2dn09HdpWjcO0DTbNEy/ouL0VC ZQaPuXl0qxQzqYGO/EgSECqoznuCrUzTv6BdGvaui0Yo1dkpV3IOa7cSXgv4Md2AGY/M 3HQbvpCDegGOXicevDP5ttrHlqvPz8rToT68DKBrlW6adWcPgKQ9Vm8XykOw2wESuidR YLcJHcsvYWwCN9TBlcj4XcEKSBpU4EJyehoR0OBOYBD0Ss94Qo70D4l5UsrxUQ/ncoih KXcF/Mdgqs37864bn6G4wnuIsPDaMhhTBaMzXBxCJFv1uiEFfq2+AvjZLWhVq4OK3Z8I +tYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version; bh=fq6V3O3sEgZXS4Rb4uJ25ds2dhN36wdjT1SN6+VqbJM=; b=j5jMbq/5yHH3544zgM8vm2NaXEB2dHY0GNzQryGYlDAL3BZ1MCdchteQxly9fb96Y7 oiOmdAndxfB6gz1cBVAkzoSoz24kxRX252UTDjf+ZzRh1bZkx65/1RwnyWvs15PGlSuB bZR+STtxaSHu1xR9OUbSt20DFNFqM6giqI1T6c9PwLoU7Vp+Zbp3AYtWergOgvm5bkEu tS30afpiCLEzcgs3M8vApK7iWRsSOsFZmtwB/RWZvDgdCJFIdXTyEm4Qw25sKma9bXJ2 vnf57NqquLc0urtLgCd1vozB3QdLPlEXpz2Vn9HZ4mZd/wLHYZ7hevXNHCRmvndHPZEO d0kQ== X-Gm-Message-State: APjAAAVqje0VMHrFeP/MlZhhWF8SCAb1mk1QhvH70NDmmUVJeGvB0yoa FYCT2VlFuT8lRwK8iEBxjJ2gJjLzQ04= X-Google-Smtp-Source: APXvYqz/FDCEUkThDcoy+V3N5Pb2S3I50+Urmwok24arhSUB3zP5C9vgetkSd7rBiKOZA9nzUSVL+w== X-Received: by 2002:adf:eb0c:: with SMTP id s12mr6459744wrn.229.1556886563797; Fri, 03 May 2019 05:29:23 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id u64sm3697907wmg.23.2019.05.03.05.29.23 for <35394@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:29:23 -0700 (PDT) Date: Fri, 3 May 2019 14:27:12 +0200 From: Miguel Message-ID: <20190503142712.5604f83f@gmail.com> In-Reply-To: <20190426125041.4bd524e0@gmail.com> References: <20190426125041.4bd524e0@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/56YE/JKCNmLlV/C4pidWz6o" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --MP_/56YE/JKCNmLlV/C4pidWz6o Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Last patches contain a couple of problems, unbound variables are fixed in the attached patch. Commit message has been reworded. ----- gnu: grub: Add locale output. * gnu/packages/bootloaders.scm (grub): Add new phase 'install-locale-folder to generate new output used for bootloader localization. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) --MP_/56YE/JKCNmLlV/C4pidWz6o Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0003-gnu-grub-Add-locale-output.patch >From d8462c2b980eb8fc5eff3d97292bffea63a89ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Fri, 26 Apr 2019 11:56:43 +0200 Subject: [PATCH 3/4] gnu: grub: Add locale output. * gnu/packages/bootloaders.scm (grub): Add new phase 'install-locale-folder to generate new output used for bootloader localization. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 6e6e69ff3b..71411ca954 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -94,7 +94,10 @@ "grub-efi-fat-serial-number.patch")))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases + `(#:modules ((ice-9 ftw) + (guix build utils) + (guix build gnu-build-system)) + #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-stuff (lambda* (#:key inputs #:allow-other-keys) (substitute* "grub-core/Makefile.in" @@ -127,7 +130,30 @@ (substitute* "Makefile.in" (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep") "grub_cmd_date grub_cmd_sleep")) - #t))) + #t)) + (add-after 'install 'install-locale-folder + (lambda* (#:key outputs #:allow-other-keys) + ;; XXX: Better checks are needed here + (define (lang? file) + (not (or (string=? file ".") (string=? file "..")))) + (define (make-lang-installer to) + (lambda (in-file stat flag) + (if (eq? flag 'regular) + (copy-file in-file to) + #t))) + + (let* ((out (assoc-ref outputs "out")) + (locale (string-append out "/share/locale")) + (langs (scandir locale lang?)) + (locale-out (assoc-ref outputs "locale"))) + (mkdir-p locale-out) + (for-each (lambda (lang) + (let ((from (string-append locale "/" lang)) + (to (string-append locale-out "/" + lang ".mo"))) + (ftw from (make-lang-installer to)))) + langs) + #t)))) ;; Disable tests on ARM and AARCH64 platforms. #:tests? ,(not (any (cute string-prefix? <> (or (%current-target-system) (%current-system))) @@ -183,6 +209,7 @@ ("parted" ,parted) ("qemu" ,qemu-minimal-2.10) ("xorriso" ,xorriso))) + (outputs '("out" "locale")) (home-page "https://www.gnu.org/software/grub/") (synopsis "GRand Unified Boot loader") (description @@ -249,8 +276,6 @@ menu to select one of the installed operating systems.") ,@(package-inputs grub-efi))) (arguments (substitute-keyword-arguments (package-arguments grub-efi) - ((#:modules modules `((guix build utils) (guix build gnu-build-system))) - `((ice-9 ftw) ,@modules)) ((#:phases phases) `(modify-phases ,phases (add-after 'install 'install-non-efi -- 2.21.0 --MP_/56YE/JKCNmLlV/C4pidWz6o-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 0/3] Bootloader localization Resent-From: Miguel Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Oct 2019 10:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Cc: guix-devel@gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.157165478023446 (code B ref 35394); Mon, 21 Oct 2019 10:47:01 +0000 Received: (at 35394) by debbugs.gnu.org; 21 Oct 2019 10:46:20 +0000 Received: from localhost ([127.0.0.1]:55788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCb-00065z-GC for submit@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:20 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCa-00065l-67 for 35394@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:16 -0400 Received: by mail-wm1-f67.google.com with SMTP id r141so2670731wme.4 for <35394@debbugs.gnu.org>; Mon, 21 Oct 2019 03:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mut/5VzMavTauuk1cv4uHT9YLHvr679sghMX230IfYc=; b=bznBH4idLw5Y3yGaZLbZMrQljU85eJ48jHvdXHHg6GPwxqAjsxMEGrVjMg6R2qRk5F 5XLZFBV1uCQMbccZ6t9C+TY6o4pDf7c6j+MWxbjIlJREkW2dUF9+4yhQQGw5WHvm7fmr mnGJNgnzrsW387h+K+nZvvzMFYJtfrvv1VCgVOyRMJjhgOThSB3oHyCYPjyDdd8vVTLK tOuQET91FnVjI9JEaROYFTdw+mZcbR2GthEZJB130QzPRXSrSgZo9j+TcwllPeAE887l zUO1WCNksYwabm6QVwc1dEFk92MrMu5IERF3wf0VERA65Uu/XZ9DB4I8yWFfwj6LzWB6 hegw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mut/5VzMavTauuk1cv4uHT9YLHvr679sghMX230IfYc=; b=QyojsCRGgCfc9vDjeV9plm5tsfPSB5F24s54Z0xuG/9lFmlRZylQcOzBmtTjSvnIh5 V7MkixF/zmGcC3rpAVSCYGQriUcVS0FviqNgneA3bhJW1GoTnPyBdUrckKEsvrsO74Fa BIg0UN5RrtkNMOwl/qy7iDYLmhp0RgreC+Kjz4SM0DceU3nTrqkaNqLjfL+/yU3MHcAx olUY9r06z2tmUr1GOpmqq2CpfS+PMMmt1v99KEV2LIEtPKeEWUKkfGIoannLxOJIFE2g MSal4e5s3BViwcZ6floIsI+GmAyoi5qYc9bnAB0d29j0qZvaqMmOgD/mUlzageeDmv1l ccnQ== X-Gm-Message-State: APjAAAX+XWJlNovBMe4PUdOag9R5omTLD9vwt53bQmFu+5MxSctBR7mv WQw0W5rbFF5KyCOyoYQD2FxewMaR X-Google-Smtp-Source: APXvYqz6fIlM5iMrngh6H1H1mTCW71Fg/sREtaDWbevoRYGhruGcTVYwmzf1u8S8gJjW/HReuZC9yA== X-Received: by 2002:a1c:a70e:: with SMTP id q14mr11616188wme.86.1571654769874; Mon, 21 Oct 2019 03:46:09 -0700 (PDT) Received: from localhost (115.201.218.87.dynamic.jazztel.es. [87.218.201.115]) by smtp.gmail.com with ESMTPSA id v6sm17475739wru.72.2019.10.21.03.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 03:46:09 -0700 (PDT) Date: Mon, 21 Oct 2019 12:40:35 +0200 From: Miguel Arruga Vivas Message-ID: <20191021124035.531bed75@gmail.com> In-Reply-To: <87tvehi6s6.fsf@gnu.org> References: <20190423151702.05258473@gmail.com> <87tvehi6s6.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Ludo=E2=80=99, El Mon, 29 Apr 2019 09:56:25 +0200 Ludovic Court=C3=A8s escribi=C3=B3: > Hi Miguel, >=20 > Thanks a lot for this work. I've been quite silent about this because I wanted to solve the issue with .mo files in a better way, but my current understanding is that the best way to go with that is to make grub installation (store-)reproducible and removing /boot altogether, so I'll open a different thread on the mailing list about that. For the moment, the patches following this mail rely on the installation of /boot/grub/locale, usually generated by grub-install. The generated grub.cfg scriptlet enables the use case for /boot in a different partition found in many other distributions (which breaks the boot when /gnu/store is encrypted in a different partition, I'm going to fill a bug for that too). I've tested them on the following machine configurations, on top of commit 5f760515c8: - grub-efi on x86_64-gnu-linux: * Encrypted partition for the whole disk. * Separate "/boot" (ext4) and "/" (ext4 and btrfs) partitions. - grub-pc on x86_64-gnu-linux: * Same as grub-efi, plus * Encrypted and different "/boot" and "/" partitions, typing manually in the console "cryptomount (hdX,msdosX)" with the "/" partition to allow grub loading the kernel image. > FWIW, I=E2=80=99m holding off review and integration after 1.0, but I=E2= =80=99m happy > if someone else reviews :-), I'm CCing the list to bring some attention onto it, I think it's on-topic enough to worth a try. The hardest part for review is the new test case, because I wanted to be 100% sure I didn't break anything. As you can see, the tested code didn't need almost any change, although I've made some changes on the test case from the last set of patches. > and I=E2=80=99ll be really happy to see it in master once 1.0 is out. I wish we'll see it in master soon. Best regards, Miguel From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 1/3] system: Add locale to boot-parameters. Resent-From: Miguel Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Oct 2019 10:47:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.157165478723464 (code B ref 35394); Mon, 21 Oct 2019 10:47:04 +0000 Received: (at 35394) by debbugs.gnu.org; 21 Oct 2019 10:46:27 +0000 Received: from localhost ([127.0.0.1]:55791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCk-00066O-3l for submit@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:26 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCg-000661-VO for 35394@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:24 -0400 Received: by mail-wm1-f68.google.com with SMTP id p7so12751688wmp.4 for <35394@debbugs.gnu.org>; Mon, 21 Oct 2019 03:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version; bh=YZLElVGqdwkZwYJKz0uxqYbMcVjiacNRw/zTQFekbxA=; b=mr8OknEI9ZbbbViQSJKfPL2DDMv5qPwlh3Um4qL9Sr2vPe+1QXnuj4EGLqdGK54AL7 x71A2XlHrdOmPEK3RlfMfikwWs3cq4z4e49GHGxTA7RPmQipaITLy8BooEn9KPqvJ2Fj nmnbFTOxGyfBxocGISC/UI1hyHTE+QsC/D9eoIsSHmEQtp8y22nxstfmtBASzBHUqDQS 5kLwRu4CFYnNOL8ZI4gLoRvzjw0n+AJcyh2H2ZQ8xRoHQaR3B0iy9wZ9CHb0ssWEaGbN dVActzsQNmv5a0N+YlCl9EGCO2Gyh2hVZ5qcGqK5HLFNRYeWmeiqSCIrnhfJJ6/jInRt n6oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version; bh=YZLElVGqdwkZwYJKz0uxqYbMcVjiacNRw/zTQFekbxA=; b=aTgYa76IaV+FUtKIhEKa9mef4O1zhtw+DC5U3eloc8cWYCdOOCLg9YvfAYy4NimRg0 ewQxkC69PGUY/Hvh2B4IjbVfYyyhfgf+oMXZa/M+RgT6ukz0uGYdPSIw6nU/8pn41Ojn Knri+ZOCX992j4L7Cc0MKEVFzYUTWqt1J6YTeCqgGLhp6pl+LiPb7OvlIvp5BZxLdPUz IN+zPT+M2ZtAPLiyth3gYcSrLYhbApxa1F2/t5sICgloB6yQNazdJWxdgUfXyaU3axei NL6j2YnNr98EQoocykWazIDDMca+r5LSEhRzTsdbq13WLN3gNAfJEy1jaRTbEOt+RfIl 61SQ== X-Gm-Message-State: APjAAAXPbDif5iVGvgNj/Nrfqs9TlKB1XnQMfr+b+3piV3TyaKiAizGS aAGAvL5ZuSuULHAWpzv/3V+inRZ7 X-Google-Smtp-Source: APXvYqzGemUeiwvlaVMPIZtfLv3kxCLVcf2SQ8+sYBnUf1HLNn0gDq4X5hlAjaSbZVHFdlm/pwCsjA== X-Received: by 2002:a1c:9cc6:: with SMTP id f189mr20020998wme.80.1571654777043; Mon, 21 Oct 2019 03:46:17 -0700 (PDT) Received: from localhost (115.201.218.87.dynamic.jazztel.es. [87.218.201.115]) by smtp.gmail.com with ESMTPSA id r13sm23889209wra.74.2019.10.21.03.46.16 for <35394@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 03:46:16 -0700 (PDT) Date: Mon, 21 Oct 2019 12:46:14 +0200 From: Miguel Arruga Vivas Message-ID: <20191021124614.58f0b232@gmail.com> In-Reply-To: <20191021124035.531bed75@gmail.com> References: <20190423151702.05258473@gmail.com> <87tvehi6s6.fsf@gnu.org> <20191021124035.531bed75@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/1zgAKbhjwDlqz7fauHIKF=r" X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --MP_/1zgAKbhjwDlqz7fauHIKF=r Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline * gnu/system.scm (define-module)[export]: Add boot-parameters-locale. ()[locale]: New field. [boot-parameters-locale]: New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Provide operating-system locale to boot-parameters record. (opeating-system-boot-parameters-file): Likewise. * Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm. * tests/boot-parameters.scm: New test file. --- Makefile.am | 1 + gnu/system.scm | 19 ++- tests/boot-parameters.scm | 250 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 266 insertions(+), 4 deletions(-) create mode 100644 tests/boot-parameters.scm --MP_/1zgAKbhjwDlqz7fauHIKF=r Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-system-Add-locale-to-boot-parameters.patch =46rom 7a811fae4f44c279f773a9ad8201f61edab100f6 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Mon, 21 Oct 2019 12:23:40 +0200 Subject: [PATCH 1/3] system: Add locale to boot-parameters. * gnu/system.scm (define-module)[export]: Add boot-parameters-locale. ()[locale]: New field. [boot-parameters-locale]: New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Provide operating-system locale to boot-parameters record. (opeating-system-boot-parameters-file): Likewise. * Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm. * tests/boot-parameters.scm: New test file. --- Makefile.am | 1 + gnu/system.scm | 19 ++- tests/boot-parameters.scm | 250 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 266 insertions(+), 4 deletions(-) create mode 100644 tests/boot-parameters.scm diff --git a/Makefile.am b/Makefile.am index 36767c2f47..6784ecea81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -384,6 +384,7 @@ SCM_TESTS =3D \ tests/build-utils.scm \ tests/cache.scm \ tests/challenge.scm \ + tests/boot-parameters.scm \ tests/channels.scm \ tests/combinators.scm \ tests/containers.scm \ diff --git a/gnu/system.scm b/gnu/system.scm index a353b1a5c8..be49724bc3 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2016 Chris Marusich ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2019 Meiyo Peng +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas ;;; ;;; This file is part of GNU Guix. ;;; @@ -122,6 +123,7 @@ boot-parameters-kernel boot-parameters-kernel-arguments boot-parameters-initrd + boot-parameters-locale read-boot-parameters read-boot-parameters-file boot-parameters->menu-entry @@ -258,7 +260,8 @@ directly by the user." (store-mount-point boot-parameters-store-mount-point) (kernel boot-parameters-kernel) (kernel-arguments boot-parameters-kernel-arguments) - (initrd boot-parameters-initrd)) + (initrd boot-parameters-initrd) + (locale boot-parameters-locale)) =20 (define (ensure-not-/dev device) "If DEVICE starts with a slash, return #f. This is meant to filter out @@ -341,7 +344,12 @@ file system labels." (('store ('device _) ('mount-point mount-point) _ ...) mount-point) (_ ;the old format - "/"))))) + "/"))) + + (locale + (match (assq 'locale rest) + ((_ locale) locale) + (#f #f))))) (x ;unsupported format (warning (G_ "unrecognized boot parameters at '~a'~%") (port-filename port)) @@ -1008,6 +1016,7 @@ parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is t= rue, add kernel arguments such as '--root' and '--load' to ." (let* ((initrd (operating-system-initrd-file os)) (store (operating-system-store-file-system os)) + (locale (operating-system-locale os)) (bootloader (bootloader-configuration-bootloader (operating-system-bootloader os))) (bootloader-name (bootloader-name bootloader)) @@ -1025,7 +1034,8 @@ such as '--root' and '--load' to ." (bootloader-menu-entries (bootloader-configuration-menu-entries (operating-system-bootloader = os))) (store-device (ensure-not-/dev (file-system-device store))) - (store-mount-point (file-system-mount-point store))))) + (store-mount-point (file-system-mount-point store)) + (locale locale)))) =20 (define (device->sexp device) "Serialize DEVICE as an sexp (really, as an object with a read syntax.)" @@ -1073,7 +1083,8 @@ being stored into the \"parameters\" file)." (store (device #$(device->sexp (boot-parameters-store-device params= ))) - (mount-point #$(boot-parameters-store-mount-point par= ams)))) + (mount-point #$(boot-parameters-store-mount-point par= ams))) + (locale #$(boot-parameters-locale params))) #:set-load-path? #f))) =20 (define-gexp-compiler (operating-system-compiler (os ) diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm new file mode 100644 index 0000000000..3746502498 --- /dev/null +++ b/tests/boot-parameters.scm @@ -0,0 +1,250 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +;;; Commentary: +;;; +;;; Test boot parameters value storage and compatibility. +;;; +;;; Code: + +(define-module (test-boot-parameters) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system uuid) + #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix tests) + #:use-module (srfi srfi-64) + #:use-module (rnrs bytevectors)) + +(define %default-label "GNU with Linux-libre 99.1.2") +(define %default-kernel-path + (string-append (%store-prefix) + "/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-linux-libre-99.1.2")) +(define %default-kernel + (string-append %default-kernel-path "/" (system-linux-image-file-name))) +(define %default-kernel-arguments '()) +(define %default-initrd-path + (string-append (%store-prefix) "/wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww-initrd= ")) +(define %default-initrd (string-append %default-initrd-path "/initrd.cpio.= gz")) +(define %default-root-device (uuid "abcdef12-3456-7890-abcd-ef1234567890")) +(define %default-store-device (uuid "01234567-89ab-cdef-0123-456789abcdef"= )) +(define %default-store-mount-point (%store-prefix)) +(define %default-locale "es_ES.utf8") +(define %root-path "/") + +(define %grub-boot-parameters + (boot-parameters + (bootloader-name 'grub) + (bootloader-menu-entries '()) + (label %default-label) + (root-device %default-root-device) + (kernel %default-kernel) + (kernel-arguments %default-kernel-arguments) + (initrd %default-initrd) + (store-device %default-store-device) + (store-mount-point %default-store-mount-point) + (locale %default-locale))) + +(define %default-operating-system + (operating-system + (host-name "host") + (timezone "Europe/Berlin") + (locale %default-locale) + + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (target "/dev/sda"))) + (file-systems (cons* (file-system + (device %default-root-device) + (mount-point %root-path) + (type "ext4")) + (file-system + (device %default-store-device) + (mount-point %default-store-mount-point) + (type "btrfs")) + %base-file-systems)))) + +(define (quote-uuid uuid) + (list 'uuid (uuid-type uuid) (uuid-bytevector uuid))) + +;; Call read-boot-parameters with the desired string as input. +(define* (test-read-boot-parameters + #:key + (version 0) + (bootloader-name 'grub) + (bootloader-menu-entries '()) + (label %default-label) + (root-device (quote-uuid %default-root-device)) + (kernel %default-kernel) + (kernel-arguments %default-kernel-arguments) + (initrd %default-initrd) + (with-store #t) + (store-device + (quote-uuid %default-store-device)) + (store-mount-point %default-store-mount-point) + (locale %default-locale)) + (define (generate-boot-parameters) + (define (sexp-or-nothing fmt val) + (cond ((eq? 'false val) (format #f fmt #f)) + (val (format #f fmt val)) + (else ""))) + (format #f "(boot-parameters~a~a~a~a~a~a~a~a~a~a)" + (sexp-or-nothing " (version ~S)" version) + (sexp-or-nothing " (label ~S)" label) + (sexp-or-nothing " (root-device ~S)" root-device) + (sexp-or-nothing " (kernel ~S)" kernel) + (sexp-or-nothing " (kernel-arguments ~S)" kernel-arguments) + (sexp-or-nothing " (initrd ~S)" initrd) + (if with-store + (format #f " (store~a~a)" + (sexp-or-nothing " (device ~S)" store-device) + (sexp-or-nothing " (mount-point ~S)" + store-mount-point)) + "") + (sexp-or-nothing " (locale ~S)" locale) + (sexp-or-nothing " (bootloader-name ~a)" bootloader-name) + (sexp-or-nothing " (bootloader-menu-entries ~S)" + bootloader-menu-entries))) + (let ((str (generate-boot-parameters))) + (call-with-input-string str read-boot-parameters))) + +(test-begin "boot-parameters") + +;; XXX: +(test-assert "read, construction, mandatory fields" + (not (or (test-read-boot-parameters #:version #f) + (test-read-boot-parameters #:version 'false) + (test-read-boot-parameters #:version -1) + (test-read-boot-parameters #:version "0") + (test-read-boot-parameters #:root-device #f) + (test-read-boot-parameters #:kernel #f) + (test-read-boot-parameters #:label #f)))) + +(test-assert "read, construction, optional fields" + (and (test-read-boot-parameters #:bootloader-name #f) + (test-read-boot-parameters #:bootloader-menu-entries #f) + (test-read-boot-parameters #:kernel-arguments #f) + (test-read-boot-parameters #:with-store #f) + (test-read-boot-parameters #:store-device #f) + (test-read-boot-parameters #:store-device 'false) + (test-read-boot-parameters #:store-mount-point #f) + (test-read-boot-parameters #:locale #f) + (test-read-boot-parameters #:bootloader-name #f #:kernel-arguments = #f + #:with-store #f #:locale #f))) + +(test-equal "read, default equality" + %grub-boot-parameters + (test-read-boot-parameters)) + +(test-equal "read, root-device, label" + (file-system-label "my-root") + (boot-parameters-root-device + (test-read-boot-parameters #:root-device '(file-system-label "my-root")= ))) + +(test-equal "read, root-device, /dev node" + "/dev/sda2" + (boot-parameters-root-device + (test-read-boot-parameters #:root-device "/dev/sda2"))) + +(test-equal "read, kernel, only store path" + %default-kernel + (boot-parameters-kernel + (test-read-boot-parameters #:kernel %default-kernel-path))) + +(test-equal "read, kernel, full-path" + %default-kernel + (boot-parameters-kernel + (test-read-boot-parameters #:kernel %default-kernel))) + +;; XXX: No default case, match error. +(test-error "read, construction, missing initrd" #t + (test-read-boot-parameters #:initrd #f)) + +(test-equal "read, initrd, old format" + "/a/b" + (boot-parameters-initrd + (test-read-boot-parameters #:initrd (list 'string-append "/a" "/b")))) + + ;; Compatibility reasons specified in gnu/system.scm. +(test-eq "read, bootloader-name, default value" + 'grub + (boot-parameters-bootloader-name + (test-read-boot-parameters #:bootloader-name #f))) + +(test-eq "read, bootloader-menu-entries, default value" + '() + (boot-parameters-bootloader-menu-entries + (test-read-boot-parameters #:bootloader-menu-entries #f))) + +(test-eq "read, kernel-arguments, default value" + '() + (boot-parameters-kernel-arguments + (test-read-boot-parameters #:kernel-arguments #f))) + +(test-assert "read, store-device, filter /dev" + (not (boot-parameters-store-device + (test-read-boot-parameters #:store-device "/dev/sda3")))) + +(test-assert "read, no-store, filter /dev from root" + (not (boot-parameters-store-device + (test-read-boot-parameters #:root-device "/dev/sda3" #:with-store = #f)))) + +(test-assert "read, no store-device, filter /dev from root" + (not (boot-parameters-store-device + (test-read-boot-parameters #:root-device "/dev/sda3" + #:store-device #f)))) + +(test-assert "read, store-device #f, filter /dev from root" + (not (boot-parameters-store-device + (test-read-boot-parameters #:root-device "/dev/sda3" + #:store-device 'false)))) + +(test-equal "read, store-device, label (legacy)" + (file-system-label "my-store") + (boot-parameters-store-device + (test-read-boot-parameters #:store-device "my-store"))) + +(test-equal "read, store-device, from root" + %default-root-device + (boot-parameters-store-device + (test-read-boot-parameters #:with-store #f))) + +(test-equal "read, no store-mount-point, default" + %root-path + (boot-parameters-store-mount-point + (test-read-boot-parameters #:store-mount-point #f))) + +(test-equal "read, no store, default store-mount-point" + %root-path + (boot-parameters-store-mount-point + (test-read-boot-parameters #:with-store #f))) + +;; For whitebox testing +(define operating-system-boot-parameters + (@@ (gnu system) operating-system-boot-parameters)) + +(test-equal "from os, locale" + %default-locale + (boot-parameters-locale + (operating-system-boot-parameters %default-operating-system + %default-root-device))) + +(test-end "boot-parameters") --=20 2.23.0 --MP_/1zgAKbhjwDlqz7fauHIKF=r-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 2/3] system: Provide locale information to the bootloader. Resent-From: Miguel Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Oct 2019 10:47:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.157165479623488 (code B ref 35394); Mon, 21 Oct 2019 10:47:07 +0000 Received: (at 35394) by debbugs.gnu.org; 21 Oct 2019 10:46:36 +0000 Received: from localhost ([127.0.0.1]:55794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCu-00066l-3Y for submit@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:36 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCr-00066X-Ot for 35394@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:34 -0400 Received: by mail-wr1-f65.google.com with SMTP id r1so3563241wrs.9 for <35394@debbugs.gnu.org>; Mon, 21 Oct 2019 03:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version; bh=ccvcyWmJD53fWyZGiSsogyeH+wneEysCXLuXB6hqyHA=; b=ElfwpN1Z4R78QqPSZtEzNwQPIJe9J3njFscWLUWjmsrV5STqhwgQ2xLLNNT3JgxwHX WNoj5BIe37TkiqtBAmEqGKPaodt85VygXZjwHJxS60X8idgfwRetFxwm2gFiDlVYrlOX yBPKM9ztP6JA5kzxRDiChzS0vUbhTIemdlrWib488s3bP5BrGssbeYfQrqL18pHVbSZl Yjm1M9K8mMTcRKKBi3UfHp6S2aRjOMH+KBWKPiZSzlyFZRGU1xDH4XnuF/jA5P4ZzaoT UOvoC5yiFGMfsaw2IJA+izN+MDVo1UvUOtxBa/tQqQhsRlBIsYxUAH9u5NfsLOdxtGVV ceJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version; bh=ccvcyWmJD53fWyZGiSsogyeH+wneEysCXLuXB6hqyHA=; b=qkQlVZKoyjAvsrp9RVYB7fpoj6zxq5yufNNKlzxrp80Y0hLzR22rQgKb5+putcXkMp QprhO8piS9vt31joDmCd/c0IY2LC9JS2G/6HCRw7vcGHWA5iHBJSFTOqu7EigeRRDBaw thCl/W/v3c0j5VzymJXtjQNG54riIoAonQp5P9yYM1c/jaSgIZb7XTl3BXXDkvVnW55Q UiA9W/mnJQ9/IpW4Qbso0dnFQ3vFtJfW51RceSFJE+2QjBoX9fRqyY02aiM873ZRbDXW asl8dTfiELr6I9xhd9gVM5UsSTeBydcjnPHJV6KMJb7bEHzb/YtOCwl6W6TgPi34JL3b 96JQ== X-Gm-Message-State: APjAAAVX/ZdMNXOyTLXPrfaSUmN+HexHVllF7ZnwSVNiH92otY6z3+9C Kueh6VePeS0R5lS18r6MiKtvbz2D X-Google-Smtp-Source: APXvYqyU6tNXYRg6nxb6RC09Tegr4InHwo6IYpGgBhlPEVojDBV3+/REk5u4igVbhBA5rHWAhuXKIQ== X-Received: by 2002:adf:e542:: with SMTP id z2mr18086247wrm.338.1571654787594; Mon, 21 Oct 2019 03:46:27 -0700 (PDT) Received: from localhost (115.201.218.87.dynamic.jazztel.es. [87.218.201.115]) by smtp.gmail.com with ESMTPSA id v10sm7358151wrm.26.2019.10.21.03.46.27 for <35394@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 03:46:27 -0700 (PDT) Date: Mon, 21 Oct 2019 12:46:24 +0200 From: Miguel Arruga Vivas Message-ID: <20191021124624.6c7c470a@gmail.com> In-Reply-To: <20191021124035.531bed75@gmail.com> References: <20190423151702.05258473@gmail.com> <87tvehi6s6.fsf@gnu.org> <20191021124035.531bed75@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/=FGee3pDSmn/OGXoU=l=HU8" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --MP_/=FGee3pDSmn/OGXoU=l=HU8 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Add locale keyword. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. * gnu/bootloader/grub.scm (grub-configuration-file): Likewise. * gnu/system.scm (operating-system-bootcfg): Provide locale information to the bootloader. * guix/system/script.scm (reinstall-bootloader): Use locale information from boot-parameters. --- gnu/bootloader/depthcharge.scm | 3 ++- gnu/bootloader/extlinux.scm | 3 ++- gnu/bootloader/grub.scm | 3 ++- gnu/system.scm | 4 +++- guix/scripts/system.scm | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) --MP_/=FGee3pDSmn/OGXoU=l=HU8 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-system-Provide-locale-information-to-the-bootloader.patch >From 4b3e52ff532b93611893a60a02d3fe21dca98276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Mon, 22 Apr 2019 14:44:22 +0200 Subject: [PATCH 2/3] system: Provide locale information to the bootloader. * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Add locale keyword. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. * gnu/bootloader/grub.scm (grub-configuration-file): Likewise. * gnu/system.scm (operating-system-bootcfg): Provide locale information to the bootloader. * guix/system/script.scm (reinstall-bootloader): Use locale information from boot-parameters. --- gnu/bootloader/depthcharge.scm | 3 ++- gnu/bootloader/extlinux.scm | 3 ++- gnu/bootloader/grub.scm | 3 ++- gnu/system.scm | 4 +++- guix/scripts/system.scm | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gnu/bootloader/depthcharge.scm b/gnu/bootloader/depthcharge.scm index 58cc3f3932..0e0c17a255 100644 --- a/gnu/bootloader/depthcharge.scm +++ b/gnu/bootloader/depthcharge.scm @@ -82,7 +82,8 @@ (define* (depthcharge-configuration-file config entries #:key (system (%current-system)) - (old-entries '())) + (old-entries '()) + (locale #f)) (match entries ((entry) (let ((kernel (menu-entry-linux entry)) diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 40108584a8..e4ccc47484 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm @@ -28,7 +28,8 @@ (define* (extlinux-configuration-file config entries #:key (system (%current-system)) - (old-entries '())) + (old-entries '()) + (locale #f)) "Return the U-Boot configuration file corresponding to CONFIG, a object, and where the store is available at STORE-FS, a object. OLD-ENTRIES is taken to be a list of menu entries diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index d984d5f5e3..a0d068d1bd 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -316,7 +316,8 @@ code." (define* (grub-configuration-file config entries #:key (system (%current-system)) - (old-entries '())) + (old-entries '()) + (locale #f)) "Return the GRUB configuration file corresponding to CONFIG, a object, and where the store is available at STORE-FS, a object. OLD-ENTRIES is taken to be a list of menu diff --git a/gnu/system.scm b/gnu/system.scm index be49724bc3..00f24f2e39 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -997,6 +997,7 @@ entry." a list of , to populate the \"old entries\" menu." (let* ((root-fs (operating-system-root-file-system os)) (root-device (file-system-device root-fs)) + (locale (operating-system-locale os)) (params (operating-system-boot-parameters os root-device #:system-kernel-arguments? #t)) @@ -1007,7 +1008,8 @@ a list of , to populate the \"old entries\" menu." (bootloader-configuration-bootloader bootloader-conf))) (generate-config-file bootloader-conf (list entry) - #:old-entries old-entries))) + #:old-entries old-entries + #:locale locale))) (define* (operating-system-boot-parameters os root-device #:key system-kernel-arguments?) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 27b014db68..f008405115 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -386,6 +386,7 @@ STORE is an open connection to the store." ;; Make the specified system generation the default entry. (params (first (profile-boot-parameters %system-profile (list number)))) + (locale (boot-parameters-locale params)) (old-generations (delv number (reverse (generation-numbers %system-profile)))) (old-params (profile-boot-parameters @@ -398,7 +399,8 @@ STORE is an open connection to the store." ((bootcfg (lower-object ((bootloader-configuration-file-generator bootloader) bootloader-config entries - #:old-entries old-entries))) + #:old-entries old-entries + #:locale locale))) (drvs -> (list bootcfg))) (mbegin %store-monad (show-what-to-build* drvs) -- 2.23.0 --MP_/=FGee3pDSmn/OGXoU=l=HU8-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 3/3] system: Use locale information in grub.cfg. Resent-From: Miguel Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Oct 2019 10:47:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.157165480823512 (code B ref 35394); Mon, 21 Oct 2019 10:47:08 +0000 Received: (at 35394) by debbugs.gnu.org; 21 Oct 2019 10:46:48 +0000 Received: from localhost ([127.0.0.1]:55797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVD6-00067A-Hr for submit@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:48 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMVCz-00066m-ED for 35394@debbugs.gnu.org; Mon, 21 Oct 2019 06:46:42 -0400 Received: by mail-wm1-f66.google.com with SMTP id b24so12246068wmj.5 for <35394@debbugs.gnu.org>; Mon, 21 Oct 2019 03:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version; bh=sakVTWkJXPVEDpMeLO0vjsyK6THjTeWJhhQyj1zRDfI=; b=RlZxbahshq29VOfrExeuUgVWMId5yQ9XF5GcT+BN7iCi1A8hUeghtj4vvdYp1xXMyM MT7pL4zSG8ghUOtNb/4l+B6TpcWKkfPAiPIgkRnnRQQBg61f+tJMjO4vtcjcYKTVz1tB AtstE3q9ENC0b14adTd/4LfTJ6Jnp8qrLmdmge0oJmYFYPKx8yd3Ot+FZh0SqEprHX+T pMnJgnmrC+ad+S6ITEPBoCmnRMzM48jeRznTwLVDOMWdhZ6vCDNYCokNHvaV4nDj0t3X 4c0CqKkwDDAGJI7t4RgvJxGAT5krer3k10Fqcypm596gT2WrI6yY00c1XzaKHO2SaVxM tFVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version; bh=sakVTWkJXPVEDpMeLO0vjsyK6THjTeWJhhQyj1zRDfI=; b=uTMhOi/t9o/gL47E34TNiGUadIORniTlr+xS24tPCgYs9pdy345VP6L4QUpTlTzxeR OXtJAz4o/FGUrFNGKp3lnoCjnFDdsT4TS3nWYbluIH/Njo/P78QHJW8gamOszYRO3tzq C9yotw9n/8vM6c+m1YN9IFUEP5Yp3BYZcVYJZHzxBrv9VKSzRW8Z96/au1GO1iaCjqcA a4nITjLlvg/13Gut29qI1L5o+gyOEss7h/9EDcwkfPl/lkssN9vO649oy5wc49Mi8lKK FQ6BSw5KwSx9r09bpKqO6ZdX1KnKxhHb8gxO3eaOP9r69dZsht3jHUmYFjqn9NzmXdH6 1Z9A== X-Gm-Message-State: APjAAAU4zNts+d68+ddauxgteBoq3H2dUBwdmanWkeK6+g+FJSf7kV8b Hm1yA/TiNe2sZqq4BYG6MPWg/u+Q X-Google-Smtp-Source: APXvYqzplmGKudrHveto0i/YfG5ROPUsduNKHqIv5MU6tOdjALuORS1J5W8CYO+BdsH2EDesySB78A== X-Received: by 2002:a05:600c:294b:: with SMTP id n11mr2811038wmd.70.1571654795520; Mon, 21 Oct 2019 03:46:35 -0700 (PDT) Received: from localhost (115.201.218.87.dynamic.jazztel.es. [87.218.201.115]) by smtp.gmail.com with ESMTPSA id y1sm17517515wrw.6.2019.10.21.03.46.34 for <35394@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 03:46:35 -0700 (PDT) Date: Mon, 21 Oct 2019 12:46:32 +0200 From: Miguel Arruga Vivas Message-ID: <20191021124632.7d050b48@gmail.com> In-Reply-To: <20191021124035.531bed75@gmail.com> References: <20190423151702.05258473@gmail.com> <87tvehi6s6.fsf@gnu.org> <20191021124035.531bed75@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/g=pHJe/AVP+KS7UByP6eWng" X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --MP_/g=pHJe/AVP+KS7UByP6eWng Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline * gnu/bootloader/grub.scm (define-module): Add new dependency. (grub-configuration-file)[locale-config]: New variable with generated locale configuration when locale parameter has been provided. [builder]: Add locale-config. --- gnu/bootloader/grub.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --MP_/g=pHJe/AVP+KS7UByP6eWng Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-system-Use-locale-information-in-grub.cfg.patch =46rom c5f4f7d0d3564731dc29f563b70a05ab83eec061 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Sat, 19 Oct 2019 13:28:48 +0200 Subject: [PATCH 3/3] system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (define-module): Add new dependency. (grub-configuration-file)[locale-config]: New variable with generated locale configuration when locale parameter has been provided. [builder]: Add locale-config. --- gnu/bootloader/grub.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index a0d068d1bd..8c3bab6fa7 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) @@ -353,6 +355,20 @@ entries corresponding to old generations of the system= ." #:system system #:port #~port)) =20 + (define locale-config + #~(let ((locale #$(and locale + (locale-definition-source + (locale-name->definition locale))))) + (when locale + (format port "\ +# Localization configuration. +if search --file --set boot_partition /grub/grub.cfg; then + set locale_dir=3D(${boot_partition})/grub/locale +else + set locale_dir=3D/boot/grub/locale +fi +set lang=3D~a~%" locale)))) + (define keyboard-layout-config (let ((layout (bootloader-configuration-keyboard-layout config)) (grub (bootloader-package @@ -372,6 +388,7 @@ keymap ~a~%" keymap))))) # will be lost upon reconfiguration. ") #$sugar + #$locale-config #$keyboard-layout-config (format port " set default=3D~a --=20 2.23.0 --MP_/g=pHJe/AVP+KS7UByP6eWng-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 1/1 v4] Grub i18n Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Oct 2020 14:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160242598229006 (code B ref 35394); Sun, 11 Oct 2020 14:20:02 +0000 Received: (at 35394) by debbugs.gnu.org; 11 Oct 2020 14:19:42 +0000 Received: from localhost ([127.0.0.1]:40761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRcCH-0007Xh-01 for submit@debbugs.gnu.org; Sun, 11 Oct 2020 10:19:42 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRcCF-0007XR-1K for 35394@debbugs.gnu.org; Sun, 11 Oct 2020 10:19:35 -0400 Received: by mail-wm1-f67.google.com with SMTP id e23so7694529wme.2 for <35394@debbugs.gnu.org>; Sun, 11 Oct 2020 07:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=BuCgTFG1mYQgQ/S1TVOz9aktV34B32KHMW7cPO2DesQ=; b=lZsp0PTynuijws846JgFJ8b2dL5029/jBR7juzJEPmaUuvTjL1eAvMARLdPzVP0kzF 85nfNrlWnQ+Gfd7j44zOMUAgl6PlBEn7q3wkoGR3gPN+ydoLbPREshb12azZ05zUiobg 0Y/Pwr89oUkxnYcdpvIXUXCN35r/5A+k5BppmsAo7hrrf/e5ebg+XNS++ZTOe5b+2DYh Q7SxpXPO/AcZet1xeLa6ZCUXANryuwdl9PvHx2PpmS0gLgCK+M+UjdZJ6yWwexrcrak4 VWrfqNtZVvruRAw0Wi54w7u65O2UyQx3Itg9NO1MYZsokevqeL1UDu7QWDIBTMDB0Uua XPFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=BuCgTFG1mYQgQ/S1TVOz9aktV34B32KHMW7cPO2DesQ=; b=Nwgr+mBzN4wFPM4L+jw0MhkF8rLM25JIcfb1v/gVoYxNYYZIF3UHyjF8S5F1wIn+Fe iK0NQ78vBAvR2aE9/+WbgnK85zKYE1zqb6hp9icxEoRFXCyNfIbdLbhmn2xrlOJ1/c1h gwtmW0wwKeVOf+WPTZftKdxff3kcZ6iZbZQ9ANuMZB+Xil85H/1Y4TMd2+P4shNirJEr Et3wByntXbMEyDvf49cu5nkqSj+O+VkHOzOlw5eWJMZVdFFoS7SY7hLMPqyHQmUhM3tM oPE+oqv1RCTTH9iT9xTJnY+hIB+H3KazbNZC/ISRY4FbGIJmao+tci4F0b3CnZOVDWrY hPJw== X-Gm-Message-State: AOAM533RhtVs0CThko6RVLg4YSoCJyvWQlQKz+mQbaukFgvbVJ0dOM89 TOqBVZaeStUq0qCA5v4s7XdcoALAEOZvDg== X-Google-Smtp-Source: ABdhPJzzgU64EleVmaOEVhbbonfbFjb6JFNEYZLDLKUJ5ohI/UQvMNGlrRaqc98upyrLr1t9rie3Vw== X-Received: by 2002:a1c:f208:: with SMTP id s8mr7086662wmc.85.1602425968743; Sun, 11 Oct 2020 07:19:28 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id f6sm6862000wru.50.2020.10.11.07.19.27 for <35394@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 07:19:27 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <20190423151702.05258473@gmail.com> Date: Sun, 11 Oct 2020 16:18:41 +0200 In-Reply-To: <20190423151702.05258473@gmail.com> (Miguel's message of "Tue, 23 Apr 2019 15:17:02 +0200") Message-ID: <87ft6k7sn2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Hi, This is the latest version of the patch, that could be applied to master. They have been reduced to one patch, and as on previous versions of this series of patches only the grub messages are translated, not the menu entries generated by guix (yet). WDYT? Best regards, Miguel -- --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-system-Use-locale-information-in-grub.cfg.patch Content-Transfer-Encoding: quoted-printable Content-Description: 0001-service-add-locale-to-grub.patch >From 885a7c167faafa295b0f3edaae1ee456eacf1e63 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Sat, 2 Nov 2019 18:18:45 +0100 Subject: [PATCH] system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (define-module): Add new dependency. (grub-configuration-file): Add locale keyword. (grub-configuration-file)[locale-config]: New variable with generated locale configuration when locale parameter has been provided. [builder]: Add locale-config. * gnu/machine/ssh.scm (roll-back-managed-host): Use locale information from boot-parameters. * gnu/system.scm (define-module)[export]: Add boot-parameters-locale. ()[locale]: New field. [boot-parameters-locale]: New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Provide operating-system locale to oboot-parameters record. (operating-system-boot-parameters-file): Likewise. (operating-system-bootcfg): Provide locale information to the bootloader. * guix/system/script.scm (reinstall-bootloader): Likewise. --- gnu/bootloader/grub.scm | 18 ++++++++++++++++++ gnu/machine/ssh.scm | 3 +++ gnu/system.scm | 13 +++++++++++++ guix/scripts/system.scm | 2 ++ 4 files changed, 36 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 516a7d48c8..611580a350 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2017 Leo Famulari ;;; Copyright =C2=A9 2017, 2020 Mathieu Othacehe ;;; Copyright =C2=A9 2019, 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas ;;; Copyright =C2=A9 2020 Maxim Cournoyer ;;; Copyright =C2=A9 2020 Stefan ;;; @@ -33,6 +34,7 @@ #:use-module (gnu system uuid) #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) + #:use-module (gnu system locale) #:use-module (gnu packages bootloaders) #:autoload (gnu packages gtk) (guile-cairo guile-rsvg) #:autoload (gnu packages xorg) (xkeyboard-config) @@ -334,6 +336,7 @@ code." =20 (define* (grub-configuration-file config entries #:key + (locale #f) (system (%current-system)) (old-entries '()) store-directory-prefix) @@ -398,6 +401,20 @@ menuentry ~s { #:store-directory-prefix store-directory-prefix #:port #~port))) =20 + (define locale-config + #~(let ((locale #$(and locale + (locale-definition-source + (locale-name->definition locale))))) + (when locale + (format port "\ +# Localization configuration. +if search --file --set boot_partition /grub/grub.cfg; then + set locale_dir=3D(${boot_partition})/grub/locale +else + set locale_dir=3D/boot/grub/locale +fi +set lang=3D~a~%" locale)))) + (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) (grub (bootloader-package @@ -422,6 +439,7 @@ keymap ~a~%" #$keymap)))) # will be lost upon reconfiguration. ") #$(sugar) + #$locale-config #$keyboard-layout-config (format port " set default=3D~a diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 35b42add48..72ba6bfacf 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -484,11 +484,14 @@ an environment type of 'managed-host." (drop boot-parameters 2))) (bootloader -> (operating-system-bootloader (machine-operating-system machine))) + (locale -> (boot-parameters-locale + (second boot-parameters))) (bootcfg (lower-object ((bootloader-configuration-file-generator (bootloader-configuration-bootloader bootloader)) bootloader entries + #:locale locale #:old-entries old-entries))) (remote-result (machine-remote-eval machine remote-= exp))) (when (eqv? 'error remote-result) diff --git a/gnu/system.scm b/gnu/system.scm index ab1b0ff3de..32e0eeaf17 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2016 Chris Marusich ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2019 Meiyo Peng +;;; Copyright =C2=A9 2019 Miguel =C3=81ngel Arruga Vivas ;;; Copyright =C2=A9 2020 Danny Milosavljevic ;;; Copyright =C2=A9 2020 Brice Waegeneire ;;; Copyright =C2=A9 2020 Florian Pelz @@ -147,6 +148,7 @@ boot-parameters-kernel-arguments boot-parameters-initrd boot-parameters-multiboot-modules + boot-parameters-locale read-boot-parameters read-boot-parameters-file boot-parameters->menu-entry @@ -291,6 +293,7 @@ directly by the user." boot-parameters-bootloader-menu-entries) (store-device boot-parameters-store-device) (store-mount-point boot-parameters-store-mount-point) + (locale boot-parameters-locale) (kernel boot-parameters-kernel) (kernel-arguments boot-parameters-kernel-arguments) (initrd boot-parameters-initrd) @@ -368,6 +371,11 @@ file system labels." ((_ args) args) (#f '()))) =20 + (locale + (match (assq 'locale rest) + ((_ locale) locale) + (#f #f))) + (store-device ;; Linux device names like "/dev/sda1" are not suitable GRUB device ;; identifiers, so we just filter them out. @@ -1214,6 +1222,7 @@ a list of , to populate the \"old entries= \" menu." (let* ((file-systems (operating-system-file-systems os)) (root-fs (operating-system-root-file-system os)) (root-device (file-system-device root-fs)) + (locale (operating-system-locale os)) (params (operating-system-boot-parameters os root-device #:system-kernel-arguments? #t)) @@ -1225,6 +1234,7 @@ a list of , to populate the \"old entries= \" menu." (bootloader-configuration-bootloader bootloader-conf))) =20 (generate-config-file bootloader-conf (list entry) + #:locale locale #:old-entries old-entries #:store-directory-prefix (btrfs-store-subvolume-file-name file-systems)))) @@ -1264,6 +1274,7 @@ such as '--root' and '--load' to ." (let* ((initrd (and (not (operating-system-hurd os)) (operating-system-initrd-file os))) (store (operating-system-store-file-system os)) + (locale (operating-system-locale os)) (bootloader (bootloader-configuration-bootloader (operating-system-bootloader os))) (bootloader-name (bootloader-name bootloader)) @@ -1282,6 +1293,7 @@ such as '--root' and '--load' to ." (bootloader-name bootloader-name) (bootloader-menu-entries (bootloader-configuration-menu-entries (operating-system-bootloader = os))) + (locale locale) (store-device (ensure-not-/dev (file-system-device store))) (store-mount-point (file-system-mount-point store))))) =20 @@ -1334,6 +1346,7 @@ being stored into the \"parameters\" file)." (or (and=3D> (operating-system-bootloader os) bootloader-configuration-menu-entr= ies) '()))) + (locale #$(boot-parameters-locale params)) (store (device #$(device->sexp (boot-parameters-store-device param= s))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 939559e719..9ed5c26483 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -384,6 +384,7 @@ STORE is an open connection to the store." ;; Make the specified system generation the default entry. (params (first (profile-boot-parameters %system-profile (list number)))) + (locale (boot-parameters-locale params)) (old-generations (delv number (reverse (generation-numbers %system-profile)))) (old-params (profile-boot-parameters @@ -396,6 +397,7 @@ STORE is an open connection to the store." ((bootcfg (lower-object ((bootloader-configuration-file-generator bootloader) bootloader-config entries + #:locale locale #:old-entries old-entries))) (drvs -> (list bootcfg))) (mbegin %store-monad --=20 2.28.0 --=-=-=-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 1/1 v4] Grub i18n Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Oct 2020 16:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.16029523711217 (code B ref 35394); Sat, 17 Oct 2020 16:33:02 +0000 Received: (at 35394) by debbugs.gnu.org; 17 Oct 2020 16:32:51 +0000 Received: from localhost ([127.0.0.1]:35441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTp8U-0000JZ-LB for submit@debbugs.gnu.org; Sat, 17 Oct 2020 12:32:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTp8S-0000JN-R8 for 35394@debbugs.gnu.org; Sat, 17 Oct 2020 12:32:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58095) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTp8N-0003Ie-Hs; Sat, 17 Oct 2020 12:32:43 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40174 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kTp8K-0008F8-No; Sat, 17 Oct 2020 12:32:42 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> Date: Sat, 17 Oct 2020 18:32:39 +0200 In-Reply-To: <87ft6k7sn2.fsf@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Sun, 11 Oct 2020 16:18:41 +0200") Message-ID: <87362c6cew.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Miguel, Miguel =C3=81ngel Arruga Vivas skribis: > This is the latest version of the patch, that could be applied to > master. > > They have been reduced to one patch, and as on previous versions of this > series of patches only the grub messages are translated, not the menu > entries generated by guix (yet). Sounds good. I think the way you split patches in v3 was fine too (the added test was also a nice bonus), so I actually have a slight preference for v3. >>>From 885a7c167faafa295b0f3edaae1ee456eacf1e63 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D > > Date: Sat, 2 Nov 2019 18:18:45 +0100 > Subject: [PATCH] system: Use locale information in grub.cfg. > > * gnu/bootloader/grub.scm (define-module): Add new dependency. > (grub-configuration-file): Add locale keyword. > (grub-configuration-file)[locale-config]: New variable with generated > locale configuration when locale parameter has been provided. > [builder]: Add locale-config. > * gnu/machine/ssh.scm (roll-back-managed-host): Use locale information > from boot-parameters. > * gnu/system.scm (define-module)[export]: Add boot-parameters-locale. > ()[locale]: New field. > [boot-parameters-locale]: New accessor. > (read-boot-parameters): Read locale field. > (operating-system-boot-parameters): Provide operating-system locale to > oboot-parameters record. > (operating-system-boot-parameters-file): Likewise. > (operating-system-bootcfg): Provide locale information to the bootloader. > * guix/system/script.scm (reinstall-bootloader): Likewise. This (and v3) LGTM! We=E2=80=99ll have to do another round of testing befo= re 1.2. =C2=A1Gracias! Ludo=E2=80=99. From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Oct 2020 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160303381025341 (code B ref 35394); Sun, 18 Oct 2020 15:11:02 +0000 Received: (at 35394) by debbugs.gnu.org; 18 Oct 2020 15:10:10 +0000 Received: from localhost ([127.0.0.1]:38879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUAK2-0006ae-1Q for submit@debbugs.gnu.org; Sun, 18 Oct 2020 11:10:10 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUAJz-0006a3-Om for 35394@debbugs.gnu.org; Sun, 18 Oct 2020 11:10:08 -0400 Received: by mail-wm1-f65.google.com with SMTP id e2so10224715wme.1 for <35394@debbugs.gnu.org>; Sun, 18 Oct 2020 08:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=w6fxZtXY72/hWK/l+KR9n/t4tp2Z7ZneMmOGgoILZfY=; b=iTUEARvaSwz73NSfkzb1su9XwwmM2o+048Wkk7rUei/NNoE/fpvQNDBMkgdjRMbkdq aEUn4yiUXEDkznNWprmi8pp3q8cb6GiM//aHtXMFImt1AA7Pb9x0JL4QwgZslXKW27p0 IBUII5UdtFTo5o+FS7qdA+XS11wUtIwR3W+YueXRw/ehnbQb1EyURhIpcDKnaCJP/K1F Do0M0XPrVQe92pHM9gqcwWbZUmCZ/QzSwld+XVKgXmtATevYrtFjEiXPDlzoHSooj3oI jFAO+66O09Xn3XXpR8JyvIMKYWwro3SA/PTMjf5xX7kunNbRO4eRuB8aDWWT6LFDd/sH aNCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=w6fxZtXY72/hWK/l+KR9n/t4tp2Z7ZneMmOGgoILZfY=; b=Ey+dyT4Crk2yuBhvr3v1EtUCYgMcn8Qw3xBXrDWeKFGehTOw9WopUO0l+VaBEXdcI9 VJqTAVYAMuI4/PCp+3lL/gtPFavOt4GbgQAwfXTCB6dqWzKa1oGfCvbpco4ujn5rgju8 3hJUCwYqM7ruUTCpQZ6Xt9OjL3FlC3J/84xaU0ohbExLPdi0iLhY+XB9SJ9f2hcCPlWR RQ38VwkeSHVnxhbWfvtApuvoZR+tpazlQ7HCywmCJcBPu2cbbWbpY8JzeDRv6dY4R7Sh B+p/LLAAUhDWBTNJxRUT14UDhCUQx0IV+TH1zSwEkhcs96AiqW+JIjJa01r8tf9Spr9Y e7mw== X-Gm-Message-State: AOAM532VJl324jJLcuNjf7d0lSkriTqUWwR4UBAFbyjm7FsJd/evVQbF bS5ggDwrhK4qxAePnCmrD65Tq8nmKdhyYA== X-Google-Smtp-Source: ABdhPJyyuUqKYe3NIsmec6GZBlUC7+smTn1F6lcAL+nuq8P2xoKpMtIIFtNkCe8GWg1xONSI19Mt5A== X-Received: by 2002:a05:600c:2256:: with SMTP id a22mr13532655wmm.138.1603033801553; Sun, 18 Oct 2020 08:10:01 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id a3sm14284098wrh.94.2020.10.18.08.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 08:10:00 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> Date: Sun, 18 Oct 2020 17:09:02 +0200 In-Reply-To: <87362c6cew.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 17 Oct 2020 18:32:39 +0200") Message-ID: <87v9f7po4x.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > Sounds good. I think the way you split patches in v3 was fine too (the > added test was also a nice bonus), so I actually have a slight > preference for v3. > (...) > This (and v3) LGTM! We=E2=80=99ll have to do another round of testing be= fore > 1.2. I plan to push them today. The code is the same as v4 (as it contained the code for roll-back in ssh.scm) plus the test from v3, with only cosmetic changes to avoid touching other lines and an update for multiboot-modules in the test. Thank you very much for your review. Nonetheless, I have a nice last minute addition for this to keep this open for a bit more. :-) It brings the whole glibc-locales to the grub and extlinux configuration builders, and changes again boot-parameters. It would be optimal to create a minimal locale with the desired locale, as glibc-utf8-locales doesn't work with my to-go test target (es_ES.utf8) because setlocale raises an exception. I have in my TODO list to extract translate-label somewhere else, even though I'm not sure where could it fit, and to sanitize some inputs to ensure the correct generation. The latter should be ready this week, the first depends on finding (or creating) the right place. WDYT? Happy hacking! Miguel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-system-nls-for-boot-labels.patch Content-Description: 0001-system-nls-for-boot-labels.patch >From e21128a7ed6557198ee74706921a0a24bbbc7b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sat, 17 Oct 2020 21:27:51 +0200 Subject: [PATCH] system: nls for boot labels. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Add keyword locale. [translate-label]: New function that formats the label after translation. [menu-entry->gexp]: Use translate-label. [init-gettext]: Init gettext with the language provided through the configuration. [builder]: Use init-gettext, define G_ and translate strings. * gnu/bootloader/grub.scm (eye-candy): Translate string. (grub-configuration-file)[translate-label]: New function. [menu-entry->gexp]: Use translate-label. [init-gettext]: New g-exp variable. [locale-config]: Translate string. [builder]: Use init-gettext, define G_ and translate strings. * gnu/system.scm (kernel->boot-label): Modify return type, and document it, to allow correct translation of the labels. * po/guix/POTFILES.in: Add gnu/bootloader/grub.scm. * tests/boot-parameters.scm (%default-label): Update to the new format. (%old-label): Renamed from old %default-label. (read old format): New test case. --- gnu/bootloader/extlinux.scm | 48 +++++++++++++++++++++++--- gnu/bootloader/grub.scm | 68 ++++++++++++++++++++++++++++++++----- gnu/system.scm | 21 ++++++------ po/guix/POTFILES.in | 2 ++ tests/boot-parameters.scm | 6 +++- 5 files changed, 119 insertions(+), 26 deletions(-) diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 6b5ff298e7..40e02319f0 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm @@ -27,6 +27,7 @@ (define* (extlinux-configuration-file config entries #:key + (locale #f) (system (%current-system)) (old-entries '()) #:allow-other-keys) @@ -38,8 +39,38 @@ corresponding to old generations of the system." (define all-entries (append entries (bootloader-configuration-menu-entries config))) + (define (translate-label label) + (match label + (('hurd name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for the Hurd kernel, which uses the definite article in English. + ;; The second parameter contains the version string. + #~(format #f (G_ "GNU with the ~a ~a") package version)) + (('linux name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for Linux kernel, which doesn't use the definite article in + ;; English. The second parameter contains the version string. + #~(format #f (G_ "GNU with ~a ~a") package version)) + (('unknown) + ;; TRANSLATORS: This is the label for an unknown system to be booted. + #~(G_ "GNU")) + ((? string? old-format) + ;; We cannot translate properly the old format. + #~old-format))) + + (define init-gettext + #~(let ((locale #$(and locale + (locale-definition-name + (locale-name->definition locale))))) + (when locale + (setenv "GUIX_LOCPATH" (string-append #$glibc-locales + "/lib/locale/")) + (bindtextdomain "guix" (string-append #$guix "/share/locale")) + (textdomain "guix") + (setlocale LC_ALL locale)))) + (define (menu-entry->gexp entry) - (let ((label (menu-entry-label entry)) + (let ((label (translate-label (menu-entry-label entry))) (kernel (menu-entry-linux entry)) (kernel-arguments (menu-entry-linux-arguments entry)) (initrd (menu-entry-initrd entry))) @@ -57,13 +88,20 @@ corresponding to old generations of the system." (define builder #~(call-with-output-file #$output (lambda (port) + #$init-gettext + ;; Ensure xgettext extracts translatable messages + ;; with our current keywords. + (define G_ gettext) (let ((timeout #$(bootloader-configuration-timeout config))) - (format port "# This file was generated from your Guix configuration. Any changes -# will be lost upon reconfiguration. -UI menu.c32 -MENU TITLE GNU Guix Boot Options + (format port "~aUI menu.c32 +MENU TITLE ~a PROMPT ~a TIMEOUT ~a~%" + (G_ "\ +# This file was generated from your Guix configuration. Any changes +# will be lost upon reconfiguration. +") ;; Keep line break to not duplicate grub.scm message. + (G_ "GNU Guix Boot Options") (if (> timeout 0) 1 0) ;; timeout is expressed in 1/10s of seconds. (* 10 timeout)) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 611580a350..d05abf9bc9 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -35,8 +35,10 @@ #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) #:use-module (gnu system locale) + #:use-module (gnu packages base) #:use-module (gnu packages bootloaders) #:autoload (gnu packages gtk) (guile-cairo guile-rsvg) + #:use-module (gnu packages package-management) #:autoload (gnu packages xorg) (xkeyboard-config) #:use-module (ice-9 match) #:use-module (ice-9 regex) @@ -182,7 +184,7 @@ fi~%" (and image #~(format #$port " -# Set 'root' to the partition that contains /gnu/store. +# ~a ~a ~a @@ -196,6 +198,8 @@ else set menu_color_normal=cyan/blue set menu_color_highlight=white/blue fi~%" + (G_ + "Set 'root' to the partition that contains /gnu/store.") #$(grub-root-search store-device font-file) #$(setup-gfxterm config font-file) #$(grub-setup-io config) @@ -348,8 +352,28 @@ STORE-DIRECTORY-PREFIX may be used to specify a store prefix, as is required when booting a root file system on a Btrfs subvolume." (define all-entries (append entries (bootloader-configuration-menu-entries config))) + + (define (translate-label label) + (match label + (('hurd name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for the Hurd kernel, which uses the definite article in English. + ;; The second parameter contains the version string. + #~(format #f (G_ "GNU with the ~a ~a") package version)) + (('linux name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for Linux kernel, which doesn't use the definite article in + ;; English. The second parameter contains the version string. + #~(format #f (G_ "GNU with ~a ~a") package version)) + (('unknown) + ;; TRANSLATORS: This is the label for an unknown system to be booted. + #~(G_ "GNU")) + ((? string? old-format) + ;; We cannot translate properly the old format. + #~old-format))) + (define (menu-entry->gexp entry) - (let ((label (menu-entry-label entry)) + (let ((label (translate-label (menu-entry-label entry))) (linux (menu-entry-linux entry)) (device (menu-entry-device entry)) (device-mount-point (menu-entry-device-mount-point entry))) @@ -401,19 +425,36 @@ menuentry ~s { #:store-directory-prefix store-directory-prefix #:port #~port))) + (define init-gettext + #~(let ((locale #$(and locale + (locale-definition-name + (locale-name->definition locale))))) + (when locale + (setenv "GUIX_LOCPATH" (string-append #$glibc-locales + "/lib/locale/")) + (bindtextdomain "guix" (string-append #$guix "/share/locale")) + (textdomain "guix") + (setlocale LC_ALL locale)))) + (define locale-config #~(let ((locale #$(and locale (locale-definition-source (locale-name->definition locale))))) (when locale (format port "\ -# Localization configuration. +# ~a if search --file --set boot_partition /grub/grub.cfg; then set locale_dir=(${boot_partition})/grub/locale else set locale_dir=/boot/grub/locale fi -set lang=~a~%" locale)))) +set lang=~a~%" + ;; XXX: This should sanitized with a function that + ;; inserts # at the beginning of each line. + ;; TRANSLATORS: This must be one line or start each line + ;; with #. + (G_ "Localization configuration.") + locale)))) (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) @@ -434,10 +475,17 @@ keymap ~a~%" #$keymap)))) (define builder #~(call-with-output-file #$output (lambda (port) + #$init-gettext + ;; Ensure xgettext extracts translatable messages + ;; with our current keywords. + (define G_ gettext) (format port - "# This file was generated from your Guix configuration. Any changes + ;; XXX: This should sanitized with a function to + ;; ensure the # at the beginning of each line. + (G_ "\ +# This file was generated from your Guix configuration. Any changes # will be lost upon reconfiguration. -") +")) #$(sugar) #$locale-config #$keyboard-layout-config @@ -450,16 +498,18 @@ set timeout=~a~%" #$@(if (pair? old-entries) #~((format port " -submenu \"GNU system, old configurations...\" {~%") +submenu \"~a\" {~%" + (G_ "GNU system, old configurations...")) #$@(map menu-entry->gexp old-entries) (format port "}~%")) #~()) (format port " if [ \"${grub_platform}\" == efi ]; then - menuentry \"Firmware setup\" { + menuentry \"~a\" { fwsetup } -fi~%")))) +fi~%" + (G_ "Firmware setup"))))) ;; Since this file is rather unique, there's no point in trying to ;; substitute it. diff --git a/gnu/system.scm b/gnu/system.scm index a3122eaa65..1257aa6223 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1194,20 +1194,19 @@ listed in OS. The C library expects to find it under #:libcs (operating-system-locale-libcs os))) (define* (kernel->boot-label kernel #:key hurd) - "Return a label for the bootloader menu entry that boots KERNEL." + "Return a label for the bootloader menu entry that boots KERNEL. +Label is a list that contains the kernel identifier, @code{'hurd} or +@code{'linux}, its title name and the version, or @code{'unknown}." (cond ((package? hurd) - (string-append "GNU with the " - (string-titlecase (package-name hurd)) " " - (package-version hurd))) + (list 'hurd (string-titlecase (package-name hurd)) + (package-version hurd))) ((package? kernel) - (string-append "GNU with " - (string-titlecase (package-name kernel)) " " - (package-version kernel))) + (list 'linux (string-titlecase (package-name kernel)) + (package-version kernel))) ((inferior-package? kernel) - (string-append "GNU with " - (string-titlecase (inferior-package-name kernel)) " " - (inferior-package-version kernel))) - (else "GNU"))) + (list 'linux (string-titlecase (inferior-package-name kernel)) + (inferior-package-version kernel))) + (else '(unknown)))) (define (operating-system-default-label os) "Return the default label for OS, as it will appear in the bootloader menu diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index b877fac9df..4386c8763d 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -40,6 +40,8 @@ gnu/installer/user.scm gnu/installer/utils.scm gnu/machine/ssh.scm gnu/packages/bootstrap.scm +gnu/bootloader/grub.scm +gnu/bootloader/extlinux.scm guix/build/utils.scm guix/scripts.scm guix/scripts/build.scm diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm index d7e579bc89..678de1475f 100644 --- a/tests/boot-parameters.scm +++ b/tests/boot-parameters.scm @@ -34,7 +34,8 @@ #:use-module (srfi srfi-64) #:use-module (rnrs bytevectors)) -(define %default-label "GNU with Linux-libre 99.1.2") +(define %old-label "GNU with Linux-libre 99.1.2") +(define %default-label '(linux "Linux-libre" "99.1.2")) (define %default-kernel-path (string-append (%store-prefix) "/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-linux-libre-99.1.2")) @@ -156,6 +157,9 @@ #:with-store #false #:locale #false))) +(test-assert "read, read old format" + (test-read-boot-parameters #:label %old-label)) + (test-equal "read, default equality" %grub-boot-parameters (test-read-boot-parameters)) -- 2.28.0 --=-=-=-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Oct 2020 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.16030358614276 (code B ref 35394); Sun, 18 Oct 2020 15:45:02 +0000 Received: (at 35394) by debbugs.gnu.org; 18 Oct 2020 15:44:21 +0000 Received: from localhost ([127.0.0.1]:38918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUAr6-00016t-N2 for submit@debbugs.gnu.org; Sun, 18 Oct 2020 11:44:21 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUAr4-00016a-60 for 35394@debbugs.gnu.org; Sun, 18 Oct 2020 11:44:18 -0400 Received: by mail-wr1-f68.google.com with SMTP id y12so8656067wrp.6 for <35394@debbugs.gnu.org>; Sun, 18 Oct 2020 08:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=NhVBdSDrsNv9hT13jxYz2M0t7xSZpWC65xsKs9ZTaV8=; b=tkl+tv+8cgw+US25bI4YIuaIXsRqENjUQ/uThV5nv8ZN0/ZHCnn7DM1zbBn3o6zn8K nk6B/o+B8r6Ppf8BAU8uzBoj5VNMvL8dRP1knn6r91TsKH1sPICJ4I2sZmFnKPB9ob0r tmKn0Y9rtIvWfMRrUF4SP6Qk46GYGUY3r16YhFqQbec2BhReU2leyg29oi6QZE1DKMJB 38NXRjzX6QunQtSqpWR65qIDxFi/MzmpjoxWDwKSbXH1SI2zV2JaSBPE3lWG2rbRee/h T142MNfkCHlErEHPOSX5u3J1keGxi0Al5bH6KBWSZ8UV88J4F+yiVl41bOCCzrUSLX6b 3iSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=NhVBdSDrsNv9hT13jxYz2M0t7xSZpWC65xsKs9ZTaV8=; b=uguF8Mcu8hDb8wvdo/JbA6/HqRSNpYhTvJ8a/5+VYhMFrmq/AeqXA9DArW/lySpYdh mf2siPxwaUv/NrlSG2lRTu759noIiTpyk3yQxP48eNzAKPO+l719PRltyPjsnt3XcX5p Y2YLkMaaoeY4XQEpAsDq+syiohD5cgJIF1nsFJMjfBCOnJtuBs7QHt4GSD3HBV7YkOA0 +yNRax/Y/xhFCkzNWkzOzq9JWERfYCmvEBBulYO7iYQRNIY0zzCicA46whGiv1H/LAPM q8ibfEHWOAH5EpY+cEHrEok09Wpjf4+1lyFZ7bsQcnFTQdoRK7BTImbtw2wwoEZrbUPH Jb5Q== X-Gm-Message-State: AOAM531nDWXoG+hjdtDmL8j6/eJTEaBtPs/zZgjWodIk6+qiFd7H1sbS kHNyP2fCUZaIQrJXgfdoJDKHwHeFerZIbQ== X-Google-Smtp-Source: ABdhPJxUpCvKp6CjuD5l7xCoYmvqrJX6E8tzKlSL9TUhbXpPRc/mf+uBZTM4ojHNHE8L9fVqvPGP0A== X-Received: by 2002:adf:9e05:: with SMTP id u5mr15244429wre.78.1603035851935; Sun, 18 Oct 2020 08:44:11 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id y14sm12070729wma.48.2020.10.18.08.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 08:44:11 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> Date: Sun, 18 Oct 2020 17:43:16 +0200 In-Reply-To: <87v9f7po4x.fsf_-_@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Sun, 18 Oct 2020 17:09:02 +0200") Message-ID: <87o8kzpmjv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sorry, please disregard the last patch, it was a non-working version. I tested this one with Grub and the boot-parameters test (for the label modification). I leave the open points for reference. Miguel =C3=81ngel Arruga Vivas writes: > (...) > It brings the whole glibc-locales to the grub and extlinux configuration > builders, and changes again boot-parameters. It would be optimal to > create a minimal locale with the desired locale, as glibc-utf8-locales > doesn't work with my to-go test target (es_ES.utf8) because setlocale > raises an exception. > > I have in my TODO list to extract translate-label somewhere else, even > though I'm not sure where could it fit, and to sanitize some inputs to > ensure the correct generation. The latter should be ready this week, > the first depends on finding (or creating) the right place. Happy hacking! Miguel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-system-nls-for-boot-labels.patch Content-Description: 0001-system-nls-for-boot-labels.patch >From e9f3c255c13abc14e1f0decf5460b7a2f9a2d162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sat, 17 Oct 2020 21:27:51 +0200 Subject: [PATCH] system: nls for boot labels. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Add keyword locale. [translate-label]: New function that formats the label after translation. [menu-entry->gexp]: Use translate-label. [init-gettext]: Init gettext with the language provided through the configuration. [builder]: Use init-gettext, define G_ and translate strings. * gnu/bootloader/grub.scm (eye-candy): Translate string. (grub-configuration-file)[translate-label]: New function. [menu-entry->gexp]: Use translate-label. [init-gettext]: New g-exp variable. [locale-config]: Translate string. [builder]: Use init-gettext, define G_ and translate strings. * gnu/system.scm (kernel->boot-label): Modify return type, and document it, to allow correct translation of the labels. * po/guix/POTFILES.in: Add gnu/bootloader/grub.scm. * tests/boot-parameters.scm (%default-label): Update to the new format. (%old-label): Renamed from old %default-label. (read old format): New test case. --- gnu/bootloader/extlinux.scm | 52 +++++++++++++++++++++++++--- gnu/bootloader/grub.scm | 68 ++++++++++++++++++++++++++++++++----- gnu/system.scm | 21 ++++++------ po/guix/POTFILES.in | 2 ++ tests/boot-parameters.scm | 6 +++- 5 files changed, 123 insertions(+), 26 deletions(-) diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 6b5ff298e7..36d0bcdae4 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm @@ -19,14 +19,19 @@ (define-module (gnu bootloader extlinux) #:use-module (gnu bootloader) + #:use-module (gnu packages base) #:use-module (gnu packages bootloaders) + #:use-module (gnu packages package-management) + #:use-module (gnu system locale) #:use-module (guix gexp) #:use-module (guix utils) + #:use-module (ice-9 match) #:export (extlinux-bootloader extlinux-bootloader-gpt)) (define* (extlinux-configuration-file config entries #:key + (locale #f) (system (%current-system)) (old-entries '()) #:allow-other-keys) @@ -38,8 +43,38 @@ corresponding to old generations of the system." (define all-entries (append entries (bootloader-configuration-menu-entries config))) + (define (translate-label label) + (match label + (('hurd name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for the Hurd kernel, which uses the definite article in English. + ;; The second parameter contains the version string. + #~(format #f (G_ "GNU with the ~a ~a") package version)) + (('linux name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for Linux kernel, which doesn't use the definite article in + ;; English. The second parameter contains the version string. + #~(format #f (G_ "GNU with ~a ~a") package version)) + (('unknown) + ;; TRANSLATORS: This is the label for an unknown system to be booted. + #~(G_ "GNU")) + ((? string? old-format) + ;; We cannot translate properly the old format. + old-format))) + + (define init-gettext + #~(let ((locale #$(and locale + (locale-definition-name + (locale-name->definition locale))))) + (when locale + (setenv "GUIX_LOCPATH" (string-append #$glibc-locales + "/lib/locale/")) + (bindtextdomain "guix" (string-append #$guix "/share/locale")) + (textdomain "guix") + (setlocale LC_ALL locale)))) + (define (menu-entry->gexp entry) - (let ((label (menu-entry-label entry)) + (let ((label (translate-label (menu-entry-label entry))) (kernel (menu-entry-linux entry)) (kernel-arguments (menu-entry-linux-arguments entry)) (initrd (menu-entry-initrd entry))) @@ -57,13 +92,20 @@ corresponding to old generations of the system." (define builder #~(call-with-output-file #$output (lambda (port) + #$init-gettext + ;; Ensure xgettext extracts translatable messages + ;; with our current keywords. + (define G_ gettext) (let ((timeout #$(bootloader-configuration-timeout config))) - (format port "# This file was generated from your Guix configuration. Any changes -# will be lost upon reconfiguration. -UI menu.c32 -MENU TITLE GNU Guix Boot Options + (format port "~aUI menu.c32 +MENU TITLE ~a PROMPT ~a TIMEOUT ~a~%" + (G_ "\ +# This file was generated from your Guix configuration. Any changes +# will be lost upon reconfiguration. +") ;; Keep line break to not duplicate grub.scm message. + (G_ "GNU Guix Boot Options") (if (> timeout 0) 1 0) ;; timeout is expressed in 1/10s of seconds. (* 10 timeout)) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 611580a350..e4df9b5009 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -35,8 +35,10 @@ #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) #:use-module (gnu system locale) + #:use-module (gnu packages base) #:use-module (gnu packages bootloaders) #:autoload (gnu packages gtk) (guile-cairo guile-rsvg) + #:use-module (gnu packages package-management) #:autoload (gnu packages xorg) (xkeyboard-config) #:use-module (ice-9 match) #:use-module (ice-9 regex) @@ -182,7 +184,7 @@ fi~%" (and image #~(format #$port " -# Set 'root' to the partition that contains /gnu/store. +# ~a ~a ~a @@ -196,6 +198,8 @@ else set menu_color_normal=cyan/blue set menu_color_highlight=white/blue fi~%" + (G_ + "Set 'root' to the partition that contains /gnu/store.") #$(grub-root-search store-device font-file) #$(setup-gfxterm config font-file) #$(grub-setup-io config) @@ -348,8 +352,28 @@ STORE-DIRECTORY-PREFIX may be used to specify a store prefix, as is required when booting a root file system on a Btrfs subvolume." (define all-entries (append entries (bootloader-configuration-menu-entries config))) + + (define (translate-label label) + (match label + (('hurd name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for the Hurd kernel, which uses the definite article in English. + ;; The second parameter contains the version string. + #~(format #f (G_ "GNU with the ~a ~a") package version)) + (('linux name version) + ;; TRANSLATORS: The first parameter is the capitalized package name + ;; for Linux kernel, which doesn't use the definite article in + ;; English. The second parameter contains the version string. + #~(format #f (G_ "GNU with ~a ~a") package version)) + (('unknown) + ;; TRANSLATORS: This is the label for an unknown system to be booted. + #~(G_ "GNU")) + ((? string? old-format) + ;; We cannot translate properly the old format. + old-format))) + (define (menu-entry->gexp entry) - (let ((label (menu-entry-label entry)) + (let ((label (translate-label (menu-entry-label entry))) (linux (menu-entry-linux entry)) (device (menu-entry-device entry)) (device-mount-point (menu-entry-device-mount-point entry))) @@ -401,19 +425,36 @@ menuentry ~s { #:store-directory-prefix store-directory-prefix #:port #~port))) + (define init-gettext + #~(let ((locale #$(and locale + (locale-definition-name + (locale-name->definition locale))))) + (when locale + (setenv "GUIX_LOCPATH" (string-append #$glibc-locales + "/lib/locale/")) + (bindtextdomain "guix" (string-append #$guix "/share/locale")) + (textdomain "guix") + (setlocale LC_ALL locale)))) + (define locale-config #~(let ((locale #$(and locale (locale-definition-source (locale-name->definition locale))))) (when locale (format port "\ -# Localization configuration. +# ~a if search --file --set boot_partition /grub/grub.cfg; then set locale_dir=(${boot_partition})/grub/locale else set locale_dir=/boot/grub/locale fi -set lang=~a~%" locale)))) +set lang=~a~%" + ;; XXX: This should sanitized with a function that + ;; inserts # at the beginning of each line. + ;; TRANSLATORS: This must be one line or start each line + ;; with #. + (G_ "Localization configuration.") + locale)))) (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) @@ -434,10 +475,17 @@ keymap ~a~%" #$keymap)))) (define builder #~(call-with-output-file #$output (lambda (port) + #$init-gettext + ;; Ensure xgettext extracts translatable messages + ;; with our current keywords. + (define G_ gettext) (format port - "# This file was generated from your Guix configuration. Any changes + ;; XXX: This should sanitized with a function to + ;; ensure the # at the beginning of each line. + (G_ "\ +# This file was generated from your Guix configuration. Any changes # will be lost upon reconfiguration. -") +")) #$(sugar) #$locale-config #$keyboard-layout-config @@ -450,16 +498,18 @@ set timeout=~a~%" #$@(if (pair? old-entries) #~((format port " -submenu \"GNU system, old configurations...\" {~%") +submenu \"~a\" {~%" + (G_ "GNU system, old configurations...")) #$@(map menu-entry->gexp old-entries) (format port "}~%")) #~()) (format port " if [ \"${grub_platform}\" == efi ]; then - menuentry \"Firmware setup\" { + menuentry \"~a\" { fwsetup } -fi~%")))) +fi~%" + (G_ "Firmware setup"))))) ;; Since this file is rather unique, there's no point in trying to ;; substitute it. diff --git a/gnu/system.scm b/gnu/system.scm index a3122eaa65..1257aa6223 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1194,20 +1194,19 @@ listed in OS. The C library expects to find it under #:libcs (operating-system-locale-libcs os))) (define* (kernel->boot-label kernel #:key hurd) - "Return a label for the bootloader menu entry that boots KERNEL." + "Return a label for the bootloader menu entry that boots KERNEL. +Label is a list that contains the kernel identifier, @code{'hurd} or +@code{'linux}, its title name and the version, or @code{'unknown}." (cond ((package? hurd) - (string-append "GNU with the " - (string-titlecase (package-name hurd)) " " - (package-version hurd))) + (list 'hurd (string-titlecase (package-name hurd)) + (package-version hurd))) ((package? kernel) - (string-append "GNU with " - (string-titlecase (package-name kernel)) " " - (package-version kernel))) + (list 'linux (string-titlecase (package-name kernel)) + (package-version kernel))) ((inferior-package? kernel) - (string-append "GNU with " - (string-titlecase (inferior-package-name kernel)) " " - (inferior-package-version kernel))) - (else "GNU"))) + (list 'linux (string-titlecase (inferior-package-name kernel)) + (inferior-package-version kernel))) + (else '(unknown)))) (define (operating-system-default-label os) "Return the default label for OS, as it will appear in the bootloader menu diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index b877fac9df..4386c8763d 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -40,6 +40,8 @@ gnu/installer/user.scm gnu/installer/utils.scm gnu/machine/ssh.scm gnu/packages/bootstrap.scm +gnu/bootloader/grub.scm +gnu/bootloader/extlinux.scm guix/build/utils.scm guix/scripts.scm guix/scripts/build.scm diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm index d7e579bc89..678de1475f 100644 --- a/tests/boot-parameters.scm +++ b/tests/boot-parameters.scm @@ -34,7 +34,8 @@ #:use-module (srfi srfi-64) #:use-module (rnrs bytevectors)) -(define %default-label "GNU with Linux-libre 99.1.2") +(define %old-label "GNU with Linux-libre 99.1.2") +(define %default-label '(linux "Linux-libre" "99.1.2")) (define %default-kernel-path (string-append (%store-prefix) "/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-linux-libre-99.1.2")) @@ -156,6 +157,9 @@ #:with-store #false #:locale #false))) +(test-assert "read, read old format" + (test-read-boot-parameters #:label %old-label)) + (test-equal "read, default equality" %grub-boot-parameters (test-read-boot-parameters)) -- 2.28.0 --=-=-=-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160309742423507 (code B ref 35394); Mon, 19 Oct 2020 08:51:01 +0000 Received: (at 35394) by debbugs.gnu.org; 19 Oct 2020 08:50:24 +0000 Received: from localhost ([127.0.0.1]:39961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUQs4-000675-9G for submit@debbugs.gnu.org; Mon, 19 Oct 2020 04:50:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUQs2-00066r-E1 for 35394@debbugs.gnu.org; Mon, 19 Oct 2020 04:50:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58840) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUQrx-0003Lv-3w; Mon, 19 Oct 2020 04:50:17 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=59046 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kUQrv-00030L-Ga; Mon, 19 Oct 2020 04:50:17 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 19 Oct 2020 10:50:13 +0200 In-Reply-To: <87o8kzpmjv.fsf@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Sun, 18 Oct 2020 17:43:16 +0200") Message-ID: <87o8ky1tx6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Miguel =C3=81ngel Arruga Vivas skribis: > From e9f3c255c13abc14e1f0decf5460b7a2f9a2d162 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D > > Date: Sat, 17 Oct 2020 21:27:51 +0200 > Subject: [PATCH] system: nls for boot labels. > > * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Add > keyword locale. > [translate-label]: New function that formats the label after > translation. > [menu-entry->gexp]: Use translate-label. > [init-gettext]: Init gettext with the language provided through the > configuration. > [builder]: Use init-gettext, define G_ and translate strings. > * gnu/bootloader/grub.scm (eye-candy): Translate string. > (grub-configuration-file)[translate-label]: New function. > [menu-entry->gexp]: Use translate-label. > [init-gettext]: New g-exp variable. > [locale-config]: Translate string. > [builder]: Use init-gettext, define G_ and translate strings. > * gnu/system.scm (kernel->boot-label): Modify return type, and > document it, to allow correct translation of the labels. > * po/guix/POTFILES.in: Add gnu/bootloader/grub.scm. > * tests/boot-parameters.scm (%default-label): Update to the new > format. > (%old-label): Renamed from old %default-label. > (read old format): New test case. [...] > (define* (extlinux-configuration-file config entries > #:key > + (locale #f) > (system (%current-system)) > (old-entries '()) > #:allow-other-keys) > @@ -38,8 +43,38 @@ corresponding to old generations of the system." > (define all-entries > (append entries (bootloader-configuration-menu-entries config))) >=20=20 > + (define (translate-label label) > + (match label > + (('hurd name version) > + ;; TRANSLATORS: The first parameter is the capitalized package na= me > + ;; for the Hurd kernel, which uses the definite article in Englis= h. > + ;; The second parameter contains the version string. > + #~(format #f (G_ "GNU with the ~a ~a") package version)) > + (('linux name version) > + ;; TRANSLATORS: The first parameter is the capitalized package na= me > + ;; for Linux kernel, which doesn't use the definite article in > + ;; English. The second parameter contains the version string. > + #~(format #f (G_ "GNU with ~a ~a") package version)) > + (('unknown) > + ;; TRANSLATORS: This is the label for an unknown system to be boo= ted. > + #~(G_ "GNU")) > + ((? string? old-format) > + ;; We cannot translate properly the old format. > + old-format))) It=E2=80=99s not good that we=E2=80=99re baking assumptions about the label= here: the user is free to choose the label they want in the =E2=80=98label=E2=80=99 f= ield, and we don=E2=80=99t want to replicate =E2=80=9CGNU with the=E2=80=9D etc. in each= bootloader. It=E2=80=99s also not great that we=E2=80=99re changing the boot parameters= again as this can make compatibility trickier down the road. (Brainstorm=E2=80=A6) I would simply translate it on the client side by temporarily setting LANGUAGE to the target locale. The downside is that this will not be translated if the target locale is not supported by the host. Alternately, we could have: (define (formatted-i18n-string locale fmt . args) (computed-file "formatted-i18n-string" #~(begin (textdomain =E2=80=A6) (setlocale =E2=80=A6) (call-with-output-file #$output (lambda (port) (format port =E2=80=A6)))))) We would then need to adjust all bootloaders to read the label from that file. If the user-supplied =E2=80=98label=E2=80=99 is a plain string, we= =E2=80=99d wrap it in (plain-file =E2=80=A6) so that =E2=80=98label=E2=80=99 is always a file-lik= e object. WDYT? Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 11:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.16031077629857 (code B ref 35394); Mon, 19 Oct 2020 11:43:02 +0000 Received: (at 35394) by debbugs.gnu.org; 19 Oct 2020 11:42:42 +0000 Received: from localhost ([127.0.0.1]:40172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUTYo-0002Yv-FI for submit@debbugs.gnu.org; Mon, 19 Oct 2020 07:42:42 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUTYm-0002Yb-Jd for 35394@debbugs.gnu.org; Mon, 19 Oct 2020 07:42:41 -0400 Received: by mail-wm1-f68.google.com with SMTP id j136so12488918wmj.2 for <35394@debbugs.gnu.org>; Mon, 19 Oct 2020 04:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=v80rZY9bY8pfoJ7PfGqyZD/siBBIGi77Y1KaTQPLGek=; b=LrJ6AVI6lkSxmCFKlRO9sAzSj6cHFP+9/oLkcAIToTYF7zzqaH45AgJ887P1dATyse ro92aVmX+wXV4mvsDZTtoHd1U0DddWwsrMC/fPoKYsyGwBoGultW/UheTYaKm9th9eQs 7QptaSXhCwWD3N0aoUfOYViWpGXzugoQPjYbsFBsQ85rtSyjicJxns9bcWc+Kh7/9uHi HZ9j121lFV6bdE412gz213L7jpo6Pw7brJrowhjsUMkZ52qFSSb7OnnF6r0GgKM+0inK NDXo+LQl6PtV6+uJM8L+WqeXVBBqOiJKEUmnO3npIRZJw4XU5794Aog8BnnGNBa8P0Rb fTLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=v80rZY9bY8pfoJ7PfGqyZD/siBBIGi77Y1KaTQPLGek=; b=A0VTqnT8FJJ8Xi3DCD14ij4O6zqpNPupIuflawaXVFZ7ufWDymGQwfmxUpdhHMhqbs /eqdUUzoC++Ew5lXBvd7PCgWMVMPfhYHriMxeRmVhb/hiRXLE0DfmNZT+M2KNmE/86qD xWdNXyTelpVV0Yng2kMID5DHsNeFOkXGNax8D9RXzjymt+3xoQlybBCTcuIQtT6xvh+w 6hjko0+M6V8HmFCV6xS9bzB50qX94TUqD8oEQJYa9lwxowLzQqvNENaokLMfW8mbKvle aDA7bc+JydXq7EwX8aVFHcOxxlfrF4YWeEPIzWcEnepJaEPKDeCBTwMygvAHabfJeSWA UGPw== X-Gm-Message-State: AOAM531+6RD21H6vsg1tqvaDMl39Z3NVElD11hHj6IY87Ev0l73uY/Ye OWk3dCN/BN38CPy53wB8ImXDgYxPElPCUg== X-Google-Smtp-Source: ABdhPJw5Uj2wQ4VJGbth1WfGlWJBzumyxwHvuo8CZEcKnU5bCg6FNps651x/5XWwGUJ5XHu/VNW0Jw== X-Received: by 2002:a1c:ed04:: with SMTP id l4mr6741473wmh.143.1603107754378; Mon, 19 Oct 2020 04:42:34 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id 32sm4896782wro.31.2020.10.19.04.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 04:42:33 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> <87o8ky1tx6.fsf@gnu.org> Date: Mon, 19 Oct 2020 13:41:36 +0200 In-Reply-To: <87o8ky1tx6.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 19 Oct 2020 10:50:13 +0200") Message-ID: <878sc2phn3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Hi Ludo, Thanks for your review and your ideas, I'll comment inline. Ludovic Court=C3=A8s writes: >> + (define (translate-label label) >> + (match label >> + (('hurd name version) >> + ;; TRANSLATORS: The first parameter is the capitalized package n= ame >> + ;; for the Hurd kernel, which uses the definite article in Engli= sh. >> + ;; The second parameter contains the version string. >> + #~(format #f (G_ "GNU with the ~a ~a") package version)) >> + (('linux name version) >> + ;; TRANSLATORS: The first parameter is the capitalized package n= ame >> + ;; for Linux kernel, which doesn't use the definite article in >> + ;; English. The second parameter contains the version string. >> + #~(format #f (G_ "GNU with ~a ~a") package version)) >> + (('unknown) >> + ;; TRANSLATORS: This is the label for an unknown system to be bo= oted. >> + #~(G_ "GNU")) >> + ((? string? old-format) >> + ;; We cannot translate properly the old format. >> + old-format))) > > It=E2=80=99s not good that we=E2=80=99re baking assumptions about the lab= el here: the > user is free to choose the label they want in the =E2=80=98label=E2=80=99= field, and we > don=E2=80=99t want to replicate =E2=80=9CGNU with the=E2=80=9D etc. in ea= ch bootloader. I guess the main problem here was calling it 'old-format', as this is the format that would be received for the labels provided by the user too, I should have called it 'fixed-label' instead. I didn't though of this at first so that was the name, but the user provided label works as always: the installation image was the first example I checked, as it does exactly that---that startled me a bit until I noticed, by the way. > It=E2=80=99s also not great that we=E2=80=99re changing the boot paramete= rs again as > this can make compatibility trickier down the road. That was an important point of this design, and the reason why I created the test in the first place: the tests try to cover all the possibilities, the old format and the new one(s). :-) > (Brainstorm=E2=80=A6) > > I would simply translate it on the client side by temporarily setting > LANGUAGE to the target locale. The downside is that this will not be > translated if the target locale is not supported by the host. > > Alternately, we could have: > > (define (formatted-i18n-string locale fmt . args) > (computed-file "formatted-i18n-string" > #~(begin > (textdomain =E2=80=A6) > (setlocale =E2=80=A6) > (call-with-output-file #$output > (lambda (port) > (format port =E2=80=A6)))))) I'd prefer this option, as it avoids triggering the translation on the client side, and it could be used in other places too if needed. It needs xgettext support and a tag (like F_ or L_) would be very concise, and useful from my point of view. There are some other places (e.g. gnu/machine/ssh.scm:395) which use string-append for user visible strings[1]. They should be localized with a proper format, and including the format call into the i18n call itself helps to ensure that. > We would then need to adjust all bootloaders to read the label from that > file. If the user-supplied =E2=80=98label=E2=80=99 is a plain string, we= =E2=80=99d wrap it in > (plain-file =E2=80=A6) so that =E2=80=98label=E2=80=99 is always a file-l= ike object. I'll probably raise some questions about the design here and there, and maybe open another thread for the point before, but as soon as I have anything tangible, I'll send a patch. :-) Happy hacking! Miguel [1] https://www.gnu.org/software/gettext/manual/gettext.html#No-string-conc= atenation From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160311368620258 (code B ref 35394); Mon, 19 Oct 2020 13:22:02 +0000 Received: (at 35394) by debbugs.gnu.org; 19 Oct 2020 13:21:26 +0000 Received: from localhost ([127.0.0.1]:40237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUV6L-0005Gg-TX for submit@debbugs.gnu.org; Mon, 19 Oct 2020 09:21:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUV6K-0005GU-JI for 35394@debbugs.gnu.org; Mon, 19 Oct 2020 09:21:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33883) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUV6F-0004MZ-BF; Mon, 19 Oct 2020 09:21:19 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=34042 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kUV6E-0004Q2-S1; Mon, 19 Oct 2020 09:21:19 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> <87o8ky1tx6.fsf@gnu.org> <878sc2phn3.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 19 Oct 2020 15:21:16 +0200 In-Reply-To: <878sc2phn3.fsf@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Mon, 19 Oct 2020 13:41:36 +0200") Message-ID: <87lfg2z703.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Miguel =C3=81ngel Arruga Vivas skribis: >> (Brainstorm=E2=80=A6) >> >> I would simply translate it on the client side by temporarily setting >> LANGUAGE to the target locale. The downside is that this will not be >> translated if the target locale is not supported by the host. >> >> Alternately, we could have: >> >> (define (formatted-i18n-string locale fmt . args) >> (computed-file "formatted-i18n-string" >> #~(begin >> (textdomain =E2=80=A6) >> (setlocale =E2=80=A6) >> (call-with-output-file #$output >> (lambda (port) >> (format port =E2=80=A6)))))) > > I'd prefer this option, as it avoids triggering the translation on the > client side, and it could be used in other places too if needed. It > needs xgettext support and a tag (like F_ or L_) would be very concise, > and useful from my point of view. That=E2=80=99s OK, we can do (as we did in other places) something like: (define-syntax formatted-i18n-string (syntax-rules (G_ N_) ((_ locale (G_ fmt) args ...) (%formatted-i18n-string locale fmt args ...)) =E2=80=A6)) That way, xgettext is happy. > There are some other places (e.g. gnu/machine/ssh.scm:395) which use > string-append for user visible strings[1]. They should be localized > with a proper format, and including the format call into the i18n call > itself helps to ensure that. Yup! >> We would then need to adjust all bootloaders to read the label from that >> file. If the user-supplied =E2=80=98label=E2=80=99 is a plain string, w= e=E2=80=99d wrap it in >> (plain-file =E2=80=A6) so that =E2=80=98label=E2=80=99 is always a file-= like object. > > I'll probably raise some questions about the design here and there, and > maybe open another thread for the point before, but as soon as I have > anything tangible, I'll send a patch. :-) Sure! We may end up delaying that post-release if there=E2=80=99s potential for breakage. We=E2=80=99ll see. Thanks! Ludo=E2=80=99. From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 13:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160311512222995 (code B ref 35394); Mon, 19 Oct 2020 13:46:02 +0000 Received: (at 35394) by debbugs.gnu.org; 19 Oct 2020 13:45:22 +0000 Received: from localhost ([127.0.0.1]:40302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUVTV-0005yp-QL for submit@debbugs.gnu.org; Mon, 19 Oct 2020 09:45:22 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUVTT-0005yX-Qd for 35394@debbugs.gnu.org; Mon, 19 Oct 2020 09:45:20 -0400 Received: by mail-wm1-f65.google.com with SMTP id f21so10357118wml.3 for <35394@debbugs.gnu.org>; Mon, 19 Oct 2020 06:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xDctYmy94vC6FvbwzBxCz/q5YyCf1pznyPzhGcqGETM=; b=Lfev3f3a+6ueg2H8GseOn0czGVVVfw6+P7G7IfH7Tph9uZP1DoWU2F2LJmOdzm6MM8 qLD8rKKREHRWeu8kcIqJFUByk4pPXCFFzu1UhwFcn9kpfzKBInP2BbuCI03ieS6PK6VL kOGK07gh44k07mgkHL+XCdGAezd6/6TPB4eOa2aThR2Wsu0sCRaCpzACwgJ7TChV1Orn +vxqKs1P3ZsG2Pn664wMH3zbZxOjRJtWEKyLHzn43cT5NWiBt+Znya9CwX3sRSKgGoqt GEeRuspfSGg2hyWUuwezVBq5LSpGQZ4jA/cxmzBVDYTG+0NN2LNA3u/eOVjERsmO6DOC lqWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xDctYmy94vC6FvbwzBxCz/q5YyCf1pznyPzhGcqGETM=; b=mqMVXHD/tUEaNlx9BkECZuBGkjZ3LQobQ6jdB4lKQ6WTnOWHsL5gds4fuN8txK17f7 bnE+EwKWzJQIXCvwiRJIlfUWpryrBxoUpN9BNYjDUUlX069omOL+AfblmFDHKjDcDnA6 A11OR/K5Bim1TrlN/6pzUHOK1esQGkHxfKu8yMw4hmoY/egpHeYDIIXOBjAiYTR4vx2g 7pLZDWeOMb/Yz0do3G4gFU11mgbO6xW93gS9NgUMLMMHXFDBNLZ7oRvKMWu/Dvof9Hq2 0Wfwtdxd0w9mjECJfPbkypYt0+tpW1iO14nNeWIsRiFOhWo/AqF0DVU7pw1pCCY/+7Rm sfzA== X-Gm-Message-State: AOAM532zs5TbPNa3oZHqFdC/oEpWzIRZCDfCuvCvoafJ/e5PRG5JVRRK DRcqWFyMWiAetVdCT71OJ+sTPzSVLRQt2QCP X-Google-Smtp-Source: ABdhPJzMoQojDZb+M2272CbgUJpYhnAFZ/dbPxC74e4R2qlnxuhdQuHvxqiUJKaY64gucUYQIltepQ== X-Received: by 2002:a1c:68d5:: with SMTP id d204mr17760351wmc.100.1603115113690; Mon, 19 Oct 2020 06:45:13 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id u15sm18080483wrm.77.2020.10.19.06.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 06:45:12 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> <87o8ky1tx6.fsf@gnu.org> <878sc2phn3.fsf@gmail.com> <87lfg2z703.fsf@gnu.org> Date: Mon, 19 Oct 2020 15:44:12 +0200 In-Reply-To: <87lfg2z703.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 19 Oct 2020 15:21:16 +0200") Message-ID: <87lfg2nxeb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I take note about your comments, just one quick thing: Ludovic Court=C3=A8s writes: > We may end up delaying that post-release if there=E2=80=99s potential for > breakage. We=E2=80=99ll see. With the release coming this week I wouldn't push anything more of this into this release unless it's the most expected feature, which it isn't by far. I can test Grub and be really confident about not breaking anything, but I don't almost any experience with the other bootloaders, and neither lots of places nor time to test them. Happy hacking! Miguel --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEiIeExBRZrMuD5+hMY0xuiXn6vsIFAl+NmCwACgkQY0xuiXn6 vsKp/Av/cvd5TBYPkCKZklTaUGUul2LGwKtXNy0fsOlPf+5np00Asw5fT7jdQz+b dEgjnnasDc9zjxmYHHuPrRPbkIAtwOz9IWpZwfCt5tJL/KuDSRC+fYoB0E9LxteL vLNqo/0nGvi/21V+pdDQQu3gj5Hl4ifjcSjEVi1MERzOM7Q1A2i0/gb94+8SmJJM 1BHxwTSP1Fz81Yn11z5oU6nKgQgZlulXgaH/iMrVeV7RRCk8dHfvZzSOe2Sydrpo E0xGAffVPJwbipJ9yWEv082o03tmzfbFbP5deyen1OitSYWLFQvKa6T+Tll+IMLb wZiUlgvlsmuQRGGPgEottWY/tJhmOQeFJmUdldVp13udzpN6upP+BwWchwNZNeQt 9B71tSFDUcCw9xmgtlBqhE4kq7X8m/wo3fb047XIECVqU7UxZvfRzopjHoN1c1J0 c+PYRn8S/LCQbaNE6LovhME7TwCO5ized/Hr3AOSkaY0194FMaRHPh9lkqNKPW6s 5VHXVRQN =hMu+ -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 01:42:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Oct 2020 20:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160322702625600 (code B ref 35394); Tue, 20 Oct 2020 20:51:01 +0000 Received: (at 35394) by debbugs.gnu.org; 20 Oct 2020 20:50:26 +0000 Received: from localhost ([127.0.0.1]:46965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUyaP-0006eq-QA for submit@debbugs.gnu.org; Tue, 20 Oct 2020 16:50:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUyaO-0006ed-7l for 35394@debbugs.gnu.org; Tue, 20 Oct 2020 16:50:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35302) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUyaG-0001Y5-Ep; Tue, 20 Oct 2020 16:50:18 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40380 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kUyaF-0000a9-Nt; Tue, 20 Oct 2020 16:50:16 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> <87o8ky1tx6.fsf@gnu.org> <878sc2phn3.fsf@gmail.com> <87lfg2z703.fsf@gnu.org> <87lfg2nxeb.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 20 Oct 2020 22:50:14 +0200 In-Reply-To: <87lfg2nxeb.fsf@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Mon, 19 Oct 2020 15:44:12 +0200") Message-ID: <87zh4gbp15.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hola, Miguel =C3=81ngel Arruga Vivas skribis: > Ludovic Court=C3=A8s writes: >> We may end up delaying that post-release if there=E2=80=99s potential for >> breakage. We=E2=80=99ll see. > > With the release coming this week I wouldn't push anything more of this > into this release unless it's the most expected feature, which it isn't > by far. I can test Grub and be really confident about not breaking > anything, but I don't almost any experience with the other bootloaders, > and neither lots of places nor time to test them. Sounds good, let=E2=80=99s take it post-release then. Perhaps we should track it in a different issue and close this one? Thanks! Ludo=E2=80=99. From unknown Tue Jun 17 01:42:58 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Miguel Subject: bug#35394: closed (Re: [bug#35394] [PATCH 4/4 v4] Grub i18n) Message-ID: References: <87wnzkk33p.fsf@gmail.com> <20190423151702.05258473@gmail.com> X-Gnu-PR-Message: they-closed 35394 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 35394@debbugs.gnu.org Date: Tue, 20 Oct 2020 21:21:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1603228862-28587-1" This is a multi-part message in MIME format... ------------=_1603228862-28587-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35394: [PATCH 0/3] Bootloader localization which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35394@debbugs.gnu.org. --=20 35394: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35394 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1603228862-28587-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35394-done) by debbugs.gnu.org; 20 Oct 2020 21:20:19 +0000 Received: from localhost ([127.0.0.1]:47005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUz3L-0007PK-Fm for submit@debbugs.gnu.org; Tue, 20 Oct 2020 17:20:19 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUz3J-0007P2-RT for 35394-done@debbugs.gnu.org; Tue, 20 Oct 2020 17:20:18 -0400 Received: by mail-wr1-f66.google.com with SMTP id g12so4379115wrp.10 for <35394-done@debbugs.gnu.org>; Tue, 20 Oct 2020 14:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Cw0YUIN1MaboMBt9+v5H87DE8JBbgadABNCCcKOoMG4=; b=LuokQCkI9HN4Kah5/pZfTv8kIQoh/LINNquQq35wHi5H6LDEYa4BO7q5nGhNssiL6M /3Rayo0fxuj+ebVcbYhNM5wDS2inV2F6Bu+8A3b77RLKADjyrY9FFB353JtwNJX6VQRK duIwesAStX/q28KKb5AlD1WG2pziuk0NGWyz2r0xCvvSCaeUB7Xlx+fgwHnZUS6RHBie Qg/xu2hvRp5UqmndB7At/I1pm1P3pUk1L6vK3Wx15fIPVX+sNbABLd5BzPXtZcFw/wMg /TRp9uWrgCHqBTb69WygEjvTlIpskEChoH0f29tMl2nHXFh9th9w10btMuZW334EaGGJ eP1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Cw0YUIN1MaboMBt9+v5H87DE8JBbgadABNCCcKOoMG4=; b=DEF6ncQQ2DVdJaUsf/x3MPxEaTk7iB6piNYzimHX2abxwf+R8g7q54aLcL+IDldIg/ zSAB6tmsls2F0tsMogIV0oj6qKhbIGywD6EH/zfVNVBEaaMN86Ti8ozd5X+5klw3XTrv Fydjlvt0FXpd2RvdVtyQawUQ8iK6KBXMsP8T/C/1rBpIvXN3gr06bjOONVkuWySrsbC0 CAZMB55K8szuFBVZZKrihUPU6xy/tyIxqAevdXUPaEHS5ZQ4GDrXTMxqaFYlCrnrGPYi RQQty01NyRaZTc4WHRdKqcyOLIQs3Jf6rwZES0Z6fPgOhMzIb9an7tOwfYjW7js0uCkR B8mg== X-Gm-Message-State: AOAM531Dc07femnNyU4A1yLuidW8xBAxVo5uvX1Ucul0PfwKAFEOi2fZ CHD1iy8Pzs4go0xORQPO8vFzWT6rtqfHOw== X-Google-Smtp-Source: ABdhPJzPehw+lTZzhJRmS60mytblfP4mdf3qsf/H8YwNiQilWk3XTG4DBjO79KiACIvpudmpoE6sgA== X-Received: by 2002:a1c:e154:: with SMTP id y81mr75578wmg.111.1603228811646; Tue, 20 Oct 2020 14:20:11 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id e15sm43911wro.13.2020.10.20.14.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 14:20:10 -0700 (PDT) From: =?utf-8?Q?Miguel_=C3=81ngel_Arruga_Vivas?= To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#35394] [PATCH 4/4 v4] Grub i18n References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> <87o8ky1tx6.fsf@gnu.org> <878sc2phn3.fsf@gmail.com> <87lfg2z703.fsf@gnu.org> <87lfg2nxeb.fsf@gmail.com> <87zh4gbp15.fsf@gnu.org> Date: Tue, 20 Oct 2020 23:19:06 +0200 In-Reply-To: <87zh4gbp15.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 20 Oct 2020 22:50:14 +0200") Message-ID: <87wnzkk33p.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35394-done Cc: 35394-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Salut! Ludovic Court=C3=A8s writes: > Hola, > > Miguel =C3=81ngel Arruga Vivas skribis: > >> Ludovic Court=C3=A8s writes: >>> We may end up delaying that post-release if there=E2=80=99s potential f= or >>> breakage. We=E2=80=99ll see. >> >> With the release coming this week I wouldn't push anything more of this >> into this release unless it's the most expected feature, which it isn't >> by far. I can test Grub and be really confident about not breaking >> anything, but I don't almost any experience with the other bootloaders, >> and neither lots of places nor time to test them. > > Sounds good, let=E2=80=99s take it post-release then. > > Perhaps we should track it in a different issue and close this one? Done, probably tomorrow I'll open a new one with a good description and send the patch there as soon as it's ready. > Thanks! Thank you too, very much. :-) Happy hacking! Miguel --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEiIeExBRZrMuD5+hMY0xuiXn6vsIFAl+PVEsACgkQY0xuiXn6 vsIJ3QwAg850KKYdGjDsqCxmqyqm/hhH+MPP4sOVnzcF25V/q27NyzYh4Q+akE+h N4YaBo4SbQsl8tYJka8F+tnJpMoZrP1CPTELDbzvli2XtxL5ik9MDudviB3hRjtA H5GdOY3lMG0U25SLQluPvpVjtZKPm2xcZn0caL4mf1qYhH+fE+i/oihl2U+VwA7v wYMsQVANomWqpvBEvRNfy9cIHPH9asDQMUauRozjcBNr2K2prwYnQCGNE7G+6mcW CAwoR7tMXcQ/vjs+RXZ67NMdgMTeuscRtSwC2rabTSYUZGrxgkINzOTYl21unJwX 6uKYXMdL33Hm4j85SSpRCEw0HXnBONihyeZys6ehKDP+0JxL08VxTAG+nYQbJFgB ujcB/l2ontmvfJJkb9cvHXaykih1HRxW/iA9BVbxKni4qT69QOcVDOaRKvlArb/F +yyeD2HVy7yxh+Oi0IE/Kt6hxY5F7tbbwd+V0J9OVnVlItm+jmmZzHojSesusDHE rITUap5o =4JF1 -----END PGP SIGNATURE----- --=-=-=-- ------------=_1603228862-28587-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Apr 2019 13:17:26 +0000 Received: from localhost ([127.0.0.1]:52730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvIb-0006vr-SD for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:17:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIvIZ-0006vW-N8 for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:17:23 -0400 Received: from lists.gnu.org ([209.51.188.17]:50663) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIvIP-0001t6-AB for submit@debbugs.gnu.org; Tue, 23 Apr 2019 09:17:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvIN-00044U-8k for guix-patches@gnu.org; Tue, 23 Apr 2019 09:17:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIvIL-0001p0-QI for guix-patches@gnu.org; Tue, 23 Apr 2019 09:17:10 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIvIL-0001nC-5I for guix-patches@gnu.org; Tue, 23 Apr 2019 09:17:09 -0400 Received: by mail-wr1-x42a.google.com with SMTP id g3so20161634wrx.9 for ; Tue, 23 Apr 2019 06:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=88xHXOthoArGra05AlKrpaKo05jOeki3GS9dmWa1QYI=; b=dTh+PJmtHMfG+ovkxpDm8qdtB3P7lVUdNgi1mNwnaYZbwjWOH8hxUNUPDIDQorqj1N +7663WhCUyAYy07NBq4N+AZ755vlxAcsCahO5LRopizGcXDCJsPOkwrj666f171csy4b 49b9HgA8p41YOUhMHZtN80wHSeUu9p54o6OcVPAATlg6i8zfdBAWbVW8Mw0IQNBDI0F4 LOQpcLAaYXBSL2w2rOnRp+ZJIQ1s/OpOC9L4/SVcihE0FPTb4haLlyk3SlI5lrl12+MK toIEh+dv35K90+SzyRb1TsBHJsyqAkGj1umYUlrmxda9dPpDCF9t2tWdjzctkOHNVKEk 8mpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=88xHXOthoArGra05AlKrpaKo05jOeki3GS9dmWa1QYI=; b=mSPZF3rhPy1I3obRn5oXZ+Gv8wu3fuvnJx6bJh7JeaUyFMw2C3bBZ+G+csJJJdcEgy qr+/B+d3bhOAL6sGNUNmKLM2sdihRYZMyFqbOlp2nXkEZYOJcMVI6RmJwlLDrqo01lXp ArhimTY0BV+CnO2INOubbGCLiTBiOQdlb94/4pTmvPaGoOfW5L+8k0b4JQ6EBjqfaCD/ D3kh+k8e3UIijBt2ZyTxJd/WHYTJJSZLFa4atK0tjfkn/xGvUAP8jNreTe8KEAI0dYSD GQYl16hwVqzvS9s9pVlwH2r82HfO7CoZdbFnAA2tuRsN2USWGCVYIe9RjcKarYbibnI4 IjrA== X-Gm-Message-State: APjAAAWYsPbGD16epYfmAiMHUdG1+I3agD7b6OiczwVCXmQ1XbYitJrZ 25+rxmLlfeFSeH/DRquRHTaF13tljwYZVw== X-Google-Smtp-Source: APXvYqxbef4pySyIxZ+tujMmJb64DQimjY886g/3fDZGpsuUxU788FuMajqjNhNITUBU+kj0dvKhww== X-Received: by 2002:adf:ee82:: with SMTP id b2mr13083797wro.233.1556025427520; Tue, 23 Apr 2019 06:17:07 -0700 (PDT) Received: from localhost (19.49.134.37.dynamic.jazztel.es. [37.134.49.19]) by smtp.gmail.com with ESMTPSA id w11sm31180322wre.15.2019.04.23.06.17.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 06:17:07 -0700 (PDT) Date: Tue, 23 Apr 2019 15:17:02 +0200 From: Miguel To: Guix-devel Subject: [PATCH 0/3] Bootloader localization Message-ID: <20190423151702.05258473@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hello Guix! As a Grub translator, I've been hacking a little bit in order to provide locale information to Grub. I use Guix in a daily basis, as my main computer operating system, and I this is a key step in order to provide a better experience to the all kind of users, who may do not know other languages than their native one. My current idea, implemented in the following patches, is something along these lines: 1. Store locale information into boot-parameters file. This patch contains a quite silly test that requires wiser review. 2. Provide this information to the bootloader at the configuration time. This, ideally, should provided at installation time too, but I'm stuck seeing my first messages in english when grub asks for the whole-disk encryption passphrase as I don't know how to create a working core.img yet. 3. Add a snippet to the generated grub.cfg file with the language information. Some configurations, as /boot in a separate partition, does not work with this patch, but take it as a proof of concept. Lacking points: 1. No support for other bootloaders yet. I don't know any of them too much, but I'm unaware of their localization support. 2. Grub installation process is not transactional enough. I have some ideas for that, to be discussed in another thread, although one key point is tightly related with this topic: /boot/grub/locale generation. Having this folder as a derivation would make explicit the dependency, but I have to work more on this and I'm open to any ideas. WDYT? Best regards, Miguel ------------=_1603228862-28587-1--