Commit graph

1985 commits

Author SHA1 Message Date
Tao Bao
5af4b1901d Clean up verifier testcases.
A Certificate is a pair of an RSAPublicKey and a particular hash. So v1
and v3 differ in the hash algorithm (SHA-1 vs SHA-256), similarly for
v2 and v4.

In verifier testcases, we used to load v1/v2 keys with an explicit
argument of "sha256" to test the v3/v4 keys. This CL switches to loading
v3/v4 keys directly and lets load_keys() to handle that, which is the
actual flow we use in practice.

Also remove the "fallback to v1 key" in the testcases, which is not the
actual behavior.

Bug: 30415901
Test: Run the verifier_test component test on device.

Change-Id: I3a2baa64826f1b6c4c367a560090df384c4521bb
2016-08-01 11:32:28 -07:00
Tianjie Xu
5aa2e104c0 Merge "Add docs on regeneration background text image" 2016-07-28 23:52:44 +00:00
Tianjie Xu
9a259772cc Add docs on regeneration background text image
Also add a missing string in the recovery_l10n APP.

Bug: 30415666
Change-Id: Ice2a9f7cad4ebe332b427bc0c7a9adccb6cf3af3
2016-07-28 23:45:45 +00:00
Tianjie Xu
7b6263960f Merge "Regenerate the background text with pngcrush" 2016-07-28 22:09:01 +00:00
Tianjie Xu
489c7780a8 Regenerate the background text with pngcrush
After process the text images with pngquant, I encountered a
image-loading error when doing graphic tests on angler. The command
"pngcrush -c 0 $imagename" resolves this error and gives almost the
same compression rate. So regenerate all the text images with "pngcrush
-c 0"

Bug: 30415666
Test: Run graphics test on angler and the background text looks good.
Change-Id: I5d989c1230e826407287265fc559349a7bd29303
2016-07-28 15:06:49 -07:00
Tianjie Xu
286848e754 Merge "Update background text images under recovery" 2016-07-28 01:44:59 +00:00
Tianjie Xu
b7394cdd34 Update background text images under recovery
Update the text images according to the new translations of
"b+sr+Latn", "be-rBY", and "bs-rBA". Also switch to pngquant
which gives a better compression rate.

Bug: 30415666
Change-Id: I6eae5dd7be4c7f1f93c50113822caac9868e0f95
2016-07-28 01:41:55 +00:00
Chih-hung Hsieh
2a3b695168 Merge "Fix clang-tidy performance warnings." 2016-07-27 20:40:39 +00:00
Chih-Hung Hsieh
23abfd37a5 Fix clang-tidy performance warnings.
* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.

Bug: 30407689
Bug: 30411878
Change-Id: Iefab05c077367f272abf545036b853e8a295c8cd
Test: build with WITH_TIDY=1
2016-07-27 10:19:47 -07:00
Treehugger Robot
a82ee456bb Merge "Fix install.h's use of attribute printf." 2016-06-30 18:04:38 +00:00
Elliott Hughes
83ce755518 Fix install.h's use of attribute printf.
And move off the bionic __nonnull macro, which I'm removing.

Change-Id: I40b4424f4fd7bd8076e0eee3ec35de36c3ded8de
2016-06-30 09:28:42 -07:00
Treehugger Robot
a9f648f010 Merge "Fix google-explicit-constructor warnings in bootable/recovery." 2016-06-29 23:06:33 +00:00
Chih-Hung Hsieh
c27098d467 Fix google-explicit-constructor warnings in bootable/recovery.
Bug: 28341362
Change-Id: I4c3ab0ad0f62f8f3a6f3b30771010533a2739381
Test: build with clang-tidy
2016-06-29 15:01:19 -07:00
Treehugger Robot
a49c8a19da Merge "Minor minadbd cleanup." 2016-06-17 04:02:39 +00:00
Elliott Hughes
24eb8a0643 Minor minadbd cleanup.
Distinguish our "services.cpp" more clearly from the regular adbd
"services.cpp", and remove a few useless includes of "sysdeps.h".

