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/bootloader/extlinux.scm | 19 +++++++++---------- gnu/bootloader/grub.scm | 27 ++++++++++++--------------- 2 files changed, 21 insertions(+), 25 deletions(-) (limited to 'gnu/bootloader') diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 219b058e53..e5fdeb5801 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm @@ -38,14 +38,13 @@ (define* (extlinux-configuration-file config entries corresponding to old generations of the system." (define all-entries - (append entries (map menu-entry->boot-parameters - (bootloader-configuration-menu-entries config)))) - - (define (boot-parameters->gexp params) - (let ((label (boot-parameters-label params)) - (kernel (boot-parameters-kernel params)) - (kernel-arguments (boot-parameters-kernel-arguments params)) - (initrd (boot-parameters-initrd params))) + (append entries (bootloader-configuration-menu-entries config))) + + (define (menu-entry->gexp entry) + (let ((label (menu-entry-label entry)) + (kernel (menu-entry-linux entry)) + (kernel-arguments (menu-entry-linux-arguments entry)) + (initrd (menu-entry-initrd entry))) #~(format port "LABEL ~a MENU LABEL ~a KERNEL ~a @@ -69,11 +68,11 @@ (define builder (if (> timeout 0) 1 0) ;; timeout is expressed in 1/10s of seconds. (* 10 timeout)) - #$@(map boot-parameters->gexp all-entries) + #$@(map menu-entry->gexp all-entries) #$@(if (pair? old-entries) #~((format port "~%") - #$@(map boot-parameters->gexp old-entries) + #$@(map menu-entry->gexp old-entries) (format port "~%")) #~()))))) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 880491c983..3a3456ca46 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -316,16 +316,14 @@ (define* (grub-configuration-file config entries STORE-FS, a object. OLD-ENTRIES is taken to be a list of menu entries corresponding to old generations of the system." (define all-entries - (append entries (map menu-entry->boot-parameters - (bootloader-configuration-menu-entries config)))) - - (define (boot-parameters->gexp params) - (let ((device (boot-parameters-store-device params)) - (device-mount-point (boot-parameters-store-mount-point params)) - (label (boot-parameters-label params)) - (kernel (boot-parameters-kernel params)) - (arguments (boot-parameters-kernel-arguments params)) - (initrd (boot-parameters-initrd params))) + (append entries (bootloader-configuration-menu-entries config))) + (define (menu-entry->gexp entry) + (let ((device (menu-entry-device entry)) + (device-mount-point (menu-entry-device-mount-point entry)) + (label (menu-entry-label entry)) + (kernel (menu-entry-linux entry)) + (arguments (menu-entry-linux-arguments entry)) + (initrd (menu-entry-initrd entry))) ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. ;; Use the right file names for KERNEL and INITRD in case ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a @@ -341,11 +339,10 @@ (define (boot-parameters->gexp params) #$(grub-root-search device kernel) #$kernel (string-join (list #$@arguments)) #$initrd)))) - (mlet %store-monad ((sugar (eye-candy config - (boot-parameters-store-device + (menu-entry-device (first all-entries)) - (boot-parameters-store-mount-point + (menu-entry-device-mount-point (first all-entries)) #:system system #:port #~port))) @@ -362,12 +359,12 @@ (define builder set timeout=~a~%" #$(bootloader-configuration-default-entry config) #$(bootloader-configuration-timeout config)) - #$@(map boot-parameters->gexp all-entries) + #$@(map menu-entry->gexp all-entries) #$@(if (pair? old-entries) #~((format port " submenu \"GNU system, old configurations...\" {~%") - #$@(map boot-parameters->gexp old-entries) + #$@(map menu-entry->gexp old-entries) (format port "}~%")) #~())))) -- cgit v1.2.3