aboutsummaryrefslogtreecommitdiff
path: root/linaro-media-create
diff options
context:
space:
mode:
Diffstat (limited to 'linaro-media-create')
-rwxr-xr-xlinaro-media-create18
1 files changed, 14 insertions, 4 deletions
diff --git a/linaro-media-create b/linaro-media-create
index 344d0f2..18a26e3 100755
--- a/linaro-media-create
+++ b/linaro-media-create
@@ -57,7 +57,6 @@ ROOT_DISK = None
# Registered as the first atexit handler as we want this to be the last
# handler to execute.
-@atexit.register
def cleanup_tempdir():
"""Remove TEMP_DIR with all its contents.
@@ -113,14 +112,25 @@ if __name__ == '__main__':
sig_file_list.append(args.binarysig)
verified_files, gpg_sig_pass = verify_file_integrity(sig_file_list)
+ # Check the outputs from verify_file_integrity
+ # Abort if anything fails.
if not gpg_sig_pass:
- # Other users of verifiy_file_integrity find just a sha1sum pass
- # useful, but here we are only interested in a complete pass or fail.
- verified_files = []
+ print >> sys.stderr, "GPG signature verification failed. Aborting."
+ sys.exit(1)
+
+ if not os.path.basename(args.binary) in verified_files:
+ print >> sys.stderr, "OS Binary verification failed"
+ sys.exit(1)
+
+ for hwpack in args.hwpacks:
+ if not os.path.basename(hwpack) in verified_files:
+ print >> sys.stderr, "Hwpack {0} verification failed".format(hwpack)
+ sys.exit(1)
for verified_file in verified_files:
print 'Hash verification of file %s OK.' % verified_file
+ atexit.register(cleanup_tempdir)
media = Media(args.device)
if media.is_block_device:
if not board_config.supports_writing_to_mmc: