diff options
| author | Mathieu Othacehe <m.othacehe@gmail.com> | 2020-05-20 16:09:53 +0200 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-05-26 09:57:06 +0200 |
| commit | 1b4fa7851b39f087a6433e8b5e22c479ca1da289 (patch) | |
| tree | bdc6d4e96df8a0d7598f023f8dbf2eb32ffb1479 /gnu | |
| parent | edb0366c16fee4767a1d007b6c38f11080910b50 (diff) | |
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.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/image.scm | 2 | ||||
| -rw-r--r-- | gnu/system/image.scm | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gnu/image.scm b/gnu/image.scm index b05fc69dc57..3a026929505 100644 --- a/gnu/image.scm +++ b/gnu/image.scm | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | partition? | 22 | partition? |
| 23 | partition-device | 23 | partition-device |
| 24 | partition-size | 24 | partition-size |
| 25 | partition-offset | ||
| 25 | partition-file-system | 26 | partition-file-system |
| 26 | partition-label | 27 | partition-label |
| 27 | partition-uuid | 28 | partition-uuid |
| @@ -47,6 +48,7 @@ | |||
| 47 | partition? | 48 | partition? |
| 48 | (device partition-device (default #f)) | 49 | (device partition-device (default #f)) |
| 49 | (size partition-size) | 50 | (size partition-size) |
| 51 | (offset partition-offset (default #f)) | ||
| 50 | (file-system partition-file-system (default "ext4")) | 52 | (file-system partition-file-system (default "ext4")) |
| 51 | (label partition-label (default #f)) | 53 | (label partition-label (default #f)) |
| 52 | (uuid partition-uuid (default #f)) | 54 | (uuid partition-uuid (default #f)) |
diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 571b7af5f35..adc2b3c221a 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm | |||
| @@ -243,11 +243,17 @@ used in the image." | |||
| 243 | ;; Return the genimage partition configuration for PARTITION. | 243 | ;; Return the genimage partition configuration for PARTITION. |
| 244 | (let ((label (partition-label partition)) | 244 | (let ((label (partition-label partition)) |
| 245 | (dos-type (partition->dos-type partition)) | 245 | (dos-type (partition->dos-type partition)) |
| 246 | (image (partition-image partition))) | 246 | (image (partition-image partition)) |
| 247 | (offset (partition-offset partition))) | ||
| 247 | #~(format #f "~/partition ~a { | 248 | #~(format #f "~/partition ~a { |
| 248 | ~/~/partition-type = ~a | 249 | ~/~/partition-type = ~a |
| 249 | ~/~/image = \"~a\" | 250 | ~/~/image = \"~a\" |
| 250 | ~/}" #$label #$dos-type #$image))) | 251 | ~/~/offset = \"~a\" |
| 252 | ~/}" | ||
| 253 | #$label | ||
| 254 | #$dos-type | ||
| 255 | #$image | ||
| 256 | #$(or offset 0)))) | ||
| 251 | 257 | ||
| 252 | (let* ((format (image-format image)) | 258 | (let* ((format (image-format image)) |
| 253 | (image-type (format->image-type format)) | 259 | (image-type (format->image-type format)) |
