From 8b22107e5d0bdeb300fb33b5a40aed2057a66b94 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 29 May 2017 14:24:20 +0200 Subject: bootloader: Use menu-entry to define custom bootloader entries. * gnu/bootloader.scm (): New variable. Export associated getters, This record is extracted from grub module. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Use menu-entry->boot-parameters to convert menu-entry records to boot-parameters. * gnu/bootloader/grub.scm (): Remove. (boot-parameters->menu-entry): Remove. (grub-configuration-file): Use boot-parameters to create configuration entries. * gnu/system.scm (menu-entry->boot-parameters): New exported procedure. --- gnu/system.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 0076f2fcb1..674c6f85be 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -112,6 +112,7 @@ (define-module (gnu system) boot-parameters-initrd read-boot-parameters read-boot-parameters-file + menu-entry->boot-parameters local-host-aliases %setuid-programs @@ -299,6 +300,19 @@ (define (read-boot-parameters-file system) system 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) + (boot-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)))) + ;;; ;;; Services. -- cgit v1.2.3