gnu: bootloader: Extend `<menu-entry>' for chain-loader.
* gnu/bootloader.scm (<menu-entry>)[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller <julien@lepiller.eu> Signed-off-by: Julien Lepiller <julien@lepiller.eu>master
parent
e8bded2de7
commit
52d780ea2b
|
@ -37553,6 +37553,24 @@ The list of commands for loading Multiboot modules. For example:
|
||||||
@dots{}))
|
@dots{}))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
@item @code{chain-loader} (default: @code{#f})
|
||||||
|
A string that can be accepted by @code{grub}'s @code{chainloader}
|
||||||
|
directive. This has no effect if either @code{linux} or
|
||||||
|
@code{multiboot-kernel} fields are specified. The following is an
|
||||||
|
example of chainloading a different GNU/Linux system.
|
||||||
|
|
||||||
|
@lisp
|
||||||
|
(bootloader
|
||||||
|
(bootloader-configuration
|
||||||
|
;; @dots{}
|
||||||
|
(menu-entries
|
||||||
|
(list
|
||||||
|
(menu-entry
|
||||||
|
(label "GNU/Linux")
|
||||||
|
(device (uuid "1C31-A17C" 'fat))
|
||||||
|
(chain-loader "/EFI/GNULinux/grubx64.efi"))))))
|
||||||
|
@end lisp
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
menu-entry-multiboot-kernel
|
menu-entry-multiboot-kernel
|
||||||
menu-entry-multiboot-arguments
|
menu-entry-multiboot-arguments
|
||||||
menu-entry-multiboot-modules
|
menu-entry-multiboot-modules
|
||||||
|
menu-entry-chain-loader
|
||||||
|
|
||||||
menu-entry->sexp
|
menu-entry->sexp
|
||||||
sexp->menu-entry
|
sexp->menu-entry
|
||||||
|
@ -104,8 +105,10 @@
|
||||||
(multiboot-arguments menu-entry-multiboot-arguments
|
(multiboot-arguments menu-entry-multiboot-arguments
|
||||||
(default '())) ; list of string-valued gexps
|
(default '())) ; list of string-valued gexps
|
||||||
(multiboot-modules menu-entry-multiboot-modules
|
(multiboot-modules menu-entry-multiboot-modules
|
||||||
(default '()))) ; list of multiboot commands, where
|
(default '())) ; list of multiboot commands, where
|
||||||
; a command is a list of <string>
|
; a command is a list of <string>
|
||||||
|
(chain-loader menu-entry-chain-loader
|
||||||
|
(default #f))) ; string, path of efi file
|
||||||
|
|
||||||
(define (menu-entry->sexp entry)
|
(define (menu-entry->sexp entry)
|
||||||
"Return ENTRY serialized as an sexp."
|
"Return ENTRY serialized as an sexp."
|
||||||
|
@ -117,8 +120,9 @@
|
||||||
`(label ,(file-system-label->string label)))
|
`(label ,(file-system-label->string label)))
|
||||||
(_ device)))
|
(_ device)))
|
||||||
(match entry
|
(match entry
|
||||||
(($ <menu-entry> label device mount-point linux linux-arguments initrd #f
|
(($ <menu-entry> label device mount-point
|
||||||
())
|
(? identity linux) linux-arguments (? identity initrd)
|
||||||
|
#f () () #f)
|
||||||
`(menu-entry (version 0)
|
`(menu-entry (version 0)
|
||||||
(label ,label)
|
(label ,label)
|
||||||
(device ,(device->sexp device))
|
(device ,(device->sexp device))
|
||||||
|
@ -127,14 +131,22 @@
|
||||||
(linux-arguments ,linux-arguments)
|
(linux-arguments ,linux-arguments)
|
||||||
(initrd ,initrd)))
|
(initrd ,initrd)))
|
||||||
(($ <menu-entry> label device mount-point #f () #f
|
(($ <menu-entry> label device mount-point #f () #f
|
||||||
multiboot-kernel multiboot-arguments multiboot-modules)
|
(? identity multiboot-kernel) multiboot-arguments
|
||||||
|
multiboot-modules #f)
|
||||||
`(menu-entry (version 0)
|
`(menu-entry (version 0)
|
||||||
(label ,label)
|
(label ,label)
|
||||||
(device ,(device->sexp device))
|
(device ,(device->sexp device))
|
||||||
(device-mount-point ,mount-point)
|
(device-mount-point ,mount-point)
|
||||||
(multiboot-kernel ,multiboot-kernel)
|
(multiboot-kernel ,multiboot-kernel)
|
||||||
(multiboot-arguments ,multiboot-arguments)
|
(multiboot-arguments ,multiboot-arguments)
|
||||||
(multiboot-modules ,multiboot-modules)))))
|
(multiboot-modules ,multiboot-modules)))
|
||||||
|
(($ <menu-entry> label device mount-point #f () #f #f () ()
|
||||||
|
(? identity chain-loader))
|
||||||
|
`(menu-entry (version 0)
|
||||||
|
(label ,label)
|
||||||
|
(device ,(device->sexp device))
|
||||||
|
(device-mount-point ,mount-point)
|
||||||
|
(chain-loader ,chain-loader)))))
|
||||||
|
|
||||||
(define (sexp->menu-entry sexp)
|
(define (sexp->menu-entry sexp)
|
||||||
"Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry>
|
"Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry>
|
||||||
|
@ -171,7 +183,16 @@ record."
|
||||||
(device-mount-point mount-point)
|
(device-mount-point mount-point)
|
||||||
(multiboot-kernel multiboot-kernel)
|
(multiboot-kernel multiboot-kernel)
|
||||||
(multiboot-arguments multiboot-arguments)
|
(multiboot-arguments multiboot-arguments)
|
||||||
(multiboot-modules multiboot-modules)))))
|
(multiboot-modules multiboot-modules)))
|
||||||
|
(('menu-entry ('version 0)
|
||||||
|
('label label) ('device device)
|
||||||
|
('device-mount-point mount-point)
|
||||||
|
('chain-loader chain-loader) _ ...)
|
||||||
|
(menu-entry
|
||||||
|
(label label)
|
||||||
|
(device (sexp->device device))
|
||||||
|
(device-mount-point mount-point)
|
||||||
|
(chain-loader chain-loader)))))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
Reference in New Issue