From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1XSr-0000CS-EL for guix-patches@gnu.org; Fri, 21 Apr 2017 08:15:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1XSp-0004V0-Nq for guix-patches@gnu.org; Fri, 21 Apr 2017 08:15:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33518) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d1XSp-0004Uo-Ke for guix-patches@gnu.org; Fri, 21 Apr 2017 08:15:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d1XSp-00032Q-Eq for guix-patches@gnu.org; Fri, 21 Apr 2017 08:15:03 -0400 Subject: bug#26544: [PATCH v3 3/9] system: Introduce operating-system-kernel-arguments and use it. Resent-Message-ID: From: Danny Milosavljevic Date: Fri, 21 Apr 2017 14:14:36 +0200 Message-Id: <20170421121442.29972-4-dannym@scratchpost.org> In-Reply-To: <20170421121442.29972-1-dannym@scratchpost.org> References: <86h91ikw4m.fsf@gmail.com> <20170421121442.29972-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26544@debbugs.gnu.org * 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 | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 6601147e9..a4f15f7f5 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.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. ;; TODO: Add per-field docstrings/stexi. (define-record-type* operating-system @@ -182,6 +190,13 @@ (sudoers-file operating-system-sudoers-file ; file-like (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. @@ -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-device store)) (store-mount-point (file-system-mount-point store))))))