Adjusted loopback device descriptions
This commit is contained in:
parent
b20e6cc4ad
commit
2fb2c3fa6e
2 changed files with 10 additions and 5 deletions
|
|
@ -545,9 +545,9 @@ def select_disk(prompt, skip_disk=None):
|
|||
|
||||
def select_disk_parts(prompt, disk):
|
||||
"""Select disk parts from list, returns list of Disk()."""
|
||||
menu = std.Menu(
|
||||
title=std.color_string(f'ddrescue TUI: Part Selection', 'GREEN'),
|
||||
)
|
||||
title = std.color_string(f'ddrescue TUI: Partition Selection', 'GREEN')
|
||||
title += f'\n\nDisk: {disk.path} {disk.description}'
|
||||
menu = std.Menu(title)
|
||||
menu.separator = ' '
|
||||
menu.add_action('Proceed')
|
||||
menu.add_action('Quit')
|
||||
|
|
|
|||
|
|
@ -310,8 +310,9 @@ class Disk(BaseObj):
|
|||
self.details = get_disk_details_linux(self.path)
|
||||
|
||||
# Set necessary details
|
||||
self.details['bus'] = str(self.details.get('bus', '???'))
|
||||
self.details['bus'] = self.details['bus'].upper().replace('NVME', 'NVMe')
|
||||
self.details['bus'] = str(self.details.get('bus', '???')).upper()
|
||||
self.details['bus'] = self.details['bus'].replace('IMAGE', 'Image')
|
||||
self.details['bus'] = self.details['bus'].replace('NVME', 'NVMe')
|
||||
self.details['model'] = self.details.get('model', 'Unknown Model')
|
||||
self.details['name'] = self.details.get('name', self.path)
|
||||
self.details['phy-sec'] = self.details.get('phy-sec', 512)
|
||||
|
|
@ -580,6 +581,10 @@ def get_disk_details_linux(path):
|
|||
dev['bus'] = dev.pop('tran', '???')
|
||||
dev['parent'] = dev.pop('pkname', None)
|
||||
dev['ssd'] = not dev.pop('rota', True)
|
||||
if 'loop' in str(path) and dev['bus'] is None:
|
||||
dev['bus'] = 'Image'
|
||||
dev['model'] = ''
|
||||
dev['serial'] = ''
|
||||
|
||||
# Done
|
||||
return details
|
||||
|
|
|
|||
Loading…
Reference in a new issue