From 1975c754f487eb4933724ca3b116442d21ef8dd9 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 29 Jun 2017 12:42:59 +0200 Subject: bootloader: Use for the bootloader side. * gnu/bootloader.scm (menu-entry-device-mount-point): New variable. Export it. (: New field "device". * gnu/bootloader/grub.scm (grub-confgiuration-file): Handle entries. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Handle entries. * gnu/system.scm (menu->entry->boot-parameters): Delete variable. (boot-parameters->menu-entry): New variable. Export it. (operating-system-bootcfg): Make OLD-ENTRIES a list of . * guix/script/system.scm (reinstall-bootloader): Fix bootcfg usage. (perform-action): Fix bootcfg usage. --- gnu/system.scm | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 746c511187..fdb5be287e 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -112,7 +112,7 @@ boot-parameters-initrd read-boot-parameters read-boot-parameters-file - menu-entry->boot-parameters + boot-parameters->menu-entry local-host-aliases %setuid-programs @@ -301,17 +301,15 @@ The object has its kernel-arguments extended in order to make it bootable." root-device))) #f))) -(define (menu-entry->boot-parameters menu-entry) - "Convert a instance to a corresponding ." - (boot-parameters - (label (menu-entry-label menu-entry)) - (root-device #f) - (bootloader-name 'custom) - (store-device #f) - (store-mount-point #f) - (kernel (menu-entry-linux menu-entry)) - (kernel-arguments (menu-entry-linux-arguments menu-entry)) - (initrd (menu-entry-initrd menu-entry)))) +(define (boot-parameters->menu-entry conf) + (menu-entry + (label (boot-parameters-label conf)) + (device (boot-parameters-store-device conf)) + (device-mount-point (boot-parameters-store-mount-point conf)) + (linux (boot-parameters-kernel conf)) + (linux-arguments (boot-parameters-kernel-arguments conf)) + (initrd (boot-parameters-initrd conf)))) + ;;; @@ -866,15 +864,16 @@ listed in OS. The C library expects to find it under (store-file-system (operating-system-file-systems os))) (define* (operating-system-bootcfg os #:optional (old-entries '())) - "Return the bootloader configuration file for OS. Use OLD-ENTRIES to -populate the \"old entries\" menu." + "Return the bootloader configuration file for OS. Use OLD-ENTRIES +(which is a list of ) to populate the \"old entries\" menu." (mlet* %store-monad ((system (operating-system-derivation os)) (root-fs -> (operating-system-root-file-system os)) (root-device -> (if (eq? 'uuid (file-system-title root-fs)) (uuid->string (file-system-device root-fs)) (file-system-device root-fs))) - (entry (operating-system-boot-parameters os system root-device)) + (params (operating-system-boot-parameters os system root-device)) + (entry -> (boot-parameters->menu-entry params)) (bootloader-conf -> (operating-system-bootloader os))) ((bootloader-configuration-file-generator (bootloader-configuration-bootloader bootloader-conf)) -- cgit v1.2.3