summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbohu <bohu@google.com>2019-05-21 22:59:22 -0700
committerLuca Stefani <luca.stefani.ge1@gmail.com>2019-09-06 13:40:15 +0200
commitbeae054097d61bf085cb31c62f8423817d8066d8 (patch)
tree92e5294dafaecd980328a43441138ff1e2d05229
parentcbe0ed35a63e76b0e9fd87516036cd888fe9f715 (diff)
downloadandroid_device_generic_goldfish-beae054097d61bf085cb31c62f8423817d8066d8.tar.gz
android_device_generic_goldfish-beae054097d61bf085cb31c62f8423817d8066d8.tar.bz2
android_device_generic_goldfish-beae054097d61bf085cb31c62f8423817d8066d8.zip
goldfish: avoid recreating system-qemu.img
if it exists already, just update the images Change-Id: I98f549d560e4d9f891422a85f6c97839ed3a6c47 Merged-In: I98f549d560e4d9f891422a85f6c97839ed3a6c47
-rwxr-xr-xtools/mk_combined_img.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/mk_combined_img.py b/tools/mk_combined_img.py
index 1f195ac..be19cd7 100755
--- a/tools/mk_combined_img.py
+++ b/tools/mk_combined_img.py
@@ -128,6 +128,16 @@ def main():
partitions = parse_input(config)
config.close()
+ # take a shortcut in build environment
+ if os.path.exists(output_filename):
+ print "updating " + output_filename + " ..."
+ shell_command(['dd', "if=" + partitions[0]["path"], "of=" + output_filename,
+ "conv=notrunc,sync", "ibs=1024k", "obs=1024k", "seek=1"])
+ shell_command(['dd', "if=" + partitions[1]["path"], "of=" + output_filename,
+ "conv=notrunc,sync", "ibs=1024k", "obs=1024k", "seek=2"])
+ print "done"
+ sys.exit(0)
+
# combine the images
# add padding
shell_command(['dd', 'if=/dev/zero', 'of='+output_filename, 'ibs=1024k', 'count=1'])