summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorRutherther <rutherther@ditigal.xyz>2025-11-29 13:36:37 +0100
committerEfraim Flashner <efraim@flashner.co.il>2025-12-02 12:05:45 +0200
commitca0ed91b4047a3a86d0e40974771e8321858f00e (patch)
treef33455f22581e4e3772f29eb074d92a1309416c9 /gnu/system
parent011a3b932d6a4c08b3e32be62fd72540f9f68f34 (diff)
image: Supply grub-efi from esp partition initializer.
Instead of passing down grub-efi in system-disk-image, pass it down only where it's necessary - in esp partitions. Since the esp partitions are only for grub, I renamed them so that it's more clear to future users of them. They do not check the bootloader of os at all, they always initialize grub. Followup of 1dfe1ebdf6399256b5ed9f2d6e77722aceaae07d, fixing regression for mbr-hybrid images. Fixes: #4538. * guix/system/image.scm (esp-partition/grub): Rename from esp-partition; Pass grub-efi to initialize-efi-partition. (esp32-partition/grub): Rename from esp32-partition; Pass grub32-efi to initialize-efi-partition. (esp-partition, (esp32-partition): Deprecate. (system-disk-image): Do not supply grub-efi arguments. Change-Id: I336c3144e8efc3ce872031e631d64d3708546ff8 Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/image.scm52
1 files changed, 27 insertions, 25 deletions
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 66b9f3abec8..e7282f584f7 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -23,6 +23,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu system image)
+ #:use-module (guix deprecation)
#:use-module (guix diagnostics)
#:use-module (guix discovery)
#:use-module (guix gexp)
@@ -74,9 +75,12 @@
image-without-os
operating-system-for-image
+ esp-partition/grub
+ esp32-partition/grub
+ root-partition
+
esp-partition
esp32-partition
- root-partition
mbr-disk-image
mbr-hybrid-disk-image
@@ -125,21 +129,28 @@
parent image record."
(image (operating-system #false) . fields))
-(define esp-partition
+(define esp-partition/grub
(partition
- (size (* 40 (expt 2 20)))
- (offset root-offset)
- (label "GNU-ESP") ;cosmetic only
- ;; Use "vfat" here since this property is used when mounting. The actual
- ;; FAT-ness is based on file system size (16 in this case).
- (file-system "vfat")
- (flags '(esp))
- (initializer (gexp initialize-efi-partition))))
+ (size (* 40 (expt 2 20)))
+ (offset root-offset)
+ (label "GNU-ESP") ;cosmetic only
+ ;; Use "vfat" here since this property is used when mounting. The actual
+ ;; FAT-ness is based on file system size (16 in this case).
+ (file-system "vfat")
+ (flags '(esp))
+ (initializer #~(lambda* (root #:key #:allow-other-keys)
+ (initialize-efi-partition root #:grub-efi #+grub-efi)))))
-(define esp32-partition
+(define esp32-partition/grub
(partition
- (inherit esp-partition)
- (initializer (gexp initialize-efi32-partition))))
+ (inherit esp-partition/grub)
+ (initializer #~(lambda* (root #:key #:allow-other-keys)
+ (initialize-efi32-partition #:grub-efi32 #+grub-efi32)))))
+
+;; Be more transparent. The esp partition unconditinally installs grub.
+;; It doesn't look up bootloader of the system.
+(define-deprecated/public-alias esp-partition esp-partition/grub)
+(define-deprecated/public-alias esp32-partition esp32-partition/grub)
(define root-partition
(partition
@@ -166,19 +177,19 @@ parent image record."
(format 'disk-image)
(partition-table-type 'mbr)
(partitions
- (list esp-partition root-partition))))
+ (list esp-partition/grub root-partition))))
(define efi-disk-image
(image-without-os
(format 'disk-image)
(partition-table-type 'gpt)
- (partitions (list esp-partition root-partition))))
+ (partitions (list esp-partition/grub root-partition))))
(define efi32-disk-image
(image-without-os
(format 'disk-image)
(partition-table-type 'gpt)
- (partitions (list esp32-partition root-partition))))
+ (partitions (list esp32-partition/grub root-partition))))
(define iso9660-image
(image-without-os
@@ -501,15 +512,6 @@ used in the image."
#:copy-closures? (not
#$(image-shared-store? image))
#:system-directory #$os
- ;; These two shouldn't be needed unconditionally.
- #:grub-efi
- #+(if (bootloader-uses-grub-efi? bootloader)
- grub-efi
- #f)
- #:grub-efi32
- #+(if (bootloader-uses-grub-efi? bootloader)
- grub-efi32
- #f)
#:bootloader-package
#+(bootloader-package bootloader)
#:bootloader-installer