Change-Id: Ided4945a3ac5916133322ca7e95fa51add9abaa4
2016-06-16 19:57:20 -07:00
Treehugger Robot
37450d7f42 Merge "Remove an abused global so we can actually see logging." 2016-06-15 23:10:32 +00:00
Elliott Hughes
279876c932 Merge "init now uses libprocessgroup, so set up /acct." 2016-06-15 23:09:19 +00:00
Elliott Hughes
48ebb07211 init now uses libprocessgroup, so set up /acct.
Change-Id: Iec1492dfaf2ceae6f4d8618dd725d07316ee960b
2016-06-15 15:15:15 -07:00
Elliott Hughes
59bf0da22f Remove an abused global so we can actually see logging.
Change-Id: Ib97440bc0542003b84c45cb05f194ba20104dad6
2016-06-15 15:14:04 -07:00
Elliott Hughes
179c0d80bc Merge "Remove obsolete MTD support." 2016-06-15 21:55:15 +00:00
Tao Bao
59f04b9982 Merge "Add bootloader_message_ab struct." 2016-06-14 16:09:16 +00:00
Tao Bao
4ddd5edf31 Merge "updater: Fix the broken ReadFileFn." 2016-06-11 18:42:53 +00:00
Tao Bao
efacd80364 updater: Fix the broken ReadFileFn.
Was accidentally broken by the CL in [1].

[1]: commit d6c93afcc2

Change-Id: I851e13ccea6f5be6fcd47f712cc95867245f9934
2016-06-11 03:59:56 -07:00
Elliott Hughes
63a319201f Remove obsolete MTD support.
Bug: http://b/29250988
Change-Id: Ia97ba9082a165c37f74d6e1c3f71a367adc59945
2016-06-10 13:45:35 -07:00
Elliott Hughes
5b2191a9d6 Merge "Remove etc/META-INF/com/google/android/update-script." 2016-06-10 16:20:42 +00:00
Tao Bao
9fb2b592e2 Add bootloader_message_ab struct.
Move A/B-specific fields, effectively slot_suffix as in this CL, out of
bootloader_message struct. Those A/B-specific fields are expected to be
managed by the A/B-bootloader or boot control HAL, which shouldn't be
cleared by recovery or uncrypt.

Round up the bootloader_message struct to 2-KiB. Round up the
bootloader_message_ab struct to 4-KiB.

Bug: 29193360
Change-Id: I5740a612456da6d4d3b00e49a202d8f689d32690
2016-06-09 21:46:13 -07:00
Elliott Hughes
ad29b10c00 Remove etc/META-INF/com/google/android/update-script.
Bug: http://b/29250988
Change-Id: I61f8c6717b38de2242e4ea8e0913237c1ce5bfea
2016-06-09 18:03:05 -07:00
Tao Bao
0ab866b354 Merge "recovery: Add support to brick a device." 2016-06-03 21:35:06 +00:00
Tao Bao
862a4c1119 recovery: Add support to brick a device.
When recovery starts with --brick, it tries to brick the device by
securely wiping all the partitions as listed in /etc/recovery.brick.

This is designed to support bricking lost devices.

Bug: 27253717
Change-Id: Ib0bd4f0a3bdaca4febc91fce6b682e3ec74354e2
2016-06-03 11:01:41 -07:00
Tao Bao
c96c9881a6 Merge "Revert "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector."" 2016-06-01 21:32:15 +00:00
Tao Bao
a0c4011028 Revert "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector."
This reverts commit 50a6f8c833.

A mix of new and free leads to memory corruptions.
2016-06-01 13:15:44 -07:00
Treehugger Robot
a8850710e5 Merge "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector." 2016-06-01 18:24:15 +00:00
Adam Buchbinder
50a6f8c833 Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector.
This fixes the following cppcheck reports:
[imgdiff.cpp:197]: (error) Memory leak: img
[imgdiff.cpp:386]: (error) Memory leak: img
[imgdiff.cpp:656]: (error) Memory leak: data
[imgdiff.cpp:664]: (error) Memory leak: data
[imgdiff.cpp:668]: (error) Memory leak: data
[imgdiff.cpp:668]: (error) Resource leak: f
[imgdiff.cpp:820]: (error) Memory leak: bonus_data
[imgdiff.cpp:824]: (error) Memory leak: bonus_data
[imgdiff.cpp:824]: (error) Resource leak: f
[imgdiff.cpp:847]: (error) Memory leak: bonus_data
[imgdiff.cpp:851]: (error) Memory leak: bonus_data
[imgdiff.cpp:856]: (error) Memory leak: bonus_data
[imgdiff.cpp:860]: (error) Memory leak: bonus_data
[imgdiff.cpp:227]: (error) Memory leak: temp_entries

