From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d71rP-0005Am-9O for guix-patches@gnu.org; Sat, 06 May 2017 11:43:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d71rM-0000Fy-6z for guix-patches@gnu.org; Sat, 06 May 2017 11:43:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d71rM-0000Fs-3B for guix-patches@gnu.org; Sat, 06 May 2017 11:43:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d71rL-0002d3-Tb for guix-patches@gnu.org; Sat, 06 May 2017 11:43:03 -0400 Subject: bug#26339: [PATCH v3 5/9] bootloader: Add device and type to bootloader-configuration record. Resent-Message-ID: From: Mathieu Othacehe Date: Sat, 6 May 2017 17:41:50 +0200 Message-Id: <20170506154154.17836-6-m.othacehe@gmail.com> In-Reply-To: <20170506154154.17836-1-m.othacehe@gmail.com> References: <20170506154154.17836-1-m.othacehe@gmail.com> 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: 26339@debbugs.gnu.org * gnu/system.scm ()[device, type]: New fields. (boot-parameters-boot-device): New exported procedure. (boot-parameters-boot-type): Ditto. (operating-system-grub.cfg): Add new fields. (operating-system-parameters-file): Add new fields and replace GRUB by bootloader in doctype. (read-boot-parameters): Ditto. --- gnu/system.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/system.scm b/gnu/system.scm index b947d982d..6d4cbf737 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -104,6 +104,8 @@ boot-parameters? boot-parameters-label boot-parameters-root-device + boot-parameters-boot-device + boot-parameters-boot-type boot-parameters-store-device boot-parameters-store-mount-point boot-parameters-kernel @@ -772,6 +774,10 @@ kernel arguments for that derivation to ." (mlet* %store-monad ((initrd (operating-system-initrd-file os)) (store -> (operating-system-store-file-system os)) + (boot-device -> (bootloader-configuration-device + (operating-system-bootloader os))) + (boot-type -> (bootloader-configuration-type + (operating-system-bootloader os))) (label -> (kernel->boot-label (operating-system-kernel os)))) (return (boot-parameters (label label) @@ -782,6 +788,8 @@ kernel arguments for that derivation to ." (operating-system-kernel-arguments os system.drv root-device) (operating-system-user-kernel-arguments os))) (initrd initrd) + (boot-device boot-device) + (boot-type boot-type) (store-device (fs->boot-device store)) (store-mount-point (file-system-mount-point store)))))) @@ -807,6 +815,8 @@ being stored into the \"parameters\" file)." (kernel-arguments #$(boot-parameters-kernel-arguments params)) (initrd #$(boot-parameters-initrd params)) + (boot-device #$(boot-parameters-boot-device params)) + (boot-type #$(boot-parameters-boot-type params)) (store (device #$(boot-parameters-store-device params)) (mount-point #$(boot-parameters-store-mount-point params)))) @@ -828,6 +838,8 @@ being stored into the \"parameters\" file)." ;; exactly to the device field of the object representing the ;; OS's root file system, so it might be a device path like "/dev/sda3". (root-device boot-parameters-root-device) + (boot-device boot-parameters-boot-device) + (boot-type boot-parameters-boot-type) (store-device boot-parameters-store-device) (store-mount-point boot-parameters-store-mount-point) (kernel boot-parameters-kernel) @@ -846,6 +858,16 @@ being stored into the \"parameters\" file)." (label label) (root-device root) + (boot-device + (match (assq 'boot-device rest) + ((_ args) args) + (#f #f))) ; for compatibility reasons. + + (boot-type + (match (assq 'boot-type rest) + ((_ args) args) + (#f 'grub))) ; for compatibility reasons. + ;; In the past, we would store the directory name of the kernel instead ;; of the absolute file name of its image. Detect that and correct it. (kernel (if (string=? linux (direct-store-path linux)) -- 2.12.2