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 IBUqBbSJnF8iEwAA0tVLHw (envelope-from ) for ; Fri, 30 Oct 2020 21:46:28 +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 CAXyALSJnF9HNQAAbx9fmQ (envelope-from ) for ; Fri, 30 Oct 2020 21:46:28 +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 71531940149 for ; Fri, 30 Oct 2020 21:46:27 +0000 (UTC) Received: from localhost ([::1]:47960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYcE6-0001mu-EE for larch@yhetil.org; Fri, 30 Oct 2020 17:46:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYcDi-0001me-AH for bug-guix@gnu.org; Fri, 30 Oct 2020 17:46:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYcDi-0001N5-1a for bug-guix@gnu.org; Fri, 30 Oct 2020 17:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYcDi-0002VP-0U for bug-guix@gnu.org; Fri, 30 Oct 2020 17:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44196: [PATCH v6 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 21:46:01 +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.16040943409597 (code B ref 44196); Fri, 30 Oct 2020 21:46:01 +0000 Received: (at 44196) by debbugs.gnu.org; 30 Oct 2020 21:45:40 +0000 Received: from localhost ([127.0.0.1]:60034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYcDL-0002Ui-U0 for submit@debbugs.gnu.org; Fri, 30 Oct 2020 17:45:40 -0400 Received: from mail-wm1-f42.google.com ([209.85.128.42]:52433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYcDJ-0002UT-32 for 44196@debbugs.gnu.org; Fri, 30 Oct 2020 17:45:38 -0400 Received: by mail-wm1-f42.google.com with SMTP id c18so4121869wme.2 for <44196@debbugs.gnu.org>; Fri, 30 Oct 2020 14:45:36 -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=rHqcLq5m4/yKf1xEhLIyI4YSTCx6nPLM5ZUBk8Lr854=; b=gWGmB1GZ8/xRKXU7VYDrV7krYr/YrhDQsge/6vSbrTFUipFn9UbGOqiU9r/GwxFAp4 E6kNw4NoXrlM/9T8iE5j+vcM8uKe4MftfpsxVZ0jQVa/lnytYQIIwKdsKpeBqs3oEBhr pKJ+v/mLk79+Z9xFB203WNU5cFb6AmRzqR38EKGWwP6Dpp0SiBcjuo1Gr4jTilG8Q/+o mdyA72Srr5YDcg3wk5JYl2nHEV5h0mxBDOCsYUPERnTRy1AZVaO5V+fjd9QQ78bEJYDD 9LL4tpIrdgLlW3zjLEW0v5q4+gvIKBaMfu2iMD+mSyykzscMC2SvErQcb4rMlaqrXZ2C xM8w== 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=rHqcLq5m4/yKf1xEhLIyI4YSTCx6nPLM5ZUBk8Lr854=; b=TLIKL0zMaM1+Wa14GT95SWYQTADCUpqR/l2a/NV2tJNqzxALTDjWZeVVYj4RPGUZF3 /PNy3vnu++ncSYqS1A1+VNOFuSF5kyGzlXiLHdAzrw0/bmjzSQ7OGpTU/9ctcizJZxAg DrDdgyEunbBJBcWq3uuceVbbIgL/zWuD4raUEnouQdXIK9L8HRSMe7lpKcuke7dyEJGB K4Z51I22tSDXfUUdNHYwc05hpqIgJlojGhEe3BvuVjw/B/B7q7Z+ib4tSHJyc2NT9mgy c54fC6aGIC2cX7UxQybbm7UlXZfR2sRJ1HaNrEBqN2HaJkLIEfvlXZ/EW+n9cWWC00+p ADrw== X-Gm-Message-State: AOAM530xrUb1AqdeAq+shl7jRR9CmissEI1fxY/X3sawZfOvsnVUICz1 N0b7/Cp/b+MbunTmP1OpeCYaUeQK1belWw== X-Google-Smtp-Source: ABdhPJyAVaBxOJC6gfRtA/Ez/i081LgL3CyNd+6UgoBlDlWaWMzpua/oQJDYZSEKSiwzbNuzLukUDA== X-Received: by 2002:a1c:1946:: with SMTP id 67mr4865073wmz.15.1604094330972; Fri, 30 Oct 2020 14:45:30 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id i14sm5920469wml.24.2020.10.30.14.45.29 for <44196@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 14:45:29 -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> <87mu0360qt.fsf_-_@gmail.com> Date: Fri, 30 Oct 2020 22:45:29 +0100 In-Reply-To: <87mu0360qt.fsf_-_@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Fri, 30 Oct 2020 19:13:14 +0100") Message-ID: <87a6w35qx2.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=gWGmB1GZ; 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: Ztv2PKeSQW3F --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I hope this is the last one, at least for bug fixes. This version uses the right name for the autogenerated file en@quot.mo when no image is provided. Miguel =C3=81ngel Arruga Vivas writes: > 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: v6-grub-locale.patch >From 5886bdf74bda59649b3d17b691132d9d030e0fb4 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..faf319b747 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/en@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 --=-=-=--