Change-Id: I06f878d0b677a25328e0deb84f65f3b7212e24b1
(cherry picked from commit 51dc9444bc)
2016-06-01 10:28:45 -07:00
Tao Bao
59203510eb Merge "Revert "imgdiff: Generate statically linked imgdiff."" 2016-06-01 00:09:19 +00:00
Tao Bao
16e3861c84 Revert "imgdiff: Generate statically linked imgdiff."
This reverts commit b4422bd769.

Bug: 28941046
Change-Id: Ic3c7439c64b8e55832252850514f721a944993d6
2016-06-01 00:08:40 +00:00
Tao Bao
680d783ecc Merge "imgdiff: Generate statically linked imgdiff." 2016-05-31 22:42:13 +00:00
Tao Bao
b4422bd769 imgdiff: Generate statically linked imgdiff.
Bug: 28941046
Change-Id: If3019d8cff91fd4f6fa4516bef5a0f51c2ddebc7
2016-05-30 21:53:11 -07:00
Treehugger Robot
3788001b2c Merge "slot_metadata: add verity_corrupted field" 2016-05-23 21:10:16 +00:00
Jeremy Compostella
e77a68f67f slot_metadata: add verity_corrupted field
In rootfs context, the verity mode must be supplied by the bootloader
to the kernel.  This patch creates a new verity_corrupted field in the
slot metadata structure to remind that this slot is corrupted from a
dm-verity point of view.

If the bootloader receives the "dm-verity device corrupted" reboot
target, it should set this bit to 1.  If this bit value is 1, the
bootloader should set the veritymode to "eio".

Change-Id: I9335a39d7d009200318c58c53a3139d542788a9b
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2016-05-23 13:10:23 +02:00
Treehugger Robot
14352497f0 Merge "Keep ADF device alive for the lifetime of the minui backend" 2016-05-12 17:24:24 +00:00
Tao Bao
c7d7eb2225 Merge "updater, minzip: Remove unnecessary O_SYNC flags." 2016-05-08 17:58:19 +00:00
Alistair Strachan
733285fea2 updater, minzip: Remove unnecessary O_SYNC flags.
Remove O_SYNC from mzExtractRecursive() and PackageExtractFileFn().
These functions deal with extracting whole files from the update
package onto a filesystem. If run on ext4 on a rotating disk, for
example, the O_SYNC flag will cause serious performance problems
and the extraction proecss can take over 30 minutes, with no
obvious benefits.

This API function already calls fsync(fd) after each file is
extracted to ensure data and metadata is written to the underlying
block device, so the O_SYNC calls should be superfluous and safely
removable.

This change does not affect the OTA patch paths or any modification
of the bootloader partition or writes to other 'emmc' partitions.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
Change-Id: I9cbb98a98e6278bf5c0d7efaae340773d1fbfcd2
2016-05-05 16:04:58 -07:00
Treehugger Robot
704cac2f99 Merge "applypatch: Use bsdiff from external/bsdiff." 2016-05-05 22:35:43 +00:00
Jonathan Hamilton
bab6e492ef Keep ADF device alive for the lifetime of the minui backend
Some ADF drivers do some amount of state cleanup when the ADF device
node is closed, making and attempts to draw using it fail.

This changes the minui ADF backend to keep the adf_device open until it
is exited, fixing issues on such devices.
2016-05-05 15:30:57 -07:00
Sen Jiang
2fffcb174b applypatch: Use bsdiff from external/bsdiff.
external/bsdiff uses divsufsort which is much faster, and also include
some bug fixes.

Bug: 26982501
Test: ./imgdiff_test.sh

Change-Id: I089a301c291ee55d79938c7a3ca6d509895440d1
2016-05-03 16:39:51 -07:00
Treehugger Robot
ecd6e2af50 Merge "recovery: Always log the update attempt." 2016-05-03 05:40:23 +00:00
Tao Bao
37c45027bb recovery: Always log the update attempt.
An OTA may be skipped due to low battery. But we should always log it to
understand why an update _fails_ to apply.

Bug: 27893175
Change-Id: I50a3fbbb3e51035e0ac5f1cca150e283852825c3
(cherry picked from commit 5687001895)
2016-05-02 21:27:43 -07:00
Chih-hung Hsieh
fafa6a6531 Merge "Fix google-explicit-constructor warnings." 2016-04-29 22:26:41 +00:00
Chih-Hung Hsieh
49c5c79df1 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I5b35ae16c069e7e9229e66963386f322bd808af1
2016-04-29 14:16:35 -07:00
Tao Bao
df59ceecfb Merge "updater: Don't zero out CommandParameters with memset(3)." 2016-04-28 04:28:19 +00:00