From b07b23bba8ee617225edb2088c09939c4e83ad54 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Thu, 26 Jan 2023 14:53:01 +0530 Subject: [PATCH 1/3] Commit distinst disk mklabel changes before further default install --- daemon/Daemon.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon/Daemon.vala b/daemon/Daemon.vala index 2a93ea6c0..8735db976 100644 --- a/daemon/Daemon.vala +++ b/daemon/Daemon.vala @@ -312,6 +312,13 @@ public class InstallerDaemon.Daemon : GLib.Object { throw new GLib.IOError.FAILED ("Unable to write partition table to %s", disk_path); } + // Commit the new partition table. + result = disk.commit (); + + if (result != 0) { + throw new GLib.IOError.FAILED ("Unable to commit partition table to %s", disk_path); + } + var start = disk.get_sector (ref start_sector); var end = disk.get_sector (ref boot_sector); From 20b9ddf0f4d2d7d41f8ada8a427273f9c2f58c20 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Thu, 26 Jan 2023 19:42:39 +0530 Subject: [PATCH 2/3] Comment out initial attempt at a fix --- daemon/Daemon.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/Daemon.vala b/daemon/Daemon.vala index 8735db976..193ed9805 100644 --- a/daemon/Daemon.vala +++ b/daemon/Daemon.vala @@ -313,11 +313,12 @@ public class InstallerDaemon.Daemon : GLib.Object { } // Commit the new partition table. + /* result = disk.commit (); if (result != 0) { throw new GLib.IOError.FAILED ("Unable to commit partition table to %s", disk_path); - } + }*/ var start = disk.get_sector (ref start_sector); var end = disk.get_sector (ref boot_sector); From 50f5e957086f9bed216c98df77f3c2429c004dc4 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Thu, 26 Jan 2023 19:43:47 +0530 Subject: [PATCH 3/3] Alternate attempt at a fix - remove existing partitions before preparing disk layout --- daemon/Daemon.vala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/daemon/Daemon.vala b/daemon/Daemon.vala index 193ed9805..c7b74a7f8 100644 --- a/daemon/Daemon.vala +++ b/daemon/Daemon.vala @@ -305,6 +305,11 @@ public class InstallerDaemon.Daemon : GLib.Object { value = 0 }; + unowned var partitions = disk.list_partitions (); + foreach (unowned var partition in partitions) { + disk.remove_partition (partition.get_number ()); + } + // Prepares a new partition table. int result = disk.mklabel (bootloader);