diff options
author | Mathieu Othacehe <m.othacehe@gmail.com> | 2019-08-21 09:19:58 +0200 |
---|---|---|
committer | Mathieu Othacehe <m.othacehe@gmail.com> | 2019-12-01 16:51:40 +0100 |
commit | d4ddf22d54f9374715c651aaebda2315e9f89272 (patch) | |
tree | 51438303a495f8319417d481454229d5f6005552 /gnu/system.scm | |
parent | 39c746f08148d5f7e84d00c8cda98ad310baa4ca (diff) | |
download | patches-d4ddf22d54f9374715c651aaebda2315e9f89272.tar patches-d4ddf22d54f9374715c651aaebda2315e9f89272.tar.gz |
system: vm: Support cross-compilation.
* gnu/system.scm (system-linux-image-file-name): Add support for cross-built
systems. Remove system argument that was ignored,
(operating-system-kernel-file): adapt by removing ignored os argument.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target
argument and turn inputs into native-inputs. Pass target to qemu-command
and gexp->derivation calls.
(iso9660-image): Add target argument and pass it to
expression->derivation-in-linux-vm. Remove qemu from inputs as it
is not necessary.
(qemu-image): Add target argument, also remove qemu from inputs. Pass
target argument to expression->derivation-in-linux-vm call.
Diffstat (limited to 'gnu/system.scm')
-rw-r--r-- | gnu/system.scm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index a353b1a5c8..96c2b5aad3 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -447,20 +447,21 @@ from the initrd." "Return the list of swap services for OS." (map swap-service (operating-system-swap-devices os))) -(define* (system-linux-image-file-name #:optional (system (%current-system))) +(define* (system-linux-image-file-name) "Return the basename of the kernel image file for SYSTEM." ;; FIXME: Evaluate the conditional based on the actual current system. - (cond - ((string-prefix? "arm" (%current-system)) "zImage") - ((string-prefix? "mips" (%current-system)) "vmlinuz") - ((string-prefix? "aarch64" (%current-system)) "Image") - (else "bzImage"))) + (let ((target (or (%current-target-system) (%current-system)))) + (cond + ((string-prefix? "arm" target) "zImage") + ((string-prefix? "mips" target) "vmlinuz") + ((string-prefix? "aarch64" target) "Image") + (else "bzImage")))) (define (operating-system-kernel-file os) "Return an object representing the absolute file name of the kernel image of OS." (file-append (operating-system-kernel os) - "/" (system-linux-image-file-name os))) + "/" (system-linux-image-file-name))) (define* (operating-system-directory-base-entries os) "Return the basic entries of the 'system' directory of OS for use as the |