[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/09: image: Add a post-MBR gap to the default image.
From: |
guix-commits |
Subject: |
08/09: image: Add a post-MBR gap to the default image. |
Date: |
Fri, 29 May 2020 03:12:32 -0400 (EDT) |
mothacehe pushed a commit to branch master
in repository guix.
commit b7b45372e713a53ffa852aec1d3bfb743bb79124
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Fri May 29 09:05:53 2020 +0200
image: Add a post-MBR gap to the default image.
The generic 'efi-disk-image' needs to be bootable on systems without EFI. To
do that, GRUB is installed in the post-MBR gap. Make sure that the first
partition starts with an offset, to make this gap large enough for GRUB.
* gnu/system/image.scm (root-offset, root-label): New variables,
(esp-partition): use 'root-offset' as the partition offset,
(root-partition): use 'root-label' as the partition label.
---
gnu/system/image.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 53f68c0..02c026b 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -65,9 +65,17 @@
;;; Images definitions.
;;;
+;; This is the offset before the first partition. GRUB will install itself in
+;; this post-MBR gap.
+(define root-offset (* 512 2048))
+
+;; Generic root partition label.
+(define root-label "Guix_image")
+
(define esp-partition
(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).
@@ -78,7 +86,7 @@
(define root-partition
(partition
(size 'guess)
- (label "Guix_image")
+ (label root-label)
(file-system "ext4")
(flags '(boot))
(initializer (gexp initialize-root-partition))))
- branch master updated (7c5c21f -> e3f0155), guix-commits, 2020/05/29
- 02/09: bootloader: grub: Do not run grub-install when creating a disk-image., guix-commits, 2020/05/29
- 05/09: system: image: Correct genimage configuration file indentation., guix-commits, 2020/05/29
- 01/09: bootloader: Add 'disk-image-installer'., guix-commits, 2020/05/29
- 03/09: bootloader: grub: Use inheritance to define grub-minimal-bootloader., guix-commits, 2020/05/29
- 04/09: image: Add bootloader installation support., guix-commits, 2020/05/29
- 06/09: image: Use grub-efi to install the EFI bootloader., guix-commits, 2020/05/29
- 08/09: image: Add a post-MBR gap to the default image.,
guix-commits <=
- 09/09: image: Do not use VM to create disk-images., guix-commits, 2020/05/29
- 07/09: system: image: Fix image-with-os., guix-commits, 2020/05/29