From a35ffdda23f4dfc782a4c0b051f48a1060971539 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 20 Feb 2022 18:10:13 -0700 Subject: [PATCH] Open ddrescueview during recovery Addresses issue #182 --- scripts/wk/hw/ddrescue.py | 15 +++++++++++++++ setup/linux/packages/aur | 1 + setup/linux/packages/dependencies | 1 + 3 files changed, 17 insertions(+) diff --git a/scripts/wk/hw/ddrescue.py b/scripts/wk/hw/ddrescue.py index 17faec9b..3e441127 100644 --- a/scripts/wk/hw/ddrescue.py +++ b/scripts/wk/hw/ddrescue.py @@ -132,6 +132,11 @@ class BlockPair(): 'trim': 'Pending', 'scrape': 'Pending', }) + self.view_proc = 'Disabled' + if 'DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ: + # Enable opening ddrescueview during recovery + self.view_proc = None + # Set map file # e.g. '(Clone|Image)_Model[_p#]_Size[_Label].map' @@ -2029,6 +2034,16 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True): exe.stop_process(proc) std.print_error(warning_message) break + + # Open ddrescueview + ## NOTE: This needs to be started a bit into the recovery since it needs + ## a non-zero map file to read + if not block_pair.view_proc and _i > 1: + block_pair.view_proc = exe.popen_program( + ['ddrescueview', '-r', '5s', block_pair.map_path], + pipe=True, + ) + if _i % 60 == 0: # Clear ddrescue pane tmux.clear_pane() diff --git a/setup/linux/packages/aur b/setup/linux/packages/aur index 2db544e9..bcc5c8d1 100644 --- a/setup/linux/packages/aur +++ b/setup/linux/packages/aur @@ -1,4 +1,5 @@ aic94xx-firmware +ddrescueview-bin hfsprogs iwgtk memtest86-efi diff --git a/setup/linux/packages/dependencies b/setup/linux/packages/dependencies index 63615c68..6919c857 100644 --- a/setup/linux/packages/dependencies +++ b/setup/linux/packages/dependencies @@ -34,4 +34,5 @@ startup-notification subversion syslinux tigervnc +unzip wpa_supplicant