From 350d384492406e70085f2f540d46dc4eb95e640f Mon Sep 17 00:00:00 2001 From: Antoine Fontaine Date: Sun, 22 Mar 2020 11:09:04 +0100 Subject: [PATCH] pmb.install._install: check sdcard exist (extra sanity check) (!1894) --- pmb/install/_install.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index fccb37e9..3359cc05 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -362,6 +362,8 @@ def embed_firmware(args): def sanity_check_sdcard(device): device_name = os.path.basename(device) + if not os.path.exists(device): + raise RuntimeError("{} doesn't exist, is the sdcard plugged?".format(device)) if os.path.isdir('/sys/class/block/{}'.format(device_name)): with open('/sys/class/block/{}/ro'.format(device_name), 'r') as handle: ro = handle.read()