From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oOQbAEpYnF/ZcgAA0tVLHw (envelope-from ) for ; Fri, 30 Oct 2020 18:15:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0DN5N0lYnF+aIgAAbx9fmQ (envelope-from ) for ; Fri, 30 Oct 2020 18:15:37 +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 58495940222 for ; Fri, 30 Oct 2020 18:15:37 +0000 (UTC) Received: from localhost ([::1]:35252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYYw4-0007XQ-77 for larch@yhetil.org; Fri, 30 Oct 2020 14:15:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYYuY-0006Yo-P6 for bug-guix@gnu.org; Fri, 30 Oct 2020 14:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYYuY-0005nl-GC for bug-guix@gnu.org; Fri, 30 Oct 2020 14:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYYuY-0003Iw-Bn for bug-guix@gnu.org; Fri, 30 Oct 2020 14:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44196: [PATCH v5 3/4] system: Do not depend on locale folder generated by Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 30 Oct 2020 18:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44196 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 44196@debbugs.gnu.org Received: via spool by 44196-submit@debbugs.gnu.org id=B44196.160408160412646 (code B ref 44196); Fri, 30 Oct 2020 18:14:02 +0000 Received: (at 44196) by debbugs.gnu.org; 30 Oct 2020 18:13:24 +0000 Received: from localhost ([127.0.0.1]:59642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYYtw-0003Hu-IL for submit@debbugs.gnu.org; Fri, 30 Oct 2020 14:13:24 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:35087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYYtu-0003HV-Ho for 44196@debbugs.gnu.org; Fri, 30 Oct 2020 14:13:23 -0400 Received: by mail-wr1-f51.google.com with SMTP id n15so7491314wrq.2 for <44196@debbugs.gnu.org>; Fri, 30 Oct 2020 11:13:22 -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=cU2dBWZWkU+jpa2kMVbbCs/sd0GUwWDAqchql3GCLwU=; b=PtM+0IFzhdCwwXAvZnKCj92rkNovvXtklsibU5M0jDbIyLskXtwHG/UrZReM6QBNiC Gp19MISs/orapaHLfNm+Bi27/zFLBc6eR+dEXXf/3WC0qJbQ8WBNOdRINV+rnYUos5/n 6WWl3vyOm2JOc5AesbHcqfSqbXIEyTtt5D1Q9TshCcUprWsUyjwOWB+88NNZVJDLPZif nxa4fW9j/4p3K2WaquUVHAObFkikda2IWJQeIhi8RprgjkehLJHp5KBFQ0PCrtgH5WVx Ety7wKtfqEyWt5k9QtJQ9lYwkOBIbRlIS8eOM7a8G2tD3JYgnN5jigzs1TLSsXNXdeit 2bNw== 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=cU2dBWZWkU+jpa2kMVbbCs/sd0GUwWDAqchql3GCLwU=; b=XsE6AdukMHQxJFfZzNi2IlI9kIYk+Qt3NwQ9XXB7ScMFJsSjQVq84JsqftFUPi5BQN IbeJSa86ehSMdBa+z2T0qOoaDbSs0SERcEJzgQeVqk0eminvEH3eM1OqlWH8ZxFTyCzX efOrj5Tp6tWX+3bE6CaF/XWNUK7sHT7Up8knmbYfXSzbxktQ3U1u8BX221oRuXflyL8h jH4iDDgaxeZg8QiCDm12V9U0eq10I1P1rV3fbQvhIWOiesvHwaxt8FoXIS7FkkEwyov7 v2TWW+OmipLWwuuo9wHIz11Gu6ApdGVb9rLtYzBU5hTKopBQbOV5cKJqQctpcIwLBjDA Jgdw== X-Gm-Message-State: AOAM532a/jyUqSELMYM/4WbgUHGdJnmAtxUY1Bq5a4n75MZOrbZ6+gbW MB5WdabtiqW34xWjXxxvGgGkUMFLdjlkTg== X-Google-Smtp-Source: ABdhPJxlgKFffE9YBr070tn7lxpbE7UWJgY9f9lFJA/Iw3Sc4mT87k6m/5Tuwk0Lni91Ydlwpkly8A== X-Received: by 2002:a5d:664b:: with SMTP id f11mr4342618wrw.195.1604081596503; Fri, 30 Oct 2020 11:13:16 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id w1sm1298282wro.44.2020.10.30.11.13.15 for <44196@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 11:13:15 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <878sbvh5j4.fsf@gmail.com> <87tuujfhum.fsf@gmail.com> <87imay7hax.fsf_-_@gmail.com> <87y2jsod97.fsf_-_@gmail.com> <87v9eum3w2.fsf_-_@gmail.com> Date: Fri, 30 Oct 2020 19:13:14 +0100 In-Reply-To: <87v9eum3w2.fsf_-_@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Wed, 28 Oct 2020 22:34:05 +0100") Message-ID: <87mu0360qt.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.8 (/) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=PtM+0IFz; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: gqybyNJQ25zY --=-=-= Content-Type: text/plain Changes w.r.t. previous version: - Call normalize-file (the parameters were there but I lost the call). - Only call search when there is no image configured. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-system-Do-not-depend-on-locale-folder-generated-by-g.patch Content-Description: 0003-v5.patch >From 3eb494947ed863e60d3d49d4ac4a982b1f9237e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sat, 24 Oct 2020 20:36:21 +0200 Subject: [PATCH] system: Do not depend on locale folder generated by grub-install. * gnu/bootloader/grub.scm (define-module): Use (guix packages). (grub-locale-folder): New computed folder. (grub-configuration-file)[locale-config]: Use grub-locale-folder only when a locale is needed. --- gnu/bootloader/grub.scm | 56 +++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 5508319d3b..2604f59117 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -25,6 +25,7 @@ (define-module (gnu bootloader grub) #:use-module (guix build union) + #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) #:use-module (guix utils) @@ -142,6 +143,24 @@ file with the resolution provided in CONFIG." (image->png image #:width width #:height height)) (_ #f))))) +(define (grub-locale-folder grub) + "Generate a folder with the locales from GRUB." + (define builder + #~(begin + (use-modules (ice-9 ftw)) + (let ((locale (string-append #$grub "/share/locale")) + (out #$output)) + (mkdir out) + (chdir out) + (for-each (lambda (lang) + (let ((file (string-append locale "/" lang + "/LC_MESSAGES/grub.mo")) + (dest (string-append lang ".mo"))) + (when (file-exists? file) + (copy-file file dest)))) + (scandir locale))))) + (computed-file "grub-boot-locale" builder)) + (define* (eye-candy config store-device store-mount-point #:key store-directory-prefix port) "Return a gexp that writes to PORT (a port-valued gexp) the 'grub.cfg' part @@ -404,18 +423,33 @@ menuentry ~s { #:port #~port))) (define locale-config - #~(let ((locale #$(and locale - (locale-definition-source - (locale-name->definition locale))))) - (when locale - (format port "\ + (let* ((entry (first all-entries)) + (device (menu-entry-device entry)) + (mount-point (menu-entry-device-mount-point entry)) + (bootloader (bootloader-configuration-bootloader config)) + (grub (bootloader-package bootloader)) + (locale-dir (normalize-file (grub-locale-folder grub) + mount-point + store-directory-prefix))) + + #~(let ((locale #$(and locale + (locale-definition-source + (locale-name->definition locale)))) + (locale-dir #$(and locale locale-dir))) + (when locale + (format port "\ # Localization configuration. -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)))) +~asearch --file --set ~a/es@quot.mo +set locale_dir=~a +set lang=~a~%" + ;; Skip the search if there is an image, because it is + ;; loaded before this fragment, to avoid the extra search. + #$(if (grub-theme-image (bootloader-theme config)) + "# " + "") + locale-dir + locale-dir + locale))))) (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) -- 2.28.0 --=-=-=--