Fix #162: flash_system: meaningful error for missing image

This commit is contained in:
Oliver Smith 2017-07-21 20:26:56 +02:00
parent 56b34212f6
commit 5651c28b41
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 30 additions and 30 deletions

View file

@ -84,8 +84,8 @@ def system(args):
# Generate system image, install flasher
img_path = "/home/user/rootfs/" + args.device + ".img"
if not os.path.exists(args.work + "/chroot_native" + img_path):
setattr(args, "sdcard", None)
pmb.install.install(args, False)
raise RuntimeError("The system image has not been generated yet,"
" please run 'pmbootstrap install' first.")
pmb.flasher.init(args)
# Run the flasher