guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/09: image: Add default value for partition initializer.


From: guix-commits
Subject: 05/09: image: Add default value for partition initializer.
Date: Fri, 1 Jul 2022 06:27:34 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 9f530ef38a23caa1136f93cda45d396ce8fe1569
Author: Ludovic Court├Ęs <ludo@gnu.org>
AuthorDate: Fri Jul 1 10:26:17 2022 +0200

    image: Add default value for partition initializer.
    
    Previously, the default value would lead to a wrong-type-to-apply crash.
    
    * gnu/system/image.scm (system-disk-image)[image-builder]: When
    'partition-initializer' returns #f, fall back to
    INITIALIZE-ROOT-PARTITION.
    * gnu/tests/base.scm (run-root-unmount-test)[test-image]: Remove
    'initializer' field of partition.
    * gnu/image.scm (<partition>)[initializer]: Add comment.
---
 gnu/image.scm        | 2 +-
 gnu/system/image.scm | 3 ++-
 gnu/tests/base.scm   | 1 -
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/image.scm b/gnu/image.scm
index e10a495d3d..e347089b34 100644
--- a/gnu/image.scm
+++ b/gnu/image.scm
@@ -70,7 +70,7 @@
   (label                partition-label (default #f))
   (uuid                 partition-uuid (default #f))
   (flags                partition-flags (default '()))
-  (initializer          partition-initializer (default #f)))
+  (initializer          partition-initializer (default #f))) ;gexp | #f
 
 
 ;;;
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index f1739a35c1..60ae38f6d8 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -374,7 +374,8 @@ used in the image."
              (type (partition-file-system partition))
              (image-builder
               (with-imported-modules*
-               (let ((initializer #$(partition-initializer partition))
+               (let ((initializer (or #$(partition-initializer partition)
+                                      initialize-root-partition))
                      (inputs '#+(list e2fsprogs fakeroot dosfstools mtools))
                      (image-root "tmp-root"))
                  (sql-schema #$schema)
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 8284446868..353d6d415a 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -637,7 +637,6 @@ in a loop.  See <http://bugs.gnu.org/26931>.")
                    (size 'guess)
                    (offset (* 512 2048))          ;leave room for GRUB
                    (flags '(boot))
-                   (initializer #~initialize-root-partition)
                    (label "root-under-test")))))) ;max 16 characters!
 
   (define observer-os



reply via email to

[Prev in Thread] Current Thread [Next in Thread]