Subject: [bug#45021] [PATCH 1/2] image: Add system field.

From: Danny Milosavljevic <[email-masked]>
Date: Thu, 3 Dec 2020 21:41:30 +0100

Hi Mathieu,

On Thu,  3 Dec 2020 11:53:52 +0100
Mathieu Othacehe <[email-masked]> wrote:

> 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
> @@ -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))

Should be string=? instead of eq?, otherwise it downloads a cross compiler
for armhf on armhf.

With that change, I tested this patchset on armhf--works fine then.

LGTM!