From patchwork Wed May 27 07:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22408 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 7AFA227BBE3; Wed, 27 May 2020 08:25:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F2CA227BBE1 for ; Wed, 27 May 2020 08:25:27 +0100 (BST) Received: from localhost ([::1]:33974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqRL-0005bl-Ip for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQy-00050x-Gy for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQy-0001AN-66 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQy-0003iG-1a for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 6/8] image: Use grub-efi to install the EFI bootloader. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056429114198 (code B ref 41560); Wed, 27 May 2020 07:25:03 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:51 +0000 Received: from localhost ([127.0.0.1]:48086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQk-0003gq-QA for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:51 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:36799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQb-0003fM-C6 for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:41 -0400 Received: by mail-wr1-f45.google.com with SMTP id q11so10789347wrp.3 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ni5lXcHWJaLrQqDdGrXvrHB9x+BF6iJJ8ZFOTLyTxrY=; b=KV1of+KRWXhVyC/jRGu13Yj60RHD7rSyS/XcvLVKK7GbnyFoggYfY+qSMP7jqFm7mo CicOJTu192+wCDJb4f3Z3t5Xj5GQy9WIibqQO3MiIG45nqj6CzkNfdzbJKEtF87Ztz8P MdjM0APeGAyViL1otfrYCm4Rsr+lwaWf8wDQi5s0jP/iw7pMOe1idbFkgZwvze5VgwVL 7AiXEa4rvU7mCv4qw8TEDxiW5qmIDRES0wxcsc0NaRLPz4dVE3iEyUOHVVUZ3tzIJPCX 58t8c/Yn3uhrGjHQ2dLQ8SjDyv2XAtGgr8VyfjNCgAWWoz7vklwKf8JST1mcv9uZ0UAK HOMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ni5lXcHWJaLrQqDdGrXvrHB9x+BF6iJJ8ZFOTLyTxrY=; b=b93VfcSDlyiyE0joaCPt+rETC1DOkS2uuPezmX41reXugBU9RwSAJfLHHGRT+LHIie WZrfjz18RDtn4GzR19OfX2w/Vo4kNCqehUCHm8dXq3XbPrXEgwfzsDVQZMXNpvBidnaL 6xlmr/KUFtgpvUSYYteO1dD9y/nahf+b1MriolJ1GuJ/upjBHQ3XN7ZBgLq+BZKvFpHm S48zNNijL5UUSNcKn2K8leR+y4sAcm5o0Aw6zIzj6SeWC6crae/kHg8/Lh3ofuQ/oFUt LLdxt2Wp2QD7iFhTMuZvOVUMzKwK+oIuFhRjCTppNUac2SylP5Q7VYdj6z6qwOTrB27K TqKg== X-Gm-Message-State: AOAM532133pL4w4cjDviCI1+ESqimoxjxE+MKDOL86K1wqL4EtDAGeMK gLxml2oF7zyw+wAE18BfFhJYalT4bVc= X-Google-Smtp-Source: ABdhPJxrLznZh4TgpGso4ZcC5Cm7vPNhMYcSoDVi2aFiq/Yvt50t7GHNOs4yVcpQ4Hzgwry519nkfA== X-Received: by 2002:a5d:650f:: with SMTP id x15mr23371379wru.100.1590564275096; Wed, 27 May 2020 00:24:35 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:34 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:18 +0200 Message-Id: <20200527072420.26140-6-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * guix/utils.scm (target-intel?): New exported procedure. * gnu/build/image.scm (initialize-efi-partition): Rename bootloader-package argument to grub-efi. * gnu/system/image.scm (system-disk-image): Adapt accordingly to pass grub-efi package. Make sure that grub-efi is not built if we are not targeting an Intel system. --- gnu/build/image.scm | 4 ++-- gnu/system/image.scm | 4 ++++ guix/utils.scm | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 49faeab466..a8594e202b 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -146,10 +146,10 @@ deduplicates files common to CLOSURE and the rest of PREFIX." (define* (initialize-efi-partition root #:key - bootloader-package + grub-efi #:allow-other-keys) "Install in ROOT directory, an EFI loader using BOOTLOADER-PACKAGE." - (install-efi-loader bootloader-package root)) + (install-efi-loader grub-efi root)) (define* (initialize-root-partition root #:key diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 7ac998d861..a706f872a8 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -235,6 +235,10 @@ used in the image." #:references-graphs '#$graph #:deduplicate? #f #:system-directory #$os + #:grub-efi #$(let-system (system target) + (and (target-intel? + (or target system)) + grub-efi)) #:bootloader-package #+(bootloader-package bootloader) #:bootloader-installer diff --git a/guix/utils.scm b/guix/utils.scm index d7b197fa44..fb3b233286 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -74,6 +74,7 @@ %current-target-system package-name->name+version target-mingw? + target-intel? target-arm32? target-aarch64? target-arm? @@ -490,6 +491,10 @@ a character other than '@'." (and target (string-suffix? "-mingw32" target))) +(define* (target-intel? #:optional (target (or (%current-target-system) + (%current-system)))) + (any (cut string-prefix? <> target) '("x86_64" "i686"))) + (define* (target-arm32? #:optional (target (or (%current-target-system) (%current-system)))) (string-prefix? "arm" target))