guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/10: image: Use grub-efi to install the EFI bootloader.


From: guix-commits
Subject: 06/10: image: Use grub-efi to install the EFI bootloader.
Date: Sat, 23 May 2020 13:37:22 -0400 (EDT)

mothacehe pushed a commit to branch wip-hurd-vm
in repository guix.

commit 35ed1ec2b156b443d04701e2e7c787293ea97390
Author: Mathieu Othacehe <address@hidden>
AuthorDate: Sat May 23 19:10:04 2020 +0200

    image: Use grub-efi to install the EFI bootloader.
    
    * guix/utils.scm (target-intel?): New exported procedure.
    * gnu/build/image.scm (initialize-efi-partition): Rename bootloader-package
    argument to grub-efi.
    * gnu/system/image.scm (system-disk-image): Adapt accordingly to pass
    grub-efi package. Make sure that grub-efi is not built if we are not 
targeting
    an Intel system.
---
 gnu/build/image.scm  | 4 ++--
 gnu/system/image.scm | 4 ++++
 guix/utils.scm       | 5 +++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 2c0933b..087e2c7 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -142,10 +142,10 @@ deduplicates files common to CLOSURE and the rest of 
PREFIX."
 
 (define* (initialize-efi-partition root
                                    #:key
-                                   bootloader-package
+                                   grub-efi
                                    #:allow-other-keys)
   "Install in ROOT directory, an EFI loader using BOOTLOADER-PACKAGE."
-  (install-efi-loader bootloader-package root))
+  (install-efi-loader grub-efi root))
 
 (define* (initialize-root-partition root
                                     #:key
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index c6bfedd..587b4a2 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -234,6 +234,10 @@ used in the image."
                               #:references-graphs '#$graph
                               #:deduplicate? #f
                               #:system-directory #$os
+                              #:grub-efi #$(let-system (system target)
+                                             (and (target-intel?
+                                                   (or target system))
+                                                  grub-efi))
                               #:bootloader-package
                               #+(bootloader-package bootloader)
                               #:bootloader-installer
diff --git a/guix/utils.scm b/guix/utils.scm
index 812617d..941e295 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -76,6 +76,7 @@
             %current-target-system
             package-name->name+version
             target-mingw?
+            target-intel?
             target-arm32?
             target-aarch64?
             target-arm?
@@ -493,6 +494,10 @@ a character other than '@'."
   (and target
        (string-suffix? "-mingw32" target)))
 
+(define* (target-intel? #:optional (target (or (%current-target-system)
+                                               (%current-system))))
+  (any (cut string-prefix? <> target) '("x86_64" "i686")))
+
 (define* (target-arm32? #:optional (target (or (%current-target-system)
                                                (%current-system))))
   (string-prefix? "arm" target))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]