summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-17 01:07:50 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-17 01:11:06 +0200
commitee2a6304f3bcf19df895310aedff372ed7e17c34 (patch)
treea1faa13fb55276d7fbb97917657d872148acd750
parent2378df558a6ca9c1db889294cc08b1229720e912 (diff)
system: Add 'kernel-arguments' field.
* gnu/system.scm (<operating-system>)[kernel-arguments]: New field. (operating-system-grub.cfg): Honor it. (operating-system-parameters-file): Add 'kernel-arguments' to the parameters file. * guix/scripts/system.scm (previous-grub-entries)[system->grub-entry]: Read the 'kernel-arguments' field of the parameters file, when available. * gnu/system/vm.scm (system-qemu-image/shared-store-script): Use (operating-system-kernel-arguments os) in '-append'. * doc/guix.texi (operating-system Reference): Document it.
-rw-r--r--doc/guix.texi4
-rw-r--r--gnu/system.scm16
-rw-r--r--gnu/system/vm.scm3
-rw-r--r--guix/scripts/system.scm11
4 files changed, 24 insertions, 10 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index e4662cbfe1a..2f8c52c8b6e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4825,6 +4825,10 @@ The package object of the operating system kernel to use@footnote{Currently
4825only the Linux-libre kernel is supported. In the future, it will be 4825only the Linux-libre kernel is supported. In the future, it will be
4826possible to use the GNU@tie{}Hurd.}. 4826possible to use the GNU@tie{}Hurd.}.
4827 4827
4828@item @code{kernel-arguments} (default: @code{'()})
4829List of strings or gexps representing additional arguments to pass on
4830the kernel's command-line---e.g., @code{("console=ttyS0")}.
4831
4828@item @code{bootloader} 4832@item @code{bootloader}
4829The system bootloader configuration object. @xref{GRUB Configuration}. 4833The system bootloader configuration object. @xref{GRUB Configuration}.
4830 4834
diff --git a/gnu/system.scm b/gnu/system.scm
index efad14596a5..ed37c320f76 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -68,6 +68,7 @@
68 operating-system-host-name 68 operating-system-host-name
69 operating-system-hosts-file 69 operating-system-hosts-file
70 operating-system-kernel 70 operating-system-kernel
71 operating-system-kernel-arguments
71 operating-system-initrd 72 operating-system-initrd
72 operating-system-users 73 operating-system-users
73 operating-system-groups 74 operating-system-groups
@@ -103,6 +104,8 @@
103 operating-system? 104 operating-system?
104 (kernel operating-system-kernel ; package 105 (kernel operating-system-kernel ; package
105 (default linux-libre)) 106 (default linux-libre))
107 (kernel-arguments operating-system-kernel-arguments
108 (default '())) ; list of gexps/strings
106 (bootloader operating-system-bootloader) ; <grub-configuration> 109 (bootloader operating-system-bootloader) ; <grub-configuration>
107 110
108 (initrd operating-system-initrd ; (list fs) -> M derivation 111 (initrd operating-system-initrd ; (list fs) -> M derivation
@@ -866,11 +869,12 @@ listed in OS. The C library expects to find it under
866 (label (kernel->grub-label kernel)) 869 (label (kernel->grub-label kernel))
867 (linux kernel) 870 (linux kernel)
868 (linux-arguments 871 (linux-arguments
869 (list (string-append "--root=" 872 (cons* (string-append "--root="
870 (file-system-device root-fs)) 873 (file-system-device root-fs))
871 #~(string-append "--system=" #$system) 874 #~(string-append "--system=" #$system)
872 #~(string-append "--load=" #$system 875 #~(string-append "--load=" #$system
873 "/boot"))) 876 "/boot")
877 (operating-system-kernel-arguments os)))
874 (initrd #~(string-append #$system "/initrd")))))) 878 (initrd #~(string-append #$system "/initrd"))))))
875 (grub-configuration-file (operating-system-bootloader os) entries 879 (grub-configuration-file (operating-system-bootloader os) entries
876 #:old-entries old-entries))) 880 #:old-entries old-entries)))
@@ -887,6 +891,8 @@ this file is the reconstruction of GRUB menu entries for old configurations."
887 (label #$label) 891 (label #$label)
888 (root-device #$(file-system-device root)) 892 (root-device #$(file-system-device root))
889 (kernel #$(operating-system-kernel os)) 893 (kernel #$(operating-system-kernel os))
894 (kernel-arguments
895 #$(operating-system-kernel-arguments os))
890 (initrd #$initrd))))) 896 (initrd #$initrd)))))
891 897
892(define (operating-system-derivation os) 898(define (operating-system-derivation os)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 2520493e2e6..b2930091272 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -493,7 +493,8 @@ exec " #$qemu "/bin/" #$(qemu-command (%current-system))
493 #~(" -kernel " #$(operating-system-kernel os) "/bzImage \ 493 #~(" -kernel " #$(operating-system-kernel os) "/bzImage \
494 -initrd " #$os-drv "/initrd \ 494 -initrd " #$os-drv "/initrd \
495 -append \"" #$(if graphic? "" "console=ttyS0 ") 495 -append \"" #$(if graphic? "" "console=ttyS0 ")
496 "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1\" ")) 496 "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1 "
497 (string-join (list #+@(operating-system-kernel-arguments os))) "\" "))
497#$(common-qemu-options image 498#$(common-qemu-options image
498 (map file-system-mapping-source 499 (map file-system-mapping-source
499 (cons %store-mapping mappings))) 500 (cons %store-mapping mappings)))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 6084ab8a372..45f598219da 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -249,16 +249,19 @@ it atomically, and then run OS's activation script."
249 (('boot-parameters ('version 0) 249 (('boot-parameters ('version 0)
250 ('label label) ('root-device root) 250 ('label label) ('root-device root)
251 ('kernel linux) 251 ('kernel linux)
252 _ ...) 252 rest ...)
253 (menu-entry 253 (menu-entry
254 (label (string-append label " (#" 254 (label (string-append label " (#"
255 (number->string number) ", " 255 (number->string number) ", "
256 (seconds->string time) ")")) 256 (seconds->string time) ")"))
257 (linux linux) 257 (linux linux)
258 (linux-arguments 258 (linux-arguments
259 (list (string-append "--root=" root) 259 (cons* (string-append "--root=" root)
260 #~(string-append "--system=" #$system) 260 #~(string-append "--system=" #$system)
261 #~(string-append "--load=" #$system "/boot"))) 261 #~(string-append "--load=" #$system "/boot")
262 (match (assq 'kernel-arguments rest)
263 ((_ args) args)
264 (#f '())))) ;old format
262 (initrd #~(string-append #$system "/initrd")))) 265 (initrd #~(string-append #$system "/initrd"))))
263 (_ ;unsupported format 266 (_ ;unsupported format
264 (warning (_ "unrecognized boot parameters for '~a'~%") 267 (warning (_ "unrecognized boot parameters for '~a'~%")