guix-commits
[Top][All Lists]
Advanced

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

02/03: installer: parted: Call set-system before set-flags.


From: guix-commits
Subject: 02/03: installer: parted: Call set-system before set-flags.
Date: Fri, 5 Aug 2022 02:57:45 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit 3c381af76a144a4dc3d0f9269f43ee2ec501b538
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Fri Aug 5 08:50:51 2022 +0200

    installer: parted: Call set-system before set-flags.
    
    Parted 3.5 introduces the following regression:
    
    - partition-set-flag sets the BIOS_GRUB flag. The partition type is set to
    PARTITION_BIOS_GRUB_GUID.
    
    - partition-set-system resets the partition type to 
PARTITION_LINUX_DATA_GUID
    undoing what's done by partition-set-flag.
    
    To prevent it, reverse the call order.
    
    Fixes: <https://issues.guix.gnu.org/55549>.
    
    * gnu/installer/parted.scm (mkpart): Call partition-set-system before
    partition-set-flag.
---
 gnu/installer/parted.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index 6c823e77eb..ba0a38fff8 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -845,15 +845,18 @@ cause them to cross."
          (when (and partition-ok? has-name? name)
            (partition-set-name partition name))
 
-         ;; Set flags is required.
+         ;; Both partition-set-system and partition-set-flag calls can affect
+         ;; the partition type.  Their order is important, see:
+         ;; https://issues.guix.gnu.org/55549.
+         (partition-set-system partition filesystem-type)
+
+         ;; Set flags if required.
          (for-each (lambda (flag)
                      (and (partition-is-flag-available? partition flag)
                           (partition-set-flag partition flag 1)))
                    flags)
 
-         (and partition-ok?
-              (partition-set-system partition filesystem-type)
-              partition))))))
+         (and partition-ok? partition))))))
 
 
 ;;



reply via email to

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