aboutsummaryrefslogtreecommitdiff
path: root/gnu/bootloader.scm
diff options
context:
space:
mode:
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>2020-05-26 16:54:18 +0200
committerJan Nieuwenhuizen <janneke@gnu.org>2020-06-08 13:51:18 +0200
commit21acd8d6c11b85d06c82b168807b35cb7d2d0adf (patch)
tree8819395e3d31a944d5c2763bfa3fad287def5a43 /gnu/bootloader.scm
parent2018fb2afe20988193a50fe30159725f51db0a4b (diff)
downloadguix-21acd8d6c11b85d06c82b168807b35cb7d2d0adf.tar
guix-21acd8d6c11b85d06c82b168807b35cb7d2d0adf.tar.gz
bootloader: Extend `<menu-entry>' for multiboot.
* gnu/bootloader.scm (<menu-entry>)[multiboot-kernel,multiboot-arguments, multiboot-modules]: New fields. [linux,initrd]: Add default value '#f'. (menu-entry->sexp, sexp->menu-entry): Support multiboot entry. * doc/guix.texi (Bootloader Configuration): Document them.
Diffstat (limited to 'gnu/bootloader.scm')
-rw-r--r--gnu/bootloader.scm46
1 files changed, 41 insertions, 5 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 668caa7fc3..2eebb8e9d9 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -33,6 +34,9 @@
menu-entry-linux-arguments
menu-entry-initrd
menu-entry-device-mount-point
+ menu-entry-multiboot-kernel
+ menu-entry-multiboot-arguments
+ menu-entry-multiboot-modules
menu-entry->sexp
sexp->menu-entry
@@ -77,22 +81,41 @@
(default #f))
(device-mount-point menu-entry-device-mount-point
(default #f))
- (linux menu-entry-linux)
+ (linux menu-entry-linux
+ (default #f))
(linux-arguments menu-entry-linux-arguments
(default '())) ; list of string-valued gexps
- (initrd menu-entry-initrd)) ; file name of the initrd as a gexp
+ (initrd menu-entry-initrd ; file name of the initrd as a gexp
+ (default #f))
+ (multiboot-kernel menu-entry-multiboot-kernel
+ (default #f))
+ (multiboot-arguments menu-entry-multiboot-arguments
+ (default '())) ; list of string-valued gexps
+ (multiboot-modules menu-entry-multiboot-modules
+ (default '()))) ; list of multiboot commands, where
+ ; a command is a list of <string>
(define (menu-entry->sexp entry)
"Return ENTRY serialized as an sexp."
(match entry
- (($ <menu-entry> label device mount-point linux linux-arguments initrd)
+ (($ <menu-entry> label device mount-point linux linux-arguments initrd #f
+ ())
`(menu-entry (version 0)
(label ,label)
(device ,device)
(device-mount-point ,mount-point)
(linux ,linux)
(linux-arguments ,linux-arguments)
- (initrd ,initrd)))))
+ (initrd ,initrd)))
+ (($ <menu-entry> label device mount-point #f () #f
+ multiboot-kernel multiboot-arguments multiboot-modules)
+ `(menu-entry (version 0)
+ (label ,label)
+ (device ,device)
+ (device-mount-point ,mount-point)
+ (multiboot-kernel ,multiboot-kernel)
+ (multiboot-arguments ,multiboot-arguments)
+ (multiboot-modules ,multiboot-modules)))))
(define (sexp->menu-entry sexp)
"Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry>
@@ -109,7 +132,20 @@ record."
(device-mount-point mount-point)
(linux linux)
(linux-arguments linux-arguments)
- (initrd initrd)))))
+ (initrd initrd)))
+ (('menu-entry ('version 0)
+ ('label label) ('device device)
+ ('device-mount-point mount-point)
+ ('multiboot-kernel multiboot-kernel)
+ ('multiboot-arguments multiboot-arguments)
+ ('multiboot-modules multiboot-modules) _ ...)
+ (menu-entry
+ (label label)
+ (device device)
+ (device-mount-point mount-point)
+ (multiboot-kernel multiboot-kernel)
+ (multiboot-arguments multiboot-arguments)
+ (multiboot-modules multiboot-modules)))))
;;;