diff options
| author | Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 2020-05-26 16:54:18 +0200 |
|---|---|---|
| committer | Jan Nieuwenhuizen <janneke@gnu.org> | 2020-06-08 13:51:18 +0200 |
| commit | 21acd8d6c11b85d06c82b168807b35cb7d2d0adf (patch) | |
| tree | 8819395e3d31a944d5c2763bfa3fad287def5a43 /gnu/bootloader.scm | |
| parent | 2018fb2afe20988193a50fe30159725f51db0a4b (diff) | |
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.scm | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 668caa7fc3f..2eebb8e9d9c 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | ;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com> | 3 | ;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com> |
| 4 | ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> | 4 | ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> |
| 5 | ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> | 5 | ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> |
| 6 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | ||
| 6 | ;;; | 7 | ;;; |
| 7 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| 8 | ;;; | 9 | ;;; |
| @@ -33,6 +34,9 @@ | |||
| 33 | menu-entry-linux-arguments | 34 | menu-entry-linux-arguments |
| 34 | menu-entry-initrd | 35 | menu-entry-initrd |
| 35 | menu-entry-device-mount-point | 36 | menu-entry-device-mount-point |
| 37 | menu-entry-multiboot-kernel | ||
| 38 | menu-entry-multiboot-arguments | ||
| 39 | menu-entry-multiboot-modules | ||
| 36 | 40 | ||
| 37 | menu-entry->sexp | 41 | menu-entry->sexp |
| 38 | sexp->menu-entry | 42 | sexp->menu-entry |
| @@ -77,22 +81,41 @@ | |||
| 77 | (default #f)) | 81 | (default #f)) |
| 78 | (device-mount-point menu-entry-device-mount-point | 82 | (device-mount-point menu-entry-device-mount-point |
| 79 | (default #f)) | 83 | (default #f)) |
| 80 | (linux menu-entry-linux) | 84 | (linux menu-entry-linux |
| 85 | (default #f)) | ||
| 81 | (linux-arguments menu-entry-linux-arguments | 86 | (linux-arguments menu-entry-linux-arguments |
| 82 | (default '())) ; list of string-valued gexps | 87 | (default '())) ; list of string-valued gexps |
| 83 | (initrd menu-entry-initrd)) ; file name of the initrd as a gexp | 88 | (initrd menu-entry-initrd ; file name of the initrd as a gexp |
| 89 | (default #f)) | ||
| 90 | (multiboot-kernel menu-entry-multiboot-kernel | ||
| 91 | (default #f)) | ||
| 92 | (multiboot-arguments menu-entry-multiboot-arguments | ||
| 93 | (default '())) ; list of string-valued gexps | ||
| 94 | (multiboot-modules menu-entry-multiboot-modules | ||
| 95 | (default '()))) ; list of multiboot commands, where | ||
| 96 | ; a command is a list of <string> | ||
| 84 | 97 | ||
| 85 | (define (menu-entry->sexp entry) | 98 | (define (menu-entry->sexp entry) |
| 86 | "Return ENTRY serialized as an sexp." | 99 | "Return ENTRY serialized as an sexp." |
| 87 | (match entry | 100 | (match entry |
| 88 | (($ <menu-entry> label device mount-point linux linux-arguments initrd) | 101 | (($ <menu-entry> label device mount-point linux linux-arguments initrd #f |
| 102 | ()) | ||
| 89 | `(menu-entry (version 0) | 103 | `(menu-entry (version 0) |
| 90 | (label ,label) | 104 | (label ,label) |
| 91 | (device ,device) | 105 | (device ,device) |
| 92 | (device-mount-point ,mount-point) | 106 | (device-mount-point ,mount-point) |
| 93 | (linux ,linux) | 107 | (linux ,linux) |
| 94 | (linux-arguments ,linux-arguments) | 108 | (linux-arguments ,linux-arguments) |
| 95 | (initrd ,initrd))))) | 109 | (initrd ,initrd))) |
| 110 | (($ <menu-entry> label device mount-point #f () #f | ||
| 111 | multiboot-kernel multiboot-arguments multiboot-modules) | ||
| 112 | `(menu-entry (version 0) | ||
| 113 | (label ,label) | ||
| 114 | (device ,device) | ||
| 115 | (device-mount-point ,mount-point) | ||
| 116 | (multiboot-kernel ,multiboot-kernel) | ||
| 117 | (multiboot-arguments ,multiboot-arguments) | ||
| 118 | (multiboot-modules ,multiboot-modules))))) | ||
| 96 | 119 | ||
| 97 | (define (sexp->menu-entry sexp) | 120 | (define (sexp->menu-entry sexp) |
| 98 | "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry> | 121 | "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry> |
| @@ -109,7 +132,20 @@ record." | |||
| 109 | (device-mount-point mount-point) | 132 | (device-mount-point mount-point) |
| 110 | (linux linux) | 133 | (linux linux) |
| 111 | (linux-arguments linux-arguments) | 134 | (linux-arguments linux-arguments) |
| 112 | (initrd initrd))))) | 135 | (initrd initrd))) |
| 136 | (('menu-entry ('version 0) | ||
| 137 | ('label label) ('device device) | ||
| 138 | ('device-mount-point mount-point) | ||
| 139 | ('multiboot-kernel multiboot-kernel) | ||
| 140 | ('multiboot-arguments multiboot-arguments) | ||
| 141 | ('multiboot-modules multiboot-modules) _ ...) | ||
| 142 | (menu-entry | ||
| 143 | (label label) | ||
| 144 | (device device) | ||
| 145 | (device-mount-point mount-point) | ||
| 146 | (multiboot-kernel multiboot-kernel) | ||
| 147 | (multiboot-arguments multiboot-arguments) | ||
| 148 | (multiboot-modules multiboot-modules))))) | ||
| 113 | 149 | ||
| 114 | 150 | ||
| 115 | ;;; | 151 | ;;; |
