Mark boot OTAs as partial OTAs

Boot partition only OTA must be marked as "partial". This is required
for update_engine to correctly copy non-updated partitions to the target
slot.

Test: th
Bug: 293313353
Change-Id: Ic89d03f214e12fa43f686d37854d6fed1d78a6a3
diff --git a/tools/releasetools/ota_from_raw_img.py b/tools/releasetools/ota_from_raw_img.py
index 37504d1..63f88ea 100644
--- a/tools/releasetools/ota_from_raw_img.py
+++ b/tools/releasetools/ota_from_raw_img.py
@@ -71,16 +71,22 @@
   if not args.partition_names:
     args.partition_names = [os.path.os.path.splitext(os.path.basename(path))[
         0] for path in args.images]
-  with tempfile.NamedTemporaryFile() as unsigned_payload:
+  with tempfile.NamedTemporaryFile() as unsigned_payload, tempfile.NamedTemporaryFile() as dynamic_partition_info_file:
+    dynamic_partition_info_file.writelines(
+        [b"virtual_ab=true\n", b"super_partition_groups=\n"])
+    dynamic_partition_info_file.flush()
     cmd = [ResolveBinaryPath("delta_generator", args.search_path)]
     cmd.append("--partition_names=" + ",".join(args.partition_names))
+    cmd.append("--dynamic_partition_info_file=" +
+               dynamic_partition_info_file.name)
     cmd.append("--new_partitions=" + ",".join(args.images))
     cmd.append("--out_file=" + unsigned_payload.name)
+    cmd.append("--is_partial_update")
     if args.max_timestamp:
       cmd.append("--max_timestamp=" + str(args.max_timestamp))
     logger.info("Running %s", cmd)
 
-    subprocess.run(cmd)
+    subprocess.check_call(cmd)
     generator = PayloadGenerator()
     generator.payload_file = unsigned_payload.name
     logger.info("Payload size: %d", os.path.getsize(generator.payload_file))