system: Introduce operating-system-kernel-arguments and use it.

* gnu/system.scm (bootable-kernel-arguments): New variable.
(operating-system-kernel-arguments):  New variable.
(operating-system-bootcfg): Use operating-system-kernel-arguments.
(operating-system-boot-parameters): Use operating-system-kernel-arguments.
This commit is contained in:
Danny Milosavljevic 2017-04-21 14:37:08 +02:00
parent 40fad1c24c
commit 33f0aa8815
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 22 additions and 3 deletions

View File

@ -73,7 +73,7 @@
operating-system-hosts-file operating-system-hosts-file
operating-system-kernel operating-system-kernel
operating-system-kernel-file operating-system-kernel-file
operating-system-user-kernel-arguments operating-system-kernel-arguments
operating-system-initrd operating-system-initrd
operating-system-users operating-system-users
operating-system-groups operating-system-groups
@ -122,6 +122,14 @@
;;; ;;;
;;; Code: ;;; Code:
(define (bootable-kernel-arguments kernel-arguments system.drv root-device)
"Prepend extra arguments to KERNEL-ARGUMENTS that allow SYSTEM.DRV to be
booted from ROOT-DEVICE"
(cons* (string-append "--root=" root-device)
#~(string-append "--system=" #$system.drv)
#~(string-append "--load=" #$system.drv "/boot")
kernel-arguments))
;; System-wide configuration. ;; System-wide configuration.
;; TODO: Add per-field docstrings/stexi. ;; TODO: Add per-field docstrings/stexi.
(define-record-type* <operating-system> operating-system (define-record-type* <operating-system> operating-system
@ -182,6 +190,13 @@
(sudoers-file operating-system-sudoers-file ; file-like (sudoers-file operating-system-sudoers-file ; file-like
(default %sudoers-specification))) (default %sudoers-specification)))
(define (operating-system-kernel-arguments os system.drv root-device)
"Return all the kernel arguments, including the ones not specified
directly by the user."
(bootable-kernel-arguments (operating-system-user-kernel-arguments os)
system.drv
root-device))
;;; ;;;
;;; Services. ;;; Services.
@ -756,7 +771,9 @@ populate the \"old entries\" menu."
#~(string-append "--system=" #$system) #~(string-append "--system=" #$system)
#~(string-append "--load=" #$system #~(string-append "--load=" #$system
"/boot") "/boot")
(operating-system-user-kernel-arguments os))) (operating-system-kernel-arguments os
system
root-device)))
(initrd initrd))))) (initrd initrd)))))
(grub-configuration-file (operating-system-bootloader os) entries (grub-configuration-file (operating-system-bootloader os) entries
#:old-entries old-entries))) #:old-entries old-entries)))
@ -781,7 +798,9 @@ SYSTEM is optional. If given, adds kernel arguments for that system to <boot-pa
(root-device root-device) (root-device root-device)
(kernel (operating-system-kernel-file os)) (kernel (operating-system-kernel-file os))
(kernel-arguments (kernel-arguments
(operating-system-user-kernel-arguments os)) (if system
(operating-system-kernel-arguments os system root-device)
(operating-system-user-kernel-arguments os)))
(initrd initrd) (initrd initrd)
(store-device (fs->boot-device store)) (store-device (fs->boot-device store))
(store-mount-point (file-system-mount-point store)))))) (store-mount-point (file-system-mount-point store))))))