OSDN Git Service

Support wiping userdata for A/B OTA packages.
authorTao Bao <tbao@google.com>
Thu, 16 Jun 2016 03:49:34 +0000 (03:49 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 16 Jun 2016 03:49:34 +0000 (03:49 +0000)
am: 38ca0be399

Change-Id: Id1908bbbb475f5ae3bc16fc2da5120e7d205b0b6

1  2 
tools/releasetools/ota_from_target_files.py

@@@ -1283,10 -1272,15 +1283,15 @@@ def WriteABOTAPackageWithBrilloScript(t
    cmd = ["brillo_update_payload", "properties",
           "--payload", signed_payload_file,
           "--properties_file", properties_file]
 -  p1 = common.Run(cmd, stdout=subprocess.PIPE)
 -  p1.wait()
 +  p1 = common.Run(cmd, stdout=log_file, stderr=subprocess.STDOUT)
 +  p1.communicate()
    assert p1.returncode == 0, "brillo_update_payload properties failed"
  
+   if OPTIONS.wipe_user_data:
+     with open(properties_file, "a") as f:
+       f.write("POWERWASH=1\n")
+     metadata["ota-wipe"] = "yes"
    # Add the signed payload file and properties into the zip.
    common.ZipWrite(output_zip, properties_file, arcname="payload_properties.txt")
    common.ZipWrite(output_zip, signed_payload_file, arcname="payload.bin",