From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id GKjGEZ4Ug1+KTwAA0tVLHw (envelope-from ) for ; Sun, 11 Oct 2020 14:20:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6GoJDZ4Ug1+cXgAA1q6Kng (envelope-from ) for ; Sun, 11 Oct 2020 14:20:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D12289400BF for ; Sun, 11 Oct 2020 14:20:12 +0000 (UTC) Received: from localhost ([::1]:59900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRcCp-0007KU-D1 for larch@yhetil.org; Sun, 11 Oct 2020 10:20:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRcCg-0007Hh-Vz for guix-patches@gnu.org; Sun, 11 Oct 2020 10:20:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRcCg-0006ls-LC for guix-patches@gnu.org; Sun, 11 Oct 2020 10:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kRcCg-0007YP-GU for guix-patches@gnu.org; Sun, 11 Oct 2020 10:20:02 -0400 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 X-Spam-Score: -0.7 (/) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=lZsp0PTy; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 1.59 X-TUID: ItKNHZFDTA/i --=-=-= 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 --=-=-=--