Pack base_fs files into target_files.zip.

Pack the base_fs files ({system,vendor}.map) into target_files.zip,
which would be needed when rebuilding the images at signing.

Reset the base_fs paths to point to the files in META/.

Also add blk_alloc_to_base_fs into otatools.zip.

Bug: 27698960
Change-Id: If4eb274b3f3d839c4365624f46f0dc89bd2fa440
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 9a866f5..1dc048f 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -182,6 +182,21 @@
       d["ramdisk_fs_config"] = os.path.join(
           input_dir, "META", "root_filesystem_config.txt")
 
+    # Redirect {system,vendor}_base_fs_file.
+    if "system_base_fs_file" in d:
+      basename = os.path.basename(d["system_base_fs_file"])
+      system_base_fs_file = os.path.join(input_dir, "META", basename)
+      assert os.path.exists(system_base_fs_file), \
+          "failed to find system base fs file: %s" % (system_base_fs_file,)
+      d["system_base_fs_file"] = system_base_fs_file
+
+    if "vendor_base_fs_file" in d:
+      basename = os.path.basename(d["vendor_base_fs_file"])
+      vendor_base_fs_file = os.path.join(input_dir, "META", basename)
+      assert os.path.exists(vendor_base_fs_file), \
+          "failed to find vendor base fs file: %s" % (vendor_base_fs_file,)
+      d["vendor_base_fs_file"] = vendor_base_fs_file
+
   try:
     data = read_helper("META/imagesizes.txt")
     for line in data.split("\n"):