mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
vm: Remove hard coded kernel file name.
* gnu/system/vm.scm (system-qemu-image/shared-store-script, expression->derivation-in-linux-vm): Use operating-system-kernel-file and system-linux-image-file-name. * gnu/system.scm (system-linux-image-file-name): Add ARM.
This commit is contained in:
parent
5f947808cd
commit
43fe431cce
2 changed files with 9 additions and 5 deletions
|
@ -97,6 +97,8 @@ (define-module (gnu system)
|
|||
operating-system-locale-directory
|
||||
operating-system-boot-script
|
||||
|
||||
system-linux-image-file-name
|
||||
|
||||
boot-parameters
|
||||
boot-parameters?
|
||||
boot-parameters-label
|
||||
|
@ -255,9 +257,10 @@ (define (swap-services os)
|
|||
(define* (system-linux-image-file-name #:optional (system (%current-system)))
|
||||
"Return the basename of the kernel image file for SYSTEM."
|
||||
;; FIXME: Evaluate the conditional based on the actual current system.
|
||||
(if (string-prefix? "mips" (%current-system))
|
||||
"vmlinuz"
|
||||
"bzImage"))
|
||||
(cond
|
||||
((string-prefix? "arm" (%current-system)) "zImage")
|
||||
((string-prefix? "mips" (%current-system)) "vmlinuz")
|
||||
(else "bzImage")))
|
||||
|
||||
(define (operating-system-kernel-file os)
|
||||
"Return an object representing the absolute file name of the kernel image of
|
||||
|
|
|
@ -141,7 +141,8 @@ (define builder
|
|||
(gnu build vm))
|
||||
|
||||
(let ((inputs '#$(list qemu coreutils))
|
||||
(linux (string-append #$linux "/bzImage"))
|
||||
(linux (string-append #$linux "/"
|
||||
#$(system-linux-image-file-name)))
|
||||
(initrd (string-append #$initrd "/initrd"))
|
||||
(loader #$loader)
|
||||
(graphs '#$(match references-graphs
|
||||
|
@ -487,7 +488,7 @@ (define builder
|
|||
|
||||
#$@(if full-boot?
|
||||
#~()
|
||||
#~(" -kernel " #$(operating-system-kernel os) "/bzImage \
|
||||
#~(" -kernel " #$(operating-system-kernel-file os) " \
|
||||
-initrd " #$os-drv "/initrd \
|
||||
-append \"" #$(if graphic? "" "console=ttyS0 ")
|
||||
"--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1 "
|
||||
|
|
Loading…
Reference in a new issue