[bug#35244,5/6] linux-initrd: Fix cross compilation.

Message ID 20190412131556.25282-5-m.othacehe@gmail.com
State Accepted
Headers show
Series Fix some cross-compilation issues. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Mathieu Othacehe April 12, 2019, 1:15 p.m. UTC
* gnu/system/linux-initrd.scm (default-initrd-modules): Check system name
against %current-target-system first in case we are cross-compiling.
---
 gnu/system/linux-initrd.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Ludovic Courtès April 14, 2019, 3:29 p.m. UTC | #1
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/system/linux-initrd.scm (default-initrd-modules): Check system name
> against %current-target-system first in case we are cross-compiling.

LGTM!

Glad we’re making process on system cross-compilation!  Are you
targeting low-end ARMv7 devices?

Thank you,
Ludo’.
Mathieu Othacehe June 25, 2019, 7:47 p.m. UTC | #2
> LGTM!

Pushed as fdbf4447b.

> Glad we’re making process on system cross-compilation!  Are you
> targeting low-end ARMv7 devices?

Yes as well as more powerful aarch64 boards. I would like to use Guix as
an alternative to various tools such as Yocto/Buildroot at
work. Cross-compiling is the only viable way as target compilation and
qemu-binfmt alternatives are way too slow.

I'll try to resume the rest of the serie soon.

Mathieu
Ludovic Courtès June 26, 2019, 8:57 a.m. UTC | #3
Hello,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>> LGTM!
>
> Pushed as fdbf4447b.

\o/

>> Glad we’re making process on system cross-compilation!  Are you
>> targeting low-end ARMv7 devices?
>
> Yes as well as more powerful aarch64 boards. I would like to use Guix as
> an alternative to various tools such as Yocto/Buildroot at
> work. Cross-compiling is the only viable way as target compilation and
> qemu-binfmt alternatives are way too slow.

qemu-binfmt might be OK if you get enough substitutes and thus have
little to build locally.

Thanks!

Ludo’.

Patch

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 656afd1ddb..c90b87c023 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -2,7 +2,7 @@ 
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -273,7 +273,10 @@  FILE-SYSTEMS."
   (append-map (compose file-system-type-modules file-system-type)
               file-systems))
 
-(define* (default-initrd-modules #:optional (system (%current-system)))
+(define* (default-initrd-modules
+           #:optional
+           (system (or (%current-target-system)
+                       (%current-system))))
   "Return the list of modules included in the initrd by default."
   (define virtio-modules
     ;; Modules for Linux para-virtualized devices, for use in QEMU guests.