From 7499639c5c8f7130ed246804a220f821c4d18d94 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 5 Jul 2023 14:57:54 -0700 Subject: [PATCH] Drop sat,auto detection for smartctl This was needed twofold. First is that it was not working as expected for some time. Second is that it conflicts with the delayed attribute updating needed for faster WKClone menus. --- scripts/wk/hw/disk.py | 6 ------ scripts/wk/hw/smart.py | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/wk/hw/disk.py b/scripts/wk/hw/disk.py index 5c50f476..161ff9f1 100644 --- a/scripts/wk/hw/disk.py +++ b/scripts/wk/hw/disk.py @@ -56,18 +56,12 @@ class Disk: ssd: bool = field(init=False) tests: list[Test] = field(init=False, default_factory=list) trim: bool = field(init=False) - use_sat: bool = field(init=False, default=False) def __post_init__(self): self.path = pathlib.Path(self.path_str).resolve() self.update_details() self.set_description() self.known_attributes = get_known_disk_attributes(self.model) - if not self.attributes and self.bus == 'USB': - # Try using SAT - LOG.warning('Using SAT for smartctl for %s', self.path) - self.notes = [] - self.use_sat = True self.initial_attributes = copy.deepcopy(self.attributes) if not self.is_4k_aligned(): self.add_note('One or more partitions are not 4K aligned', 'YELLOW') diff --git a/scripts/wk/hw/smart.py b/scripts/wk/hw/smart.py index 13331efb..915225bd 100644 --- a/scripts/wk/hw/smart.py +++ b/scripts/wk/hw/smart.py @@ -104,7 +104,7 @@ def enable_smart(dev) -> None: cmd = [ 'sudo', 'smartctl', - f'--device={"sat,auto" if dev.use_sat else "auto"}', + '--device=auto', '--tolerance=permissive', '--smart=on', dev.path, @@ -461,7 +461,7 @@ def update_smart_details(dev) -> None: cmd = [ 'sudo', 'smartctl', - f'--device={"sat,auto" if dev.use_sat else "auto"}', + '--device=auto', '--tolerance=verypermissive', '--all', '--json',