index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-02-11 14:11:21 +0100 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-02-11 14:11:21 +0100 |
commit | e2cd617d05d87bbe3fe8f1809faecd8c1ebd230e (patch) | |
tree | b1ec5d90d9869bc4ee1e877e5b8be97333b40ec3 /archinstall/lib/luks.py | |
parent | 03c46cce2b62b41c5b73f86dffb90eff6a1b8eb2 (diff) |
-rw-r--r-- | archinstall/lib/luks.py | 7 |
diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py index e1f14bab..d62c2d4b 100644 --- a/archinstall/lib/luks.py +++ b/archinstall/lib/luks.py @@ -12,6 +12,7 @@ class luks2(): self.mountpoint = mountpoint self.args = args self.kwargs = kwargs + self.filesystem = 'crypto_LUKS' def __enter__(self): key_file = self.encrypt(self.partition, self.password, *self.args, **self.kwargs) @@ -57,4 +58,8 @@ class luks2(): def close(self, mountpoint): sys_command(f'cryptsetup close /dev/mapper/{mountpoint}') - return os.path.islink(f'/dev/mapper/{mountpoint}') is False
\ No newline at end of file + return os.path.islink(f'/dev/mapper/{mountpoint}') is False + + def format(self, path): + if (handle := sys_command(f"/usr/bin/cryptsetup -q -v luksErase {path}")).exit_code != 0: + raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}')
\ No newline at end of file |