Add udev sync after LUKS encrypt (#3289)

This commit is contained in:
codefiles 2025-03-21 20:16:19 -04:00 committed by GitHub
parent 54e7a94cf8
commit d326ceff45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -318,6 +318,8 @@ class DeviceHandler:
key_file = luks_handler.encrypt()
self.udev_sync()
luks_handler.unlock(key_file=key_file)
if not luks_handler.mapper_dev:
@ -344,6 +346,8 @@ class DeviceHandler:
key_file = luks_handler.encrypt()
self.udev_sync()
luks_handler.unlock(key_file=key_file)
if not luks_handler.mapper_dev:

View File

@ -1,7 +1,6 @@
from __future__ import annotations
import shlex
import time
from dataclasses import dataclass
from pathlib import Path
@ -135,10 +134,6 @@ class Luks2:
key_file = self._get_key_file(key_file)
wait_timer = time.time()
while Path(self.luks_dev_path).exists() is False and time.time() - wait_timer < 10:
time.sleep(0.025)
result = SysCommand(
'cryptsetup open '
f'{self.luks_dev_path} '