flash: partprobe the target as well

This commit is contained in:
InsanePrawn 2022-02-13 18:48:48 +01:00
parent f0a9d3a670
commit feadf6f1e8

View file

@ -47,6 +47,7 @@ def cmd_flash(what, location):
sanitized_file = file.replace('-', '').replace('_', '').lower()
if f'jumpdrive{location.split("-")[0]}' in sanitized_file:
path = os.path.realpath(os.path.join(dir, file))
partprobe(path)
result = subprocess.run(['lsblk', path, '-o', 'SIZE'], capture_output=True)
if result.returncode != 0:
raise Exception(f'Failed to lsblk {path}')