Commit Graph

2937 Commits

Author SHA1 Message Date
Tao Bao 9e4ba70b7f Merge "applypatch: Clean up LoadPartitionContents()."
am: c6ee8cf8df

Change-Id: I2c20eb8b2c8f5bba40e71f6b267152f3bfab0316
2016-11-17 20:14:40 +00:00
Tao Bao c6ee8cf8df Merge "applypatch: Clean up LoadPartitionContents()." 2016-11-17 20:06:57 +00:00
Connor O'Brien b9d1cd7713 Merge "Convert update_verifier to boot HIDL HAL"
am: 5b171d30ab  -s ours

Change-Id: I30f99aae371bf51c161c482e53c3032d321fb53a
2016-11-17 20:05:51 +00:00
Connor O'Brien 5b171d30ab Merge "Convert update_verifier to boot HIDL HAL" 2016-11-17 19:07:21 +00:00
Tao Bao 8fce75a069 applypatch: Clean up LoadPartitionContents().
We don't need three vectors to sort the (size, SHA-1) pairs.

Test: recovery_component_test passes.
Test: Apply a package that calls apply_patch_check() to patch EMMC
      partitions.
Change-Id: I4a6620630a6711f490822cf30f1e7fe5cea6ce49
2016-11-17 00:02:52 -08:00
Rahul Chaudhry 849a911dee Merge "Remove unnecessary uses of reinterpret_cast."
am: c470dc8681

Change-Id: I44081a387bfc60ce9f9cacf5b8db0b9248c84c4d
2016-11-16 21:37:25 +00:00
Treehugger Robot c470dc8681 Merge "Remove unnecessary uses of reinterpret_cast." 2016-11-16 21:27:32 +00:00
Connor O'Brien f50593c447 Convert update_verifier to boot HIDL HAL
Test: Flashed device and confirmed update_verifier runs successfully
Change-Id: I5bce4ece1e3ba98f57299c9cf469a5e2a5226ff2
Merged-In: I5bce4ece1e3ba98f57299c9cf469a5e2a5226ff2
Signed-off-by: Connor O'Brien <connoro@google.com>
2016-11-16 11:07:24 -08:00
Tao Bao 0c15140dad Merge "Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap."
am: 0bedc8e14c

Change-Id: I5bd86a0ee1a87d75c99d2c9e88412f8c1fbd82d1
2016-11-16 18:17:37 +00:00
Tao Bao 0bedc8e14c Merge "Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap." 2016-11-16 18:10:54 +00:00
Rahul Chaudhry 1cf93f5f74 Remove unnecessary uses of reinterpret_cast.
Discovered while looking at compiler warnings (b/26936282).

Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma
Change-Id: I66f8f6026ed732a504504ade93ff196dc8b727ca
2016-11-15 23:25:57 -08:00
Rahul Chaudhry b29f23f7e7 Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.
static_cast is preferable to reinterpret_cast when casting from void*
pointers returned by malloc/calloc/realloc/mmap calls.

Discovered while looking at compiler warnings (b/26936282).

Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma
Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592
Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
2016-11-15 23:24:54 -08:00
Tao Bao f83101a911 resolve merge conflicts of 4f86f26 to stage-aosp-master
Change-Id: I3ee609df70c60e16a610913b2c95892c9d74cb3e
2016-11-15 23:13:24 -08:00
Tao Bao 38236d0f35 Merge changes from topic 'minui-cherrypick'
am: d6137a2ae0

Change-Id: Ieac34e2de3334f66b99e50b88e1d51adbb649603
2016-11-16 07:00:48 +00:00
Damien Bargiacchi c2f6ebf15b Have gr_init_font alloc memory for the font
am: 97eda9db70

Change-Id: Id4a82973e13383f450fe908776024e8329b930f2
2016-11-16 07:00:39 +00:00
Tao Bao 4f86f26a3d Merge "updater: Fix the wrong return value for package_extract_file()." 2016-11-16 06:54:08 +00:00
Tao Bao 03eb766a56 resolve merge conflicts of d5d34d7 to stage-aosp-master
Change-Id: I2871dafbd293dbbbb538da84fa857dd8972e2eb8
2016-11-15 22:14:14 -08:00
Tao Bao d6137a2ae0 Merge changes from topic 'minui-cherrypick'
* changes:
  Have gr_init_font alloc memory for the font
  Support use of custom fonts in miniui
