summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/run-qemu-ota12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/run-qemu-ota b/scripts/run-qemu-ota
index e9f44d6..3312fd3 100755
--- a/scripts/run-qemu-ota
+++ b/scripts/run-qemu-ota
@@ -2,7 +2,7 @@
2 2
3from argparse import ArgumentParser 3from argparse import ArgumentParser
4from subprocess import Popen 4from subprocess import Popen
5from os.path import exists 5from os.path import exists, dirname
6import sys 6import sys
7from qemucommand import QemuCommand 7from qemucommand import QemuCommand
8 8
@@ -39,6 +39,16 @@ def main():
39 'This can be used to test Uptane Primary/Secondary communication.') 39 'This can be used to test Uptane Primary/Secondary communication.')
40 parser.add_argument('-n', '--dry-run', help='Print qemu command line rather then run it', action='store_true') 40 parser.add_argument('-n', '--dry-run', help='Print qemu command line rather then run it', action='store_true')
41 args = parser.parse_args() 41 args = parser.parse_args()
42
43 if args.overlay and not exists(args.overlay) and dirname(args.overlay) and not dirname(args.overlay) == '.':
44 print('Error: please provide a file name in the current working directory. ' +
45 'Overlays do not work properly with other directories.')
46 sys.exit(1)
47 if args.overlay and exists(args.overlay) and args.imagename != parser.get_default('imagename'):
48 # qemu-img amend -o <filename> might work, but it has not yet been done
49 # successfully.
50 print('Warning: cannot change backing image of overlay after it has been created.')
51
42 try: 52 try:
43 qemu_command = QemuCommand(args) 53 qemu_command = QemuCommand(args)
44 except ValueError as e: 54 except ValueError as e: