[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/04: image: Add partition offset support.
From: |
guix-commits |
Subject: |
01/04: image: Add partition offset support. |
Date: |
Wed, 20 May 2020 10:26:01 -0400 (EDT) |
mothacehe pushed a commit to branch wip-hurd-vm
in repository guix.
commit 07708ce1ed1822076044cc81df8a39d3a17c8575
Author: Mathieu Othacehe <address@hidden>
AuthorDate: Wed May 20 16:09:53 2020 +0200
image: Add partition offset support.
* gnu/image.scm (partition-offset): New procedure,
(<partition>)[offset]: new field.
* gnu/system/image.scm (system-disk-image): Apply the partition offset.
---
gnu/image.scm | 2 ++
gnu/system/image.scm | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/gnu/image.scm b/gnu/image.scm
index b05fc69..3a02692 100644
--- a/gnu/image.scm
+++ b/gnu/image.scm
@@ -22,6 +22,7 @@
partition?
partition-device
partition-size
+ partition-offset
partition-file-system
partition-label
partition-uuid
@@ -47,6 +48,7 @@
partition?
(device partition-device (default #f))
(size partition-size)
+ (offset partition-offset (default #f))
(file-system partition-file-system (default "ext4"))
(label partition-label (default #f))
(uuid partition-uuid (default #f))
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 571b7af..adc2b3c 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -243,11 +243,17 @@ used in the image."
;; Return the genimage partition configuration for PARTITION.
(let ((label (partition-label partition))
(dos-type (partition->dos-type partition))
- (image (partition-image partition)))
+ (image (partition-image partition))
+ (offset (partition-offset partition)))
#~(format #f "~/partition ~a {
~/~/partition-type = ~a
~/~/image = \"~a\"
- ~/}" #$label #$dos-type #$image)))
+ ~/~/offset = \"~a\"
+ ~/}"
+ #$label
+ #$dos-type
+ #$image
+ #$(or offset 0))))
(let* ((format (image-format image))
(image-type (format->image-type format))