From patchwork Tue Apr 23 13:26:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miguel Arruga Vivas X-Patchwork-Id: 13737 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E91A216EFC; Tue, 23 Apr 2019 14:30:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9C04216EFA for ; Tue, 23 Apr 2019 14:30:41 +0100 (BST) Received: from localhost ([127.0.0.1]:53969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvVR-0006uC-7J for patchwork@mira.cbaines.net; Tue, 23 Apr 2019 09:30:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvRw-0003g0-Ii for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIvRu-0001y6-9b for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39206) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIvRu-0001xp-3X for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIvRt-0007GB-SG for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:01 -0400 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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(-) From ca81983f4fcab05472088b181406f21c80441c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= 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 = \ 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 © 2016 Chris Marusich ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Meiyo Peng +;;; Copyright © 2019 Miguel Ángel 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)) (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 true, 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)))) (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 params)))) + (mount-point #$(boot-parameters-store-mount-point params))) + (locale #$(boot-parameters-locale params))) #:set-load-path? #f))) (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 © 2019 Miguel Ángel 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-point)) + "") + (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") -- 2.21.0 From patchwork Tue Apr 23 13:26:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Arruga Vivas X-Patchwork-Id: 13738 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1BF8516EFC; Tue, 23 Apr 2019 14:33:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 987B116EFA for ; Tue, 23 Apr 2019 14:33:33 +0100 (BST) Received: from localhost ([127.0.0.1]:53988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvYD-0000Ek-5F for patchwork@mira.cbaines.net; Tue, 23 Apr 2019 09:33:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvRv-0003eR-UI for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIvRu-0001yN-Kd for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39207) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIvRu-0001yG-Ex for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIvRu-0007GI-BE for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:02 -0400 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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(-) 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 From patchwork Tue Apr 23 13:26:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miguel Arruga Vivas X-Patchwork-Id: 13736 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B33B116EFD; Tue, 23 Apr 2019 14:30:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F20F516EFA for ; Tue, 23 Apr 2019 14:30:35 +0100 (BST) Received: from localhost ([127.0.0.1]:53965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvVJ-0006ov-51 for patchwork@mira.cbaines.net; Tue, 23 Apr 2019 09:30:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIvRw-0003et-57 for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIvRv-0001yn-2w for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIvRu-0001yf-U7 for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIvRu-0007GQ-PW for guix-patches@gnu.org; Tue, 23 Apr 2019 09:27:02 -0400 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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(+) From 762b00327be7a21ac3e04b10610666b0d323104b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= 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 © 2016 Chris Marusich ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2019 Miguel Ángel 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)))) +(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=~a + set lang=~a +fi~%" + #$(grub-root-search store-device (grub-locale-file)) + #$grub-locale-dir + #$grub-locale-dir + #$(grub-lang-id)))) + ;;; ;;; 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-entries)) + #:locale locale #:port #~port)) (define builder #~(call-with-output-file #$output @@ -374,6 +410,7 @@ keymap ~a~%" keymap))))) ") #$sugar #$keyboard-layout-config + #$locale-config (format port " set default=~a set timeout=~a~%" -- 2.21.0 From patchwork Fri Apr 26 10:51:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miguel Arruga Vivas X-Patchwork-Id: 13756 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8AE6216F48; Fri, 26 Apr 2019 11:52:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 015F716F46 for ; Fri, 26 Apr 2019 11:52:16 +0100 (BST) Received: from localhost ([127.0.0.1]:44698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJySl-0003Sz-LE for patchwork@mira.cbaines.net; Fri, 26 Apr 2019 06:52:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJySi-0003SY-7X for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJySe-00028O-CH for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJySY-00024u-Lo for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJySY-0004aY-D3 for guix-patches@gnu.org; Fri, 26 Apr 2019 06:52:02 -0400 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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(+) From 216f818bb27d3c491681c4d67e483279c3065b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Fri, 26 Apr 2019 11:58:43 +0200 Subject: [PATCH 4/4] system: Use locale information in grub.cfg. * gnu/bootloader/grub.scm (module-declaration): Add (gnu system locale). (locale-config-entries): New procedure. (grub-configuration-file): Use locale-config-entries. --- gnu/bootloader/grub.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 446f90157c..92c33063c3 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2019 Miguel Ángel 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)))) +(define* (locale-config-entries config store-mount-point #:key locale port) + "Return a gexp that writes to PORT (a port-valued gexp) the +'grub.cfg' part concerned with locale configuration." + (define grub (bootloader-package + (bootloader-configuration-bootloader config))) + (define (locale-dir) + #~(let ((dir #$grub:locale)) + dir)) + (define (lang-id) + (let ((definition (locale-name->definition locale))) + (locale-definition-source definition))) + + (and locale + (member "locale" (package-outputs grub)) + #~(format #$port " +# Configure GRUB with the selected locale. +set locale_dir=~a +set lang=~a~%" + #$(strip-mount-point store-mount-point (locale-dir)) + #$(lang-id)))) + ;;; ;;; Configuration file. @@ -364,6 +387,10 @@ entries corresponding to old generations of the system." terminal_input at_keyboard insmod keylayouts keymap ~a~%" keymap))))) + (define locale-config + (locale-config-entries config + (menu-entry-device-mount-point (first all-entries)) + #:locale locale #:port #~port)) (define builder #~(call-with-output-file #$output @@ -374,6 +401,7 @@ keymap ~a~%" keymap))))) ") #$sugar #$keyboard-layout-config + #$locale-config (format port " set default=~a set timeout=~a~%" -- 2.21.0