Skip to content

Commit

Permalink
Fix 2337
Browse files Browse the repository at this point in the history
  • Loading branch information
svartkanin committed Jan 21, 2024
1 parent 03c1989 commit 647f1e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ def format(
the formatting functionality and in essence the support for the given filesystem.
"""

# don't touch existing partitions
filtered_part = [p for p in device_mod.partitions if not p.exists()]
# only verify partitions that are being created or modified
create_or_modify_parts = [p for p in device_mod.partitions if p.is_create_or_modify()]

self._validate_partitions(filtered_part)
self._validate_partitions(create_or_modify_parts)

# make sure all devices are unmounted
self._umount_all_existing(device_mod.device_path)

for part_mod in filtered_part:
for part_mod in create_or_modify_parts:
# partition will be encrypted
if enc_conf is not None and part_mod in enc_conf.partitions:
self._perform_enc_formatting(
Expand Down
3 changes: 3 additions & 0 deletions archinstall/lib/disk/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,9 @@ def exists(self) -> bool:
def is_exists_or_modify(self) -> bool:
return self.status in [ModificationStatus.Exist, ModificationStatus.Modify]

def is_create_or_modify(self) -> bool:
return self.status in [ModificationStatus.Create, ModificationStatus.Modify]

@property
def mapper_name(self) -> Optional[str]:
if self.dev_path:
Expand Down

0 comments on commit 647f1e3

Please sign in to comment.