From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9oH5-0000Wv-B2 for guix-patches@gnu.org; Sun, 14 May 2017 03:49:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9oH1-0007kD-Ty for guix-patches@gnu.org; Sun, 14 May 2017 03:49:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:40848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9oH1-0007k4-QJ for guix-patches@gnu.org; Sun, 14 May 2017 03:49:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d9oH1-0003v6-Jq for guix-patches@gnu.org; Sun, 14 May 2017 03:49:03 -0400 Subject: bug#26339: [PATCH v4 3/7] bootloader: Add bootloader name to boot-parameters record. Resent-Message-ID: From: Mathieu Othacehe Date: Sun, 14 May 2017 09:47:59 +0200 Message-Id: <20170514074803.25556-4-m.othacehe@gmail.com> In-Reply-To: <20170514074803.25556-1-m.othacehe@gmail.com> References: <20170514074803.25556-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 ()[name]: New field. (boot-parameters-boot-name): Ditto. (operating-system-boot-parameters-file): Add new field. (operating-system-boot-parameters): Ditto. (read-boot-parameters): Ditto. --- gnu/system.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gnu/system.scm b/gnu/system.scm index 8040e2b15..4631cc56f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -104,6 +104,7 @@ boot-parameters? boot-parameters-label boot-parameters-root-device + boot-parameters-boot-name boot-parameters-store-device boot-parameters-store-mount-point boot-parameters-kernel @@ -213,6 +214,7 @@ directly by the user." ;; 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-name boot-parameters-boot-name) (store-device boot-parameters-store-device) (store-mount-point boot-parameters-store-mount-point) (kernel boot-parameters-kernel) @@ -231,6 +233,11 @@ directly by the user." (label label) (root-device root) + (boot-name + (match (assq 'boot-name 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)) @@ -868,6 +875,9 @@ kernel arguments for that derivation to ." (mlet* %store-monad ((initrd (operating-system-initrd-file os)) (store -> (operating-system-store-file-system os)) + (bootloader -> (bootloader-configuration-bootloader + (operating-system-bootloader os))) + (boot-name -> (bootloader-name bootloader)) (label -> (kernel->boot-label (operating-system-kernel os)))) (return (boot-parameters (label label) @@ -878,6 +888,7 @@ kernel arguments for that derivation to ." (operating-system-kernel-arguments os system.drv root-device) (operating-system-user-kernel-arguments os))) (initrd initrd) + (boot-name boot-name) (store-device (fs->boot-device store)) (store-mount-point (file-system-mount-point store)))))) @@ -903,6 +914,7 @@ being stored into the \"parameters\" file)." (kernel-arguments #$(boot-parameters-kernel-arguments params)) (initrd #$(boot-parameters-initrd params)) + (boot-name #$(boot-parameters-boot-name params)) (store (device #$(boot-parameters-store-device params)) (mount-point #$(boot-parameters-store-mount-point params)))) -- 2.13.0