diff options
Diffstat (limited to 'gnu/bootloader/grub.scm')
| -rw-r--r-- | gnu/bootloader/grub.scm | 73 |
1 files changed, 43 insertions, 30 deletions
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 4f18c9b5183..72832573547 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm | |||
| @@ -374,44 +374,57 @@ when booting a root file system on a Btrfs subvolume." | |||
| 374 | (let ((label (menu-entry-label entry)) | 374 | (let ((label (menu-entry-label entry)) |
| 375 | (linux (menu-entry-linux entry)) | 375 | (linux (menu-entry-linux entry)) |
| 376 | (device (menu-entry-device entry)) | 376 | (device (menu-entry-device entry)) |
| 377 | (device-mount-point (menu-entry-device-mount-point entry))) | 377 | (device-mount-point (menu-entry-device-mount-point entry)) |
| 378 | (if linux | 378 | (multiboot-kernel (menu-entry-multiboot-kernel entry)) |
| 379 | (let ((arguments (menu-entry-linux-arguments entry)) | 379 | (chain-loader (menu-entry-chain-loader entry))) |
| 380 | (linux (normalize-file linux | 380 | (cond |
| 381 | device-mount-point | 381 | (linux |
| 382 | store-directory-prefix)) | 382 | (let ((arguments (menu-entry-linux-arguments entry)) |
| 383 | (initrd (normalize-file (menu-entry-initrd entry) | 383 | (linux (normalize-file linux |
| 384 | device-mount-point | 384 | device-mount-point |
| 385 | store-directory-prefix))) | 385 | store-directory-prefix)) |
| 386 | ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. | 386 | (initrd (normalize-file (menu-entry-initrd entry) |
| 387 | ;; Use the right file names for LINUX and INITRD in case | 387 | device-mount-point |
| 388 | ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a | 388 | store-directory-prefix))) |
| 389 | ;; separate partition. | 389 | ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. |
| 390 | 390 | ;; Use the right file names for LINUX and INITRD in case | |
| 391 | ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and | 391 | ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a |
| 392 | ;; initrd paths, to allow booting from a Btrfs subvolume. | 392 | ;; separate partition. |
| 393 | #~(format port "menuentry ~s { | 393 | |
| 394 | ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and | ||
| 395 | ;; initrd paths, to allow booting from a Btrfs subvolume. | ||
| 396 | #~(format port "menuentry ~s { | ||
| 394 | ~a | 397 | ~a |
| 395 | linux ~a ~a | 398 | linux ~a ~a |
| 396 | initrd ~a | 399 | initrd ~a |
| 397 | }~%" | 400 | }~%" |
| 398 | #$label | 401 | #$label |
| 399 | #$(grub-root-search device linux) | 402 | #$(grub-root-search device linux) |
| 400 | #$linux (string-join (list #$@arguments)) | 403 | #$linux (string-join (list #$@arguments)) |
| 401 | #$initrd)) | 404 | #$initrd))) |
| 402 | (let ((kernel (menu-entry-multiboot-kernel entry)) | 405 | (multiboot-kernel |
| 403 | (arguments (menu-entry-multiboot-arguments entry)) | 406 | (let ((kernel (menu-entry-multiboot-kernel entry)) |
| 404 | (modules (menu-entry-multiboot-modules entry)) | 407 | (arguments (menu-entry-multiboot-arguments entry)) |
| 405 | (root-index 1)) ; XXX EFI will need root-index 2 | 408 | (modules (menu-entry-multiboot-modules entry)) |
| 406 | #~(format port " | 409 | (root-index 1)) ; XXX EFI will need root-index 2 |
| 410 | #~(format port " | ||
| 407 | menuentry ~s { | 411 | menuentry ~s { |
| 408 | multiboot ~a root=device:hd0s~a~a~a | 412 | multiboot ~a root=device:hd0s~a~a~a |
| 409 | }~%" | 413 | }~%" |
| 414 | #$label | ||
| 415 | #$kernel | ||
| 416 | #$root-index (string-join (list #$@arguments) " " 'prefix) | ||
| 417 | (string-join (map string-join '#$modules) | ||
| 418 | "\n module " 'prefix)))) | ||
| 419 | (chain-loader | ||
| 420 | #~(format port " | ||
| 421 | menuentry ~s { | ||
| 422 | ~a | ||
| 423 | chainloader ~a | ||
| 424 | }~%" | ||
| 410 | #$label | 425 | #$label |
| 411 | #$kernel | 426 | #$(grub-root-search device chain-loader) |
| 412 | #$root-index (string-join (list #$@arguments) " " 'prefix) | 427 | #$chain-loader))))) |
| 413 | (string-join (map string-join '#$modules) | ||
| 414 | "\n module " 'prefix)))))) | ||
| 415 | 428 | ||
| 416 | (define (crypto-devices) | 429 | (define (crypto-devices) |
| 417 | (define (crypto-device->cryptomount dev) | 430 | (define (crypto-device->cryptomount dev) |
