Additionally look for partition files under RADIO/ in target_files zip. am: 07216d6fd7
am: 00751159df

Change-Id: I18d6a3f34c8436aec20fc557a35943adfc14ca83
diff --git a/scripts/brillo_update_payload b/scripts/brillo_update_payload
index 65c63f5..e1e9c27 100755
--- a/scripts/brillo_update_payload
+++ b/scripts/brillo_update_payload
@@ -454,7 +454,18 @@
   for part in "${partitions[@]}"; do
     part_file=$(create_tempfile "${part}.img.XXXXXX")
     CLEANUP_FILES+=("${part_file}")
-    unzip -p "${image}" "IMAGES/${part}.img" >"${part_file}"
+
+    # For each partition, we in turn look for its image file under IMAGES/ and
+    # RADIO/ in the given target_files zip file.
+    local path path_in_zip
+    for path in IMAGES RADIO; do
+      if unzip -l "${image}" "${path}/${part}.img" >/dev/null; then
+        path_in_zip="${path}"
+        break
+      fi
+    done
+    [[ -n "${path_in_zip}" ]] || die "Failed to find ${part}.img"
+    unzip -p "${image}" "${path_in_zip}/${part}.img" >"${part_file}"
 
     # If the partition is stored as an Android sparse image file, we need to
     # convert them to a raw image for the update.
@@ -473,7 +484,7 @@
     # Extract the .map file (if one is available).
     part_map_file=$(create_tempfile "${part}.map.XXXXXX")
     CLEANUP_FILES+=("${part_map_file}")
-    unzip -p "${image}" "IMAGES/${part}.map" >"${part_map_file}" || \
+    unzip -p "${image}" "${path_in_zip}/${part}.map" >"${part_map_file}" || \
       part_map_file=""
 
     # delta_generator only supports images multiple of 4 KiB. For target images