summaryrefslogtreecommitdiffstats
path: root/updater/updater.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2014-01-13 23:16:58 +0100
committerDoug Zongker <dougz@android.com>2014-01-16 22:29:28 +0100
commit99916f0496cfe37891d40f21a9a0e387620a8a60 (patch)
tree6b457a65cfdf482fec027386fcd7d197586c67b2 /updater/updater.c
parentam a01b6467: am 772f6e2a: Merge "correctly mount tmpfs as /tmp in recovery" (diff)
downloadandroid_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.gz
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.bz2
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.lz
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.xz
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.zst
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.zip
Diffstat (limited to '')
-rw-r--r--updater/updater.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/updater/updater.c b/updater/updater.c
index c7009feac..4e1cc9c38 100644
--- a/updater/updater.c
+++ b/updater/updater.c
@@ -22,6 +22,7 @@
#include "updater.h"
#include "install.h"
#include "minzip/Zip.h"
+#include "minzip/SysUtil.h"
// Generated by the makefile, this function defines the
// RegisterDeviceExtensions() function, which calls all the
@@ -65,19 +66,24 @@ int main(int argc, char** argv) {
// Extract the script from the package.
- char* package_data = argv[3];
+ const char* package_filename = argv[3];
+ MemMapping map;
+ if (sysMapFile(package_filename, &map) != 0) {
+ printf("failed to map package %s\n", argv[3]);
+ return 3;
+ }
ZipArchive za;
int err;
- err = mzOpenZipArchive(package_data, &za);
+ err = mzOpenZipArchive(map.addr, map.length, &za);
if (err != 0) {
printf("failed to open package %s: %s\n",
- package_data, strerror(err));
+ argv[3], strerror(err));
return 3;
}
const ZipEntry* script_entry = mzFindZipEntry(&za, SCRIPT_NAME);
if (script_entry == NULL) {
- printf("failed to find %s in %s\n", SCRIPT_NAME, package_data);
+ printf("failed to find %s in %s\n", SCRIPT_NAME, package_filename);
return 4;
}
@@ -152,6 +158,7 @@ int main(int argc, char** argv) {
if (updater_info.package_zip) {
mzCloseZipArchive(updater_info.package_zip);
}
+ sysReleaseMap(&map);
free(script);
return 0;