aboutsummaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.c
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2012-11-24 16:50:10 -0800
committerKoushik Dutta <koushd@gmail.com>2012-11-24 17:01:08 -0800
commiteaee7190f5ab851a76cd59e899dce253297cbb31 (patch)
treef2a2551ed2c38e45fb0bcd838c304a489bd6f225 /applypatch/applypatch.c
parent53e139f8b3b982f130d387a6261a1613435d6f40 (diff)
downloadbootable_recovery-eaee7190f5ab851a76cd59e899dce253297cbb31.zip
bootable_recovery-eaee7190f5ab851a76cd59e899dce253297cbb31.tar.gz
bootable_recovery-eaee7190f5ab851a76cd59e899dce253297cbb31.tar.bz2
Pull in android 4.2 updater bits willy nilly. Next commit will fix.
Change-Id: Id2616d1fead045688a5acf13b3420016322f664b
Diffstat (limited to 'applypatch/applypatch.c')
-rw-r--r--applypatch/applypatch.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 488fd8c..7b8a010 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -39,7 +39,8 @@ static int GenerateTarget(FileContents* source_file,
const char* source_filename,
const char* target_filename,
const uint8_t target_sha1[SHA_DIGEST_SIZE],
- size_t target_size);
+ size_t target_size,
+ const Value* bonus_data);
static int mtd_partitions_scanned = 0;
@@ -617,7 +618,8 @@ int applypatch(const char* source_filename,
size_t target_size,
int num_patches,
char** const patch_sha1_str,
- Value** patch_data) {
+ Value** patch_data,
+ Value* bonus_data) {
printf("\napplying patch to %s\n", source_filename);
if (target_filename[0] == '-' &&
@@ -699,7 +701,7 @@ int applypatch(const char* source_filename,
int result = GenerateTarget(&source_file, source_patch_value,
&copy_file, copy_patch_value,
source_filename, target_filename,
- target_sha1, target_size);
+ target_sha1, target_size, bonus_data);
free(source_file.data);
free(copy_file.data);
@@ -713,7 +715,8 @@ static int GenerateTarget(FileContents* source_file,
const char* source_filename,
const char* target_filename,
const uint8_t target_sha1[SHA_DIGEST_SIZE],
- size_t target_size) {
+ size_t target_size,
+ const Value* bonus_data) {
int retry = 1;
SHA_CTX ctx;
int output;
@@ -867,7 +870,7 @@ static int GenerateTarget(FileContents* source_file,
} else if (header_bytes_read >= 8 &&
memcmp(header, "IMGDIFF2", 8) == 0) {
result = ApplyImagePatch(source_to_use->data, source_to_use->size,
- patch, sink, token, &ctx);
+ patch, sink, token, &ctx, bonus_data);
} else {
printf("Unknown patch file format\n");
return 1;