diff mbox series

[bug#41560,4/8] image: Add bootloader installation support.

Message ID 20200527072420.26140-4-othacehe@gnu.org
State Accepted
Headers show
Series image: Add MBR based boot support. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Mathieu Othacehe May 27, 2020, 7:24 a.m. UTC
* gnu/build/image.scm (initialize-root-partition): Add bootloader-package and
bootloader-installer arguments. Run the bootloader-installer if defined.
* gnu/system/image.scm (system-disk-image): Adapt the partition initializer
call accordingly.
---
 gnu/build/image.scm  | 5 +++++
 gnu/system/image.scm | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index b37ea9332a..49faeab466 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -155,6 +155,8 @@  deduplicates files common to CLOSURE and the rest of PREFIX."
                                     #:key
                                     bootcfg
                                     bootcfg-location
+                                    bootloader-package
+                                    bootloader-installer
                                     (deduplicate? #t)
                                     references-graphs
                                     (register-closures? #t)
@@ -178,6 +180,9 @@  of the directory of the 'system' derivation."
                                   #:deduplicate? deduplicate?))
               references-graphs))
 
+  (when bootloader-installer
+    (display "installing bootloader...\n")
+    (bootloader-installer bootloader-package #f root))
   (when bootcfg
     (install-boot-config bootcfg bootcfg-location root)))
 
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index ffc746fcf5..6608991fdc 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -236,7 +236,9 @@  used in the image."
                               #:deduplicate? #f
                               #:system-directory #$os
                               #:bootloader-package
-                              #$(bootloader-package bootloader)
+                              #+(bootloader-package bootloader)
+                              #:bootloader-installer
+                              #+(bootloader-installer bootloader)
                               #:bootcfg #$bootcfg
                               #:bootcfg-location
                               #$(bootloader-configuration-file bootloader)))))