Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-03-09 11:48:40 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-03-09 11:48:40 +0100
commit9f0d25bce302459efa5ab5b9eaf22bb1f1feb575 (patch)
tree5721a2b6f88bcc24b7ca15e89cf57dce176a3652 /archinstall/lib/disk.py
parent586f8bc32ef81695f31f10f41472443ad5f280cd (diff)
Added functions to auto-detect filesystems inside encrypted partitions (given a password)
Diffstat (limited to 'archinstall/lib/disk.py')
-rw-r--r--archinstall/lib/disk.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 335ec42e..75cecb0b 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -188,6 +188,11 @@ class Partition():
return f"/dev/{parent}"
raise DiskError(f'Could not find appropriate parent for encrypted partition {self}')
+ def detect_inner_filesystem(self, password):
+ from .luks import luks2
+ with luks2(self, 'luksloop', password, auto_unmount=True) as unlocked_device:
+ return unlocked_device.filesystem
+
def has_content(self):
temporary_mountpoint = '/tmp/'+hashlib.md5(bytes(f"{time.time()}", 'UTF-8')+os.urandom(12)).hexdigest()
temporary_path = pathlib.Path(temporary_mountpoint)