2016-11-16 05:52:18 +00:00
Damien Bargiacchi 97eda9db70 Have gr_init_font alloc memory for the font
Change-Id: I8ccf369d52011bc5d07d8e041fe558ce734a78fc
(cherry picked from commit d00f5eb63a)
2016-11-15 16:40:32 -08:00
Damien Bargiacchi d5d34d70a5 Support use of custom fonts in miniui
Bug: 29547343
Change-Id: I398160c85daac90ffab2fa9bb2e96795b9e9885a
(cherry picked from commit 35fff61b1c)
2016-11-15 14:24:06 -08:00
Tao Bao ef0eb3b01b updater: Fix the wrong return value for package_extract_file().
'bool success = ExtractEntryToFile()' gives opposite result. Fix the
issue and add testcases.

Change the one-argument version of package_extract_file() to explicitly
abort for non-existent zip entry. Note that this is NOT changing the
behavior. Prior to this CL, it aborts from Evaluate() function, by
giving a general cause code. Now it returns kPackageExtractFileFailure.

BUg: 32903624
Test: recovery_component_test works.

Change-Id: I7a273e9c0d9aaaf8c472b2c778f7b8d90362c24f
2016-11-15 13:17:52 -08:00
Tao Bao 1f0af0c2ea Merge "Add .clang-format style file."
am: b76960c984

Change-Id: I38d670b4d2fb799e12e70f10d6cd7a0e3914369e
2016-11-14 18:28:32 +00:00
Tao Bao 08c4130493 Merge "Fix "ordered comparison between pointer and zero"."
am: a844bc9649

Change-Id: If12e825a23c17730a35a2875c14d1d25d9d41038
2016-11-14 18:28:18 +00:00
Tao Bao b76960c984 Merge "Add .clang-format style file." 2016-11-14 18:20:14 +00:00
Tao Bao a844bc9649 Merge "Fix "ordered comparison between pointer and zero"." 2016-11-14 18:18:39 +00:00
Tianjie Xu f2574b8206 Merge "Allow uncrypt to work without socket communication"
am: 4c1f3eda98

Change-Id: I8e86d4201d2fac0293e70df54e0816c96e85a9b7
2016-11-12 01:02:33 +00:00
Tianjie Xu 4c1f3eda98 Merge "Allow uncrypt to work without socket communication" 2016-11-12 00:49:16 +00:00
Tianjie Xu 7ceff3e003 Allow uncrypt to work without socket communication
It was inconvenient to uncrypt a update package under adb shell
because the uncrypt executable required a socket to start its job.
Add a workaround to allow uncrypt executes without socket
communication.

Test: run uncrypt under adb shell, and the block map generates successfully
Bug: 29906218

Change-Id: Ibc328b31636d925dc429ede8dcec7392a721dd53
(cherry picked from commit 28c1e5d3aa)
2016-11-11 13:51:15 -08:00
MinSeong Kim 126cf8cda8 Fix "ordered comparison between pointer and zero".
From Clang 4.x releases, DR583 and DR1512 will be addressed.
This patch, in advance, fixes the error(s).

Test: `mmma bootable/recovery`
Change-Id: I29dc85ae681307c322ab3a698c3f3bbad1c784ee
Signed-off-by: MinSeong Kim <minseong.kim@linaro.org>
2016-11-11 07:00:57 +00:00
Vineela Tummalapalli 118e814bfe Merge "Add 'reboot bootloader' to bootloader_message."
am: a5538b87e8

Change-Id: I432f48453d2627e165fda7cda1945157ff0e83ae
2016-11-10 02:52:18 +00:00
Treehugger Robot a5538b87e8 Merge "Add 'reboot bootloader' to bootloader_message." 2016-11-10 02:43:08 +00:00
Vineela Tummalapalli cba7fa88d8 Add 'reboot bootloader' to bootloader_message.
Add 'reboot bootloader' capability to the bootloader_message.

BUG: https://issuetracker.google.com/issues/32474515

Change-Id: I01e8b2fad978bf7c8fc96ff6b08ad3e52533f504
Author: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Reviewed-on: https://android.intel.com/548519
2016-11-09 17:24:57 -08:00
Tianjie Xu 96c3c32b66 Merge "Touch blocks in care_map in update_verifier"
am: 3605a072bc  -s ours

Change-Id: Ie19a8ebf3f575599a5ed9ddcd80ab99e06f6cf77
2016-11-10 00:11:40 +00:00
Tianjie Xu 3605a072bc Merge "Touch blocks in care_map in update_verifier" 2016-11-09 23:52:52 +00:00
Tianjie Xu d007cf2da2 Touch blocks in care_map in update_verifier
Read all blocks in system and vendor partition during boot time
so that dm-verity could verify this partition is properly flashed.

