diff options
author | bohu <bohu@google.com> | 2019-05-21 22:59:22 -0700 |
---|---|---|
committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2019-09-06 13:40:15 +0200 |
commit | beae054097d61bf085cb31c62f8423817d8066d8 (patch) | |
tree | 92e5294dafaecd980328a43441138ff1e2d05229 | |
parent | cbe0ed35a63e76b0e9fd87516036cd888fe9f715 (diff) | |
download | android_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-x | tools/mk_combined_img.py | 10 |
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']) |