[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/10: system: Serialize the UUID type in the "parameters" file.
From: |
Ludovic Courtès |
Subject: |
07/10: system: Serialize the UUID type in the "parameters" file. |
Date: |
Mon, 11 Sep 2017 16:52:34 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 075681d3501082c6e22df8abf29dfe89d85effc1
Author: Ludovic Courtès <address@hidden>
Date: Wed Sep 6 10:22:58 2017 +0200
system: Serialize the UUID type in the "parameters" file.
* gnu/system.scm (read-boot-parameters)[device->sexp]: New procedure.
Use it for 'root-device' and 'store-device'.
(device->sexp): Serialize the UUID type in addition to its bytevector.
---
gnu/system.scm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index a8d2a81..6f795d6 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -234,6 +234,15 @@ directly by the user."
(define (read-boot-parameters port)
"Read boot parameters from PORT and return the corresponding
<boot-parameters> object or #f if the format is unrecognized."
+ (define device-sexp->device
+ (match-lambda
+ (('uuid (? symbol? type) (? bytevector? bv))
+ (bytevector->uuid bv type))
+ ((? bytevector? bv) ;old format
+ (bytevector->uuid bv 'dce))
+ ((? string? device)
+ device)))
+
(match (read port)
(('boot-parameters ('version 0)
('label label) ('root-device root)
@@ -241,7 +250,7 @@ directly by the user."
rest ...)
(boot-parameters
(label label)
- (root-device root)
+ (root-device (device->sexp root))
(bootloader-name
(match (assq 'bootloader-name rest)
@@ -269,10 +278,8 @@ directly by the user."
(store-device
(match (assq 'store rest)
- (('store ('device (? bytevector? bv)) _ ...)
- (bytevector->uuid bv))
(('store ('device device) _ ...)
- device)
+ (device-sexp->device device))
(_ ;the old format
;; Root might be a device path like "/dev/sda1", which is not a
;; suitable GRUB device identifier.
@@ -925,8 +932,7 @@ kernel arguments for that derivation to <boot-parameters>."
"Serialize DEVICE as an sexp (really, as an object with a read syntax.)"
(match device
((? uuid? uuid)
- ;; TODO: Preserve the type of UUID.
- (uuid-bytevector uuid))
+ `(uuid ,(uuid-type uuid) ,(uuid-bytevector uuid)))
(_
device)))
- branch master updated (007b92c -> 5f7fe1c), Ludovic Courtès, 2017/09/11
- 03/10: services: base: Import the closure of (gnu build file-systems)., Ludovic Courtès, 2017/09/11
- 01/10: vm: Allow partitions to be initialized with a given UUID., Ludovic Courtès, 2017/09/11
- 05/10: services: file-system: Use 'file-system->spec'., Ludovic Courtès, 2017/09/11
- 07/10: system: Serialize the UUID type in the "parameters" file.,
Ludovic Courtès <=
- 08/10: uuid: 'uuid' macro supports more UUID types., Ludovic Courtès, 2017/09/11
- 09/10: vm: Allow users to specify a UUID for the root partition., Ludovic Courtès, 2017/09/11
- 10/10: vm: Generate a UUID to identify the root file system., Ludovic Courtès, 2017/09/11
- 02/10: file-systems: Add UUID type dictionaries., Ludovic Courtès, 2017/09/11
- 06/10: system: Introduce a disjoint UUID type., Ludovic Courtès, 2017/09/11
- 04/10: file-systems: Introduce (gnu system uuid)., Ludovic Courtès, 2017/09/11