Bug: 27175949
Change-Id: I38ff7b18ee4f2733e639b89633d36f5ed551c989
Test: mma
(cherry picked from commit 03ca853a1c)
(cherry picked from commit 4bbe0c93c8)
(Fix a typo when comparing the verity mode)
(cherry picked from commit da654af606)
(Skip update verification if care_map is not found)
2016-11-09 20:10:27 +00:00
Tao Bao 2c175c302c Merge "updater: Add more testcase for symlink()."
am: 1b74e8cea8

Change-Id: I67f19e5992d755f08109ccad4feed2ac3f9dffde
2016-11-09 19:13:43 +00:00
Tao Bao 1b74e8cea8 Merge "updater: Add more testcase for symlink()." 2016-11-09 19:05:01 +00:00
Tao Bao b50fa1fc23 Merge "otautil: Clean up obsolete includes."
am: b80d136dca

Change-Id: I374d678fe6636284d6ab9238418266fac355e14e
2016-11-09 05:39:20 +00:00
Tao Bao b80d136dca Merge "otautil: Clean up obsolete includes." 2016-11-09 05:32:06 +00:00
Tao Bao 8992902aab updater: Add more testcase for symlink().
Clean up SymlinkFn() a bit. Also clean up the temp files created when
running the tests; otherwise non-empty TemporaryDir won't be removed.

Test: recovery_component_test passes.
Change-Id: Id3844abebd168c40125c4dcec54e6ef680a83c3a
2016-11-08 21:29:16 -08:00
Tao Bao 14b61e7b96 otautil: Clean up obsolete includes.
external/zlib and external/safe-iop/include were used by Zip.c, which
became obsolete after [1].

Removing
 - <assert.h>: we no longer call assert(3);
 - <limits.h>: we no longer use PATH_MAX;
 - <stdio.h>: we don't need FILE anymore;
 - <stdlib.h>: no more malloc(3)/calloc(3);
 - <unistd.h>: was once needed for lseek(2);
 - <string.h>: no more memset(3).

Adding
 - <stdint.h> for SIZE_MAX.

[1] commit 8cf5c8f60f: "Replace minzip
with libziparchive".

Test: `mmma bootable/recovery`
Change-Id: I349e909ba83d0f6ade5f92856ce3934f29fdca6c
2016-11-08 13:39:12 -08:00
Tianjie Xu 1fd9f0aff7 Merge "Make make_parent() to take const argument"
am: 52e2a97aa7

Change-Id: Ia4d597510cf99ade837a9c6a33b19788b8cf2291
2016-11-08 20:57:54 +00:00
Tianjie Xu e9390679c9 Merge "Move recovery_test.cpp out of unit test"
am: 8bfd96c0f8

Change-Id: I34ecca789d64dda77bec85d577ff0b7320a2b128
2016-11-08 20:57:42 +00:00
Treehugger Robot 52e2a97aa7 Merge "Make make_parent() to take const argument" 2016-11-08 20:53:59 +00:00
Treehugger Robot 8bfd96c0f8 Merge "Move recovery_test.cpp out of unit test" 2016-11-08 20:48:20 +00:00
Tao Bao 55883f660d resolve merge conflicts of 70172d7 to stage-aosp-master
Change-Id: I7626b57f9c8fd722708862ff1ae09c4fc0def51c
2016-11-08 10:49:47 -08:00
Tianjie Xu 5d8b53b248 Move recovery_test.cpp out of unit test
Move recovery-refresh/persist tests out because these tests need special
steps to run. Also switch the constants to std::string.

Test: recovery_manual_test passed on an A/B device
Change-Id: I60b3ec6f094044945c3aafc1fae540896a6ddea6
2016-11-08 10:42:51 -08:00
Tao Bao 70172d76ef Merge "otautil: Clean up SysUtil.cpp." 2016-11-08 18:29:37 +00:00
Tianjie Xu d75003d24c Make make_parent() to take const argument
Switch to use const std::string; and add corresponding tests.

Bug: 32649858
Test: Component tests pass
Change-Id: I640f3ec81f1481fa91aa310f8d4d96dac9649cb9
2016-11-08 10:11:03 -08:00
Tao Bao c3292f3fcb otautil: Clean up SysUtil.cpp.
Add unit testcases for sysMapFile().

Test: recovery_unit_test passes.
Test: Build and use the new recovery image to sideload a package.
Test: Build and use the new recovery image to install an update.

Change-Id: I77d8f1ea151ab513865d992c256ba93a1fcb51a4
2016-11-07 13:00:38 -08:00