Changing debug information

This commit is contained in:
Anton Hvornum 2022-02-09 17:51:34 +01:00
parent 87b9e798b3
commit e9bb19df9d
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
2 changed files with 9 additions and 10 deletions

View File

@ -100,18 +100,15 @@ class luks2:
])
# print(f"Looking for phrase: 'Enter passphrase for {partition.path}'")
cryptworker = SysCommandWorker(cryptsetup_args)
cryptworker = SysCommandWorker(cryptsetup_args, peak_output=True)
# print(f'Looking for: Enter passphrase for {partition.path}')
with open('debug.txt', 'a') as silent_output:
silent_output.write(f"Looking for: Enter passphrase for {partition.path}\n")
pw_given = False
while cryptworker.is_alive():
if bytes(f'Enter passphrase for {partition.path}', 'UTF-8') in cryptworker and pw_given is False:
silent_output.write(f"found it! Writing password: {password}\n")
cryptworker.write(password)
pw_given = True
time.sleep(0.25)
pw_given = False
while cryptworker.is_alive():
if bytes(f'Enter passphrase for {partition.path}', 'UTF-8') in cryptworker and pw_given is False:
cryptworker.write(password)
pw_given = True
time.sleep(0.25)
if cryptworker.exit_code == 256:
log(f'{partition} is being used, trying to unmount and crypt-close the device and running one more attempt at encrypting the device: {cryptworker}', level=logging.INFO)

2
debug.txt Normal file
View File

@ -0,0 +1,2 @@
Looking for: Enter passphrase for /dev/loop0p2
found it! Writing password: b'test'