Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/filesystem.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-05 16:52:19 +0100
committerAnton Hvornum <anton@hvornum.se>2021-11-05 16:52:19 +0100
commitf234b631691e7dcd587243e09c787139bc56fe13 (patch)
tree435e7bd6f6796a4404e67d9f7b1a210bdeb22b4d /archinstall/lib/disk/filesystem.py
parent5db146a0eb017c240f68579fc58ff825300352cf (diff)
parent0071a069080732047e11309134869f3ab40c642c (diff)
Merge branch 'master' of github.com:archlinux/archinstall into torxed-fix-93
Diffstat (limited to 'archinstall/lib/disk/filesystem.py')
-rw-r--r--archinstall/lib/disk/filesystem.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index 0328cd83..69593d08 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -1,8 +1,9 @@
import time
import logging
import json
+from .exceptions import DiskError
from .partition import Partition
-from .blockdevice import BlockDevice
+from .validators import valid_fs_type
from ..general import SysCommand
from ..output import log
from ..storage import storage
@@ -55,7 +56,7 @@ class Filesystem:
def partuuid_to_index(self, uuid):
output = json.loads(SysCommand(f"lsblk --json -o+PARTUUID {self.blockdevice.device}").decode('UTF-8'))
-
+
for device in output['blockdevices']:
for index, partition in enumerate(device['children']):
if partition['partuuid'].lower() == uuid:
@@ -101,7 +102,7 @@ class Filesystem:
partition['password'] = get_password(f"Enter a encryption password for {partition['device_instance']}")
partition['device_instance'].encrypt(password=partition['password'])
- with luks2(partition['device_instance'], storage.get('ENC_IDENTIFIER', 'ai')+'loop', partition['password']) as unlocked_device:
+ with luks2(partition['device_instance'], storage.get('ENC_IDENTIFIER', 'ai') + 'loop', partition['password']) as unlocked_device:
if not partition.get('format'):
if storage['arguments'] == 'silent':
raise ValueError(f"Missing fs-type to format on newly created encrypted partition {partition['device_instance']}")
@@ -113,13 +114,13 @@ class Filesystem:
while True:
partition['filesystem']['format'] = input(f"Enter a valid fs-type for newly encrypted partition {partition['filesystem']['format']}: ").strip()
if not partition['filesystem']['format'] or valid_fs_type(partition['filesystem']['format']) is False:
- pint("You need to enter a valid fs-type in order to continue. See `man parted` for valid fs-type's.")
+ print("You need to enter a valid fs-type in order to continue. See `man parted` for valid fs-type's.")
continue
break
- unlocked_device.format(partition['filesystem']['format'])
+ unlocked_device.format(partition['filesystem']['format'], options=partition.get('options', []))
elif partition.get('format', False):
- partition['device_instance'].format(partition['filesystem']['format'])
+ partition['device_instance'].format(partition['filesystem']['format'], options=partition.get('options', []))
if partition.get('boot', False):
self.set(self.partuuid_to_index(partition['device_instance'].uuid), 'boot on')
@@ -170,7 +171,6 @@ class Filesystem:
raise DiskError(f"New partition never showed up after adding new partition on {self} (timeout 10 seconds).")
time.sleep(0.025)
-
# Todo: Find a better way to detect if the new UUID of the partition has showed up.
# But this will address (among other issues)
time.sleep(float(storage['arguments'].get('disk-sleep', 2.0))) # Let the kernel catch up with quick block devices (nvme for instance)
@@ -190,4 +190,4 @@ class Filesystem:
SysCommand(f'bash -c "umount {device}?"')
except:
pass
- return self.raw_parted(f'{device} mklabel {disk_label}').exit_code == 0 \ No newline at end of file
+ return self.raw_parted(f'{device} mklabel {disk_label}').exit_code == 0