Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodefiles <11915375+codefiles@users.noreply.github.com>2024-03-07 07:49:14 -0500
committerGitHub <noreply@github.com>2024-03-07 13:49:14 +0100
commitb39e3dc88637732df5356cf503436531cccd24d8 (patch)
treecc1ed8cf6f412a55f71439ce6d09550c53f93ed3
parent1bf68311c281d49641f6e1868b49dbaf40b00470 (diff)
Fix partition table commit (#2294)
-rw-r--r--archinstall/lib/disk/device_handler.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py
index fcf52013..5b97f25d 100644
--- a/archinstall/lib/disk/device_handler.py
+++ b/archinstall/lib/disk/device_handler.py
@@ -322,7 +322,7 @@ class DeviceHandler(object):
part_mod.partuuid = lsblk_info.partuuid
part_mod.uuid = lsblk_info.uuid
- def _perform_partitioning(
+ def _setup_partition(
self,
part_mod: PartitionModification,
block_device: BDevice,
@@ -339,7 +339,6 @@ class DeviceHandler(object):
raise DiskError(f'No partition for dev path found: {part_mod.safe_dev_path}')
disk.deletePartition(part_info.partition)
- disk.commit()
if part_mod.status == ModificationStatus.Delete:
return
@@ -378,16 +377,12 @@ class DeviceHandler(object):
try:
disk.addPartition(partition=partition, constraint=disk.device.optimalAlignedConstraint)
- disk.commit()
-
- # the creation will take a bit of time
- time.sleep(3)
-
- # the partition has a real path now as it was created
- part_mod.dev_path = Path(partition.path)
except PartitionException as ex:
raise DiskError(f'Unable to add partition, most likely due to overlapping sectors: {ex}') from ex
+ # the partition has a path now that it has been added
+ part_mod.dev_path = Path(partition.path)
+
def _fetch_part_info(self, path: Path) -> LsblkInfo:
attempts = 3
lsblk_info: Optional[LsblkInfo] = None
@@ -535,7 +530,9 @@ class DeviceHandler(object):
# if the entire disk got nuked then we don't have to delete
# any existing partitions anymore because they're all gone already
requires_delete = modification.wipe is False
- self._perform_partitioning(part_mod, modification.device, disk, requires_delete=requires_delete)
+ self._setup_partition(part_mod, modification.device, disk, requires_delete=requires_delete)
+
+ disk.commit()
def mount(
self,