bootloader: grub: Add support for multiboot.
* gnu/bootloader/grub.scm (grub-configuration-file): Add support for multiboot.master
parent
912b857ede
commit
1244491a0d
|
@ -330,36 +330,58 @@ when booting a root file system on a Btrfs subvolume."
|
||||||
(define all-entries
|
(define all-entries
|
||||||
(append entries (bootloader-configuration-menu-entries config)))
|
(append entries (bootloader-configuration-menu-entries config)))
|
||||||
(define (menu-entry->gexp entry)
|
(define (menu-entry->gexp entry)
|
||||||
(let* ((device (menu-entry-device entry))
|
(let ((label (menu-entry-label entry))
|
||||||
(device-mount-point (menu-entry-device-mount-point entry))
|
(linux (menu-entry-linux entry))
|
||||||
(label (menu-entry-label entry))
|
(device (menu-entry-device entry))
|
||||||
(arguments (menu-entry-linux-arguments entry))
|
(device-mount-point (menu-entry-device-mount-point entry)))
|
||||||
(kernel (normalize-file (menu-entry-linux entry)
|
(if linux
|
||||||
device-mount-point
|
(let ((arguments (menu-entry-linux-arguments entry))
|
||||||
store-directory-prefix))
|
(linux (normalize-file linux
|
||||||
(initrd (normalize-file (menu-entry-initrd entry)
|
device-mount-point
|
||||||
device-mount-point
|
store-directory-prefix))
|
||||||
store-directory-prefix)))
|
(initrd (normalize-file (menu-entry-initrd entry)
|
||||||
;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point.
|
device-mount-point
|
||||||
;; Use the right file names for KERNEL and INITRD in case
|
store-directory-prefix)))
|
||||||
;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a
|
;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point.
|
||||||
;; separate partition.
|
;; Use the right file names for LINUX and INITRD in case
|
||||||
#~(format port "menuentry ~s {
|
;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a
|
||||||
|
;; separate partition.
|
||||||
|
|
||||||
|
;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and
|
||||||
|
;; initrd paths, to allow booting from a Btrfs subvolume.
|
||||||
|
#~(format port "menuentry ~s {
|
||||||
~a
|
~a
|
||||||
linux ~a ~a
|
linux ~a ~a
|
||||||
initrd ~a
|
initrd ~a
|
||||||
}~%"
|
}~%"
|
||||||
#$label
|
#$label
|
||||||
#$(grub-root-search device kernel)
|
#$(grub-root-search device linux)
|
||||||
#$kernel (string-join (list #$@arguments))
|
#$linux (string-join (list #$@arguments))
|
||||||
#$initrd)))
|
#$initrd))
|
||||||
(define sugar
|
(let ((kernel (menu-entry-multiboot-kernel entry))
|
||||||
(eye-candy config
|
(arguments (menu-entry-multiboot-arguments entry))
|
||||||
(menu-entry-device (first all-entries))
|
(modules (menu-entry-multiboot-modules entry))
|
||||||
(menu-entry-device-mount-point (first all-entries))
|
(root-index 1)) ; XXX EFI will need root-index 2
|
||||||
#:store-directory-prefix store-directory-prefix
|
#~(format port "
|
||||||
#:system system
|
menuentry ~s {
|
||||||
#:port #~port))
|
multiboot ~a root=device:hd0s~a~a~a
|
||||||
|
}~%"
|
||||||
|
#$label
|
||||||
|
#$kernel
|
||||||
|
#$root-index (string-join (list #$@arguments) " " 'prefix)
|
||||||
|
(string-join (map string-join '#$modules)
|
||||||
|
"\n module " 'prefix))))))
|
||||||
|
|
||||||
|
(define (sugar)
|
||||||
|
(let* ((entry (first all-entries))
|
||||||
|
(device (menu-entry-device entry))
|
||||||
|
(mount-point (menu-entry-device-mount-point entry)))
|
||||||
|
(eye-candy config
|
||||||
|
device
|
||||||
|
mount-point
|
||||||
|
#:store-directory-prefix store-directory-prefix
|
||||||
|
#:system system
|
||||||
|
#:port #~port)))
|
||||||
|
|
||||||
(define keyboard-layout-config
|
(define keyboard-layout-config
|
||||||
(let* ((layout (bootloader-configuration-keyboard-layout config))
|
(let* ((layout (bootloader-configuration-keyboard-layout config))
|
||||||
|
@ -384,7 +406,7 @@ keymap ~a~%" #$keymap))))
|
||||||
"# This file was generated from your Guix configuration. Any changes
|
"# This file was generated from your Guix configuration. Any changes
|
||||||
# will be lost upon reconfiguration.
|
# will be lost upon reconfiguration.
|
||||||
")
|
")
|
||||||
#$sugar
|
#$(sugar)
|
||||||
#$keyboard-layout-config
|
#$keyboard-layout-config
|
||||||
(format port "
|
(format port "
|
||||||
set default=~a
|
set default=~a
|
||||||
|
|
Reference in New Issue