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 OcrzMPBKl1+3RwAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 22:17:20 +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 IKhgLPBKl1/cBAAA1q6Kng (envelope-from ) for ; Mon, 26 Oct 2020 22:17:20 +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 1D1F79400BF for ; Mon, 26 Oct 2020 22:17:20 +0000 (UTC) Received: from localhost ([::1]:47086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXAnm-0005tI-In for larch@yhetil.org; Mon, 26 Oct 2020 18:17:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXAbu-0006rg-Fj for bug-guix@gnu.org; Mon, 26 Oct 2020 18:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58492) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXAbu-0005Pn-4H for bug-guix@gnu.org; Mon, 26 Oct 2020 18:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXAbt-0007q9-Sz for bug-guix@gnu.org; Mon, 26 Oct 2020 18:05:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44196: [PATCH 3/3 v3] system: Do not depend on locale folder generated by grub-install. Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 26 Oct 2020 22:05: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.160374986930085 (code B ref 44196); Mon, 26 Oct 2020 22:05:01 +0000 Received: (at 44196) by debbugs.gnu.org; 26 Oct 2020 22:04:29 +0000 Received: from localhost ([127.0.0.1]:41805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXAbN-0007pB-Ds for submit@debbugs.gnu.org; Mon, 26 Oct 2020 18:04:29 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:32844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXAbM-0007oz-1Z for 44196@debbugs.gnu.org; Mon, 26 Oct 2020 18:04:28 -0400 Received: by mail-wr1-f44.google.com with SMTP id b8so14682321wrn.0 for <44196@debbugs.gnu.org>; Mon, 26 Oct 2020 15:04:28 -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=H5zlzydptPj/W11qDA3HUKZGqp6xQpEaW5hEBeKY5DM=; b=N1W8tz3l8WNa2pOMoFO3lfLiRVs+Ey3STWpxuVV+xZEAe1DsftecEOoDqDegHM6p6j KD6YXiN1fm152z46uU2XwrmkME0Uy6o9PgOxX7A3KeGlCT7+cBn5hO0D6VlmqNS/ZP1W b84vUpnsV89+Ej3CwvwV3sy9wokMpuVwwbh1j4onb1OLyEhNncht9ehy24wMIx4YGcfI lasc4YSDvDmReszbMAzmfOtT0YyryXEz/56z0c/8CTSZFuse2pwbUCVEf6jCTg5nfu+p VyxIwTTo7lWJa8WLxpFDuymhX0awxY3zK86oZJE6hOlJc+FmA8xJMI9xxdhMPxjZY96h rUJA== 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=H5zlzydptPj/W11qDA3HUKZGqp6xQpEaW5hEBeKY5DM=; b=p4TFzCxBHuZ+0VpuRnNe25Cc3/HYyv2Ojf5cioBaR6ENJr0ZOUppRgtViIbw+EyLjp T6SYnV9eC5BRwXtig0jrs8fX50Z4FeZw4EBqyG6WC4Ayc4vp60zukIe+hxjuqnrEIIGT pGiQz922S+IeVRldzdeeVQBoIMY9Vs/M4Cb47suglF6f3NXrMejB2d60/DCHDLjHTInE 5xQLQtDcwhw9P6XzwR3TvUnG7SPhjake15zb8jomKn/C3QA0n9l7PzF6hJm9NUk93mbt bZ2HeZDjBdvXdeRi2CFWClB/2ikWI3lzz1wLMRWThFeLBlLUUdWWHRphEzU6ybbtUrFM 75kQ== X-Gm-Message-State: AOAM533bkjqf1dvvCSPmzQ3pbJiS0XrATbH90TddmkHPefRxDn1xQZRR XC5fl++KwqxnkvKMH0IfXpXAYPz4RShq3Q== X-Google-Smtp-Source: ABdhPJwCi6aUfI+r8tgwbfLkkbFYX7KF6EiE7VXmYZo0Fu5hpmKoI6OlKeUv1XdJruX3q1hvp5pR3w== X-Received: by 2002:a5d:654d:: with SMTP id z13mr20124254wrv.6.1603749861982; Mon, 26 Oct 2020 15:04:21 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id w1sm24155321wrp.95.2020.10.26.15.04.20 for <44196@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 15:04:21 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <878sbvh5j4.fsf@gmail.com> <87tuujfhum.fsf@gmail.com> <87imay7hax.fsf_-_@gmail.com> Date: Mon, 26 Oct 2020 23:04:20 +0100 In-Reply-To: <87imay7hax.fsf_-_@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Sun, 25 Oct 2020 11:04:22 +0100") Message-ID: <87y2jsod97.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: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=N1W8tz3l; 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: wiHncnm/kKuy --=-=-= Content-Type: text/plain This version doesn't modify grub package at all, and it only generates the folder when needed, and fixes a bug in Grub 2.04 that I didn't noticed until I started playing with the installer: https://savannah.gnu.org/bugs/?57889 Happy hacking! Miguel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v3-0003-system-Do-not-depend-on-locale-folder-generated-b.patch Content-Description: 0003-v3-system-do-not-depend-on-locale-folder.patch >From 770532b931c312edb9f9a075d86dc132b804dc0b 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 v3 3/5] 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 | 50 ++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index f1479024e6..b610ecbfe5 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,25 @@ 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)) + + (define (copy-mo lang-path) + (let ((file (string-append lang-path "/LC_MESSAGES/guix.mo")) + (mo (string-append (basename lang-path) ".mo"))) + (when (file-exists? file) + (copy-file file mo)))) + + (let* ((locale (string-append #$grub "/share/locale")) + (langs (scandir locale))) + (mkdir #$output) + (chdir #$output) + (for-each copy-mo langs)))) + (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 @@ -402,18 +422,26 @@ 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 (grub-locale-folder grub))) + + #~(let ((locale #$(and locale + (locale-definition-source + (locale-name->definition locale)))) + (locale-dir #$(and locale (grub-locale-folder grub)))) + (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)))) +search --file --set ~a +set locale_dir=~a +set lang=~a~%" + (string-append locale-dir "/es@quot.mo") + locale-dir + locale))))) (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) -- 2.28.0 --=-=-=--