aboutsummaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-06-10 13:02:50 -0700
committerTom Marshall <tdm@cyngn.com>2015-11-25 15:35:48 -0800
commitcacf65446dde64dc47c9a4d9a6af002f564274ea (patch)
tree78de44cedffc438daafa9aafb70998c8759dd85b /updater
parent3d561da3d9f9a5d690a68c96be29d65f0a4d55bb (diff)
downloadbootable_recovery-cacf65446dde64dc47c9a4d9a6af002f564274ea.zip
bootable_recovery-cacf65446dde64dc47c9a4d9a6af002f564274ea.tar.gz
bootable_recovery-cacf65446dde64dc47c9a4d9a6af002f564274ea.tar.bz2
updater: Add LZMA support to blockimg
* This adds support for LZMA compressed blockimages. The space savings from doing this is significant and will reduce our CDN costs by quite a bit. * I'll spend the saved $$$ on beer. Change-Id: I6679220aaa29592fe6bbccd4136f0c239e45e2ae
Diffstat (limited to 'updater')
-rw-r--r--updater/Android.mk2
-rw-r--r--updater/blockimg.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index 6e224fb..470eb5d 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -41,7 +41,7 @@ endif
LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS)
LOCAL_STATIC_LIBRARIES += libapplypatch libedify libmtdutils libminzip libz
-LOCAL_STATIC_LIBRARIES += libmincrypt libbz
+LOCAL_STATIC_LIBRARIES += libmincrypt libbz libxz
LOCAL_STATIC_LIBRARIES += libcutils liblog libc
LOCAL_STATIC_LIBRARIES += libselinux
tune2fs_static_libraries := \
diff --git a/updater/blockimg.c b/updater/blockimg.c
index a93bfcb..be56fbd 100644
--- a/updater/blockimg.c
+++ b/updater/blockimg.c
@@ -341,7 +341,12 @@ static bool receive_new_data(const unsigned char* data, int size, void* cookie)
static void* unzip_new_data(void* cookie) {
NewThreadInfo* nti = (NewThreadInfo*) cookie;
- mzProcessZipEntryContents(nti->za, nti->entry, receive_new_data, nti);
+ if (strncmp(".xz", nti->entry->fileName + (nti->entry->fileNameLen - 3), 3) == 0) {
+ mzProcessZipEntryContentsXZ(nti->za, nti->entry, receive_new_data, nti);
+ } else {
+ mzProcessZipEntryContents(nti->za, nti->entry, receive_new_data, nti);
+ }
+
return NULL;
}