From c6f41b5b3ca3d7ac3c12ad3995ffef4e831973a0 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 4 Dec 2015 15:38:50 -0800 Subject: Add support for LZ4 compressed image files Added dex2oat option --image-format=(store|lz4). Using lz4 means that the main image section (all data other than header and bitmap) are stored in a compressed state. N5 results: Boot image size: 8067128 -> 2827605 Decompression time 18.93ms Decompression rate: 426MB/s Patchoat is not currently supported since it maps the source image directly. In order to support compressed images we would need to recompress the output image and then write it back out to a file. Also there are not many cases where we would want to patch a compressed image since they are going to be dirty memory when uncompressed anyways. Might as well just patch as we are loading. Bug: 22858531 Change-Id: I8c54ccf73408273011161a61bb891736735074d9 --- patchoat/patchoat.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'patchoat/patchoat.cc') diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc index 723bb1762d..46ab34bea3 100644 --- a/patchoat/patchoat.cc +++ b/patchoat/patchoat.cc @@ -153,6 +153,12 @@ bool PatchOat::Patch(const std::string& image_location, off_t delta, return false; } + if (image_header.GetStorageMode() != ImageHeader::kStorageModeUncompressed) { + LOG(ERROR) << "Patchoat is not supported with compressed image files " + << input_image->GetPath(); + return false; + } + /*bool is_image_pic = */IsImagePic(image_header, input_image->GetPath()); // Nothing special to do right now since the image always needs to get patched. // Perhaps in some far-off future we may have images with relative addresses that are true-PIC. -- cgit v1.2.3-59-g8ed1b