image: Add bootloader installation support.
authorMathieu Othacehe <othacehe@gnu.org>
Sat, 23 May 2020 17:09:53 +0000 (19:09 +0200)
committerMathieu Othacehe <othacehe@gnu.org>
Fri, 29 May 2020 06:40:03 +0000 (08:40 +0200)
* 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
gnu/system/image.scm

index b37ea93..49faeab 100644 (file)
@@ -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)))
 
index 92b3f44..ece2d02 100644 (file)
@@ -235,7 +235,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)))))