[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#26544: [PATCH v2 4/8] system: Introduce operating-system-kernel-argu
From: |
Danny Milosavljevic |
Subject: |
bug#26544: [PATCH v2 4/8] system: Introduce operating-system-kernel-arguments and use it. |
Date: |
Fri, 21 Apr 2017 04:21:23 +0200 |
* 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.
---
gnu/system.scm | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index 65803e25b..31764c830 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -73,7 +73,7 @@
operating-system-hosts-file
operating-system-kernel
operating-system-kernel-file
- operating-system-user-kernel-arguments
+ operating-system-kernel-arguments
operating-system-initrd
operating-system-users
operating-system-groups
@@ -122,6 +122,14 @@
;;;
;;; Code:
+(define (bootable-kernel-arguments kernel-arguments system root-device)
+ "Prepend extra arguments to KERNEL-ARGUMENTS that allow SYSTEM to be
+booted from ROOT-DEVICE"
+ (cons* (string-append "--root=" root-device)
+ #~(string-append "--system=" #$system)
+ #~(string-append "--load=" #$system "/boot")
+ kernel-arguments))
+
;; System-wide configuration.
;; TODO: Add per-field docstrings/stexi.
(define-record-type* <operating-system> operating-system
@@ -182,6 +190,13 @@
(sudoers-file operating-system-sudoers-file ; file-like
(default %sudoers-specification)))
+(define (operating-system-kernel-arguments os system 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
+ root-device))
+
;;;
;;; Services.
@@ -756,7 +771,9 @@ populate the \"old entries\" menu."
#~(string-append "--system=" #$system)
#~(string-append "--load=" #$system
"/boot")
- (operating-system-user-kernel-arguments
os)))
+ (operating-system-kernel-arguments os
+ system
+
root-device)))
(initrd initrd)))))
(grub-configuration-file (operating-system-bootloader os) 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)
(kernel (operating-system-kernel-file os))
(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)
(store-device (fs->boot-device store))
(store-mount-point (file-system-mount-point store))))))
@@ -795,7 +814,10 @@ content-addressed \"system\" directory, it's usually not a
good idea
to give it because the content hash would change by the content hash
being stored into the \"parameters\" file)."
(mlet* %store-monad ((root -> (operating-system-root-file-system os))
- (params (operating-system-boot-parameters os system
(file-system-device root))))
+ (device -> (file-system-device root))
+ (params (operating-system-boot-parameters os
+ system
+ device)))
(gexp->file "parameters"
#~(boot-parameters
(version 0)
- bug#26544: [PATCH] system: Move "--load" and other guix-specific parameters from the grub module to the generic system module., (continued)
- bug#26544: [PATCH v2 0/8] system: Move "--load" and other guix-specific parameters from the grub module to the generic system module., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 2/8] system: Rename operating-system-parameters-file to operating-system-boot-parameters-file., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 6/8] system: vm: Use operating-system-kernel-arguments., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 1/8] system: Rename operating-system-kernel-arguments to operating-system-user-kernel-arguments., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 4/8] system: Introduce operating-system-kernel-arguments and use it.,
Danny Milosavljevic <=
- bug#26544: [PATCH v2 7/8] system: Use operating-system-boot-parameters directly., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 3/8] system: Factorize operating-system-boot-parameters-file., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 5/8] system: Introduce read-boot-parameters-file., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 8/8] system: grub: Use boot-parameters instead of menu-entry where possible., Danny Milosavljevic, 2017/04/20
- bug#26544: [PATCH v2 0/8] system: Move "--load" and other guix-specific parameters from the grub module to the generic system module., Mathieu Othacehe, 2017/04/21