From e9bb19df9da07898fe3db81b3435637f8f099112 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 9 Feb 2022 17:51:34 +0100 Subject: [PATCH] Changing debug information --- archinstall/lib/luks.py | 17 +++++++---------- debug.txt | 2 ++ 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 debug.txt diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py index fc3196eb..59c437b9 100644 --- a/archinstall/lib/luks.py +++ b/archinstall/lib/luks.py @@ -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) diff --git a/debug.txt b/debug.txt new file mode 100644 index 00000000..bb354d7a --- /dev/null +++ b/debug.txt @@ -0,0 +1,2 @@ +Looking for: Enter passphrase for /dev/loop0p2 +found it! Writing password: b'test'