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 OGATGE3HyF8OQAAA0tVLHw (envelope-from ) for ; Thu, 03 Dec 2020 11:09:01 +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 GODfE03HyF/LBwAAbx9fmQ (envelope-from ) for ; Thu, 03 Dec 2020 11:09:01 +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 2B8EF9408EE for ; Thu, 3 Dec 2020 11:09:01 +0000 (UTC) Received: from localhost ([::1]:33764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmTs-00045Y-2U for larch@yhetil.org; Thu, 03 Dec 2020 06:09:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmGN-0004FW-NL for guix-patches@gnu.org; Thu, 03 Dec 2020 05:55:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkmGN-0002BY-Ce for guix-patches@gnu.org; Thu, 03 Dec 2020 05:55:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkmGN-0003IS-Ci for guix-patches@gnu.org; Thu, 03 Dec 2020 05:55:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45021] [PATCH 1/2] image: Add system field. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Dec 2020 10:55:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45021 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45021@debbugs.gnu.org Cc: dannym@scratchpost.org, Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160699286112596 (code B ref -1); Thu, 03 Dec 2020 10:55:03 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2020 10:54:21 +0000 Received: from localhost ([127.0.0.1]:38575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkmFh-0003H5-8v for submit@debbugs.gnu.org; Thu, 03 Dec 2020 05:54:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:43674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkmFg-0003Gs-0a for submit@debbugs.gnu.org; Thu, 03 Dec 2020 05:54:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmFf-0003hK-Oq for guix-patches@gnu.org; Thu, 03 Dec 2020 05:54:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41175) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmFf-0001qS-8Y; Thu, 03 Dec 2020 05:54:19 -0500 Received: from [2a01:e0a:19b:d9a0:6132:5f9a:6e69:6e32] (port=54264 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kkmFW-0006vx-AP; Thu, 03 Dec 2020 05:54:11 -0500 From: Mathieu Othacehe Date: Thu, 3 Dec 2020 11:53:52 +0100 Message-Id: <20201203105353.149482-2-othacehe@gnu.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201203105353.149482-1-othacehe@gnu.org> References: <20201203105353.149482-1-othacehe@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.22 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 2B8EF9408EE X-Spam-Score: 2.22 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: Tt1r5M5PCKPf * gnu/image.scm (): New field. * gnu/system/image.scm (arm32-disk-image, arm64-disk-image): Set the system field. (system-image): Do not try to cross-compile if we are running on the appropriate system. * gnu/system/images/hurd.scm (hurd-disk-image): Set the system field. --- gnu/image.scm | 3 +++ gnu/system/image.scm | 12 +++++++++++- gnu/system/images/hurd.scm | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/image.scm b/gnu/image.scm index a60d83b175..a56710d540 100644 --- a/gnu/image.scm +++ b/gnu/image.scm @@ -33,6 +33,7 @@ image image-name image-format + image-system image-target image-size image-operating-system @@ -77,6 +78,8 @@ (name image-name ;symbol (default #f)) (format image-format) ;symbol + (system image-system + (default #f)) (target image-target (default #f)) (size image-size ;size in bytes as integer diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 4972d9067b..f3d5734381 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -131,6 +131,7 @@ (define arm32-disk-image (image (format 'disk-image) + (system "armhf-linux") (target "arm-linux-gnueabihf") (partitions (list (partition @@ -143,6 +144,7 @@ (define arm64-disk-image (image (inherit arm32-disk-image) + (system "aarch64-linux") (target "aarch64-linux-gnu"))) @@ -613,7 +615,15 @@ it can be used for bootloading." "Return the derivation of IMAGE. It can be a raw disk-image or an ISO9660 image, depending on IMAGE format." (define substitutable? (image-substitutable? image)) - (define target (image-target image)) + + ;; The image definition may provide the appropriate "system" architecture + ;; for the image. If we are already running on this system, the image can + ;; be built natively. If we are running on a different system, then we need + ;; to cross-compile, using the "target" provided by the image definition. + (define system (image-system image)) + (define target (if (eq? system (%current-system)) + #f + (image-target image))) (with-parameters ((%current-target-system target)) (let* ((os (operating-system-for-image image)) diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 4417952c5d..6e7dbaa7a7 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -75,6 +75,7 @@ (define hurd-disk-image (image (format 'disk-image) + (system "i586-gnu") (target "i586-pc-gnu") (partitions (list (partition -- 2.29.2