GNU bug report logs - #45021
[PATCH 1/2] image: Add system field.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Mathieu Othacehe <othacehe@HIDDEN>; Keywords: patch; merged with #45020, #45022; dated Thu, 3 Dec 2020 10:55:03 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Merged 45020 45021 45022. Request was from Mathieu Othacehe <mathieu@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Merged 45020 45021. Request was from Mathieu Othacehe <mathieu@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Dec 2020 10:54:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 03 05:54:21 2020
Received: from localhost ([127.0.0.1]:38575 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kkmFh-0003H5-8v
	for submit <at> 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 <othacehe@HIDDEN>) id 1kkmFg-0003Gs-0a
 for submit <at> 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 <othacehe@HIDDEN>) id 1kkmFf-0003hK-Oq
 for guix-patches@HIDDEN; 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 <othacehe@HIDDEN>)
 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 <othacehe@HIDDEN>)
 id 1kkmFW-0006vx-AP; Thu, 03 Dec 2020 05:54:11 -0500
From: Mathieu Othacehe <othacehe@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 1/2] image: Add system field.
Date: Thu,  3 Dec 2020 11:53:52 +0100
Message-Id: <20201203105353.149482-2-othacehe@HIDDEN>
X-Mailer: git-send-email 2.29.2
In-Reply-To: <20201203105353.149482-1-othacehe@HIDDEN>
References: <20201203105353.149482-1-othacehe@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: dannym@HIDDEN, Mathieu Othacehe <othacehe@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/image.scm (<system>): 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





Acknowledgement sent to Mathieu Othacehe <othacehe@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#45021; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 3 Dec 2020 11:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.