Commit graph

124 commits

Author SHA1 Message Date
Tianjie Xu
99adda9d67 Merge "Cleanup the duplicates of logs rotation functions"
am: e2d05c5658

Change-Id: Ia63785d846ab05eca45ec1e548f7265d7feffdbb
2016-11-04 18:14:01 +00:00
Tianjie Xu
e113e4d67f Cleanup the duplicates of logs rotation functions
Bug: 32067516
Test: Logs rotated successfully on angler, recovery-refresh/persist tests
passed on an a/b device.

Change-Id: Ie80adf0fa958ad3d7869d2d17f49489666b86c29
2016-11-03 18:16:33 -07:00
Tianjie Xu
8176cf232e resolve merge conflicts of 6fba98c to stage-aosp-master
Change-Id: I2fa8b85109309ec88c1f8d8def593aa65ab885d7
2016-10-18 21:31:04 +00:00
Yabin Cui
8b309f6970 Create bootloader_message static library.
bootloader_messages merges bootloader_message_writer
and bootloader.cpp, so we can use the same library to
manage bootloader_message in normal boot and recovery mode.

Bug: 29582118

Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618
(cherry picked from commit 2f272c0551)
2016-10-18 11:37:05 -07:00
Tianjie Xu
8cf5c8f60f Replace minzip with libziparchive
Clean up the duplicated codes that handle the zip files in
bootable/recovery; and rename the library of the remaining
utility functions to libotautil.

Test: Update package installed successfully on angler.
Bug: 19472796

Change-Id: Iea8962fcf3004473cb0322b6bb3a9ea3ca7f679e
2016-10-17 17:41:51 -07:00
Tao Bao
c26e3770f6 Merge "Update the header path for ext4_utils." am: 2bd94433f8 am: 00a9050815
am: 514dc15399

Change-Id: I38332f7eab24a49375ef0f410a3cd3d552749e06
2016-10-10 22:14:43 +00:00
Tao Bao
de40ba59c8 Update the header path for ext4_utils.
Test: `mmma bootable/recovery`
Change-Id: I70ccddb3ddf46bb012fdc5f632afc46ebdd5473e
2016-10-09 14:02:10 -07:00
Elliott Hughes
b0c3f6ffeb Disable the meaningless parts of the UI for A/B.
Bug: http://b/28748484
Test: mmma bootable/recovery
Change-Id: Ie86a265f4699503471e7c717d65677a916dbd25b
(cherry picked from commit 01fcbe160b)
2016-10-09 12:55:50 -07:00
Tianjie Xu
17e316cce0 Turn on -Werror for recovery
Also remove the 0xff comparison when validating the bootloader
message fields. As the fields won't be erased to 0xff after we
remove the MTD support.

Bug: 28202046
Test: The recovery folder compiles for aosp_x86-eng
Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
(cherry picked from commit 7aa88748f6)
2016-09-30 11:18:01 -07:00
Tianjie Xu
7aa88748f6 Turn on -Werror for recovery
Also remove the 0xff comparison when validating the bootloader
message fields. As the fields won't be erased to 0xff after we
remove the MTD support.

Bug: 28202046
Test: The recovery folder compiles for aosp_x86-eng
Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
2016-09-29 19:21:24 -07:00
Tianjie Xu
c21edd4654 Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
(cherry picked from commit 747781433f)
2016-09-01 14:32:55 -07:00
Tianjie Xu
7b0ad9c638 Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-09-01 18:33:25 +00:00
Josh Gao
66571856a1 Merge "Fix references to libcrypto_utils_static." am: b97da5e0f0 am: dc97404346
am: e6a4195bf7

Change-Id: Ib497de2a8e38d60cf6be058de919bd8f5e5871cb
2016-08-08 18:39:20 +00:00
Josh Gao
dc97404346 Merge "Fix references to libcrypto_utils_static."
am: b97da5e0f0

Change-Id: Ia935df84e5ea36dfc6605b41872c36db69a114a0
2016-08-08 18:33:51 +00:00
Josh Gao
073164f24b Fix references to libcrypto_utils_static.
Bug: http://b/30708454
Change-Id: I7a5048beff1d8b783a9683dcb4a79606a77f20ee
2016-08-05 18:08:03 -07:00
Yabin Cui
9b15ba8269 resolve merge conflicts of 2f272c0 to nyc-mr1-dev-plus-aosp
Change-Id: I889d94a723415ad2e660b8c99e66935142918bc4
2016-06-30 15:13:12 -07:00
Yabin Cui
2f272c0551 Create bootloader_message static library.
bootloader_messages merges bootloader_message_writer
and bootloader.cpp, so we can use the same library to
manage bootloader_message in normal boot and recovery mode.

Bug: 29582118

Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618
2016-06-30 11:02:38 -07:00
Elliott Hughes
b36980cc09 resolve merge conflicts of 179c0d8 to stage-aosp-master am: 274d17dc0f
am: eaddde6888

Change-Id: I10d484d02389fa30cc8d8398bcf5b276de31432e
2016-06-15 22:33:02 +00:00
Elliott Hughes
274d17dc0f resolve merge conflicts of 179c0d8 to stage-aosp-master
Change-Id: Iba5aec266444cabf83f600f2bdb45a3c027e5995
2016-06-15 15:22:17 -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
994bacf549 Disable the meaningless parts of the UI for A/B.
am: 01fcbe160b

* commit '01fcbe160bd49891c0680b80c5688cd4feb2adbc':
  Disable the meaningless parts of the UI for A/B.

Change-Id: I86466cac3623b62db07bf48a38428be715ac3d3a
2016-05-24 17:12:58 +00:00
Elliott Hughes
01fcbe160b Disable the meaningless parts of the UI for A/B.
Bug: http://b/28748484
Change-Id: Ie86a265f4699503471e7c717d65677a916dbd25b
2016-05-24 00:44:50 +00:00
Elliott Hughes
8febafa67e Use BoringSSL instead of mincrypt to speed up package verification.
This changes the verification code in bootable/recovery to use
BoringSSL instead of mincrypt.

Cherry-pick of 452df6d99c, with
merge conflict resolution, extra logging in verifier.cpp, and
an increase in the hash chunk size from 4KiB to 1MiB.

Bug: http://b/28135231
Change-Id: I1ed7efd52223dd6f6a4629cad187cbc383d5aa84
2016-04-13 16:39:56 -07:00
Elliott Hughes
6e2a8b11ec resolve merge conflicts of 2bf95ac to nyc-dev-plus-aosp
Change-Id: Iaf232fbe65879bad6e19c7a9600aa6303a491a67
2016-04-12 17:15:40 -07:00
Mattias Nissler
452df6d99c Convert recovery to use BoringSSL instead of mincrypt.
This changes the verification code in bootable/recovery to use
BoringSSL instead of mincrypt.

Change-Id: I37b37d84b22e81c32ac180cd1240c02150ddf3a7
2016-04-06 15:54:17 +02:00
Mark Salyzyn
9b9e5843d2 Merge "recovery: use __android_log_pmsg_file_write for log files" am: 75da771
am: 6f83130

* commit '6f83130d7acd85df89a80e691d3aa63bd2ceda39':
  recovery: use __android_log_pmsg_file_write for log files

Change-Id: Id2e7a76bae8eb061f6f57249dd912f25cd6332c6
2016-03-31 21:00:59 +00:00
Mark Salyzyn
13aca598f8 recovery: use __android_log_pmsg_file_write for log files
(cherry-pick from commit a4f701af93)

- Add call to __android_log_pmsg_file_write for recovery logging.
- Add call to refresh pmsg if we reboot back into recovery and then
  allow overwrite of those logs.
- Add a new one-time executable recovery-refresh that refreshes pmsg
  in post-fs phase of init. We rely on pmsg eventually scrolling off
  to age the content after recovery-persist has done its job.
- Add a new one-time executable recovery-persist that transfers from
  pmsg to /data/misc/recovery/ directory if /cache is not mounted
  in post-fs-data phase of init.
- Build and appropriately trigger the above two as required if
  BOARD_CACHEIMAGE_PARTITION_SIZE is undefined.
- Add some simple unit tests

NB: Test failure is expected on systems that do not deliver either
the recovery-persist or recovery-refresh executables, e.g. systems
with /cache. Tests also require a timely reboot sequence of test
to truly verify, tests provide guidance on stderr to direct.

Bug: 27176738
Change-Id: I17bb95980234984f6b2087fd5941b0a3126b706b
2016-03-31 13:52:54 -07:00
Mark Salyzyn
a4f701af93 recovery: use __android_log_pmsg_file_write for log files
- Add call to __android_log_pmsg_file_write for recovery logging.
- Add call to refresh pmsg if we reboot back into recovery and then
  allow overwrite of those logs.
- Add a new one-time executable recovery-refresh that refreshes pmsg
  in post-fs phase of init. We rely on pmsg eventually scrolling off
  to age the content after recovery-persist has done its job.
- Add a new one-time executable recovery-persist that transfers from
  pmsg to /data/misc/recovery/ directory if /cache is not mounted
  in post-fs-data phase of init.
- Build and appropriately trigger the above two as required if
  BOARD_CACHEIMAGE_PARTITION_SIZE is undefined.
- Add some simple unit tests

NB: Test failure is expected on systems that do not deliver either
the recovery-persist or recovery-refresh executables, e.g. systems
with /cache. Tests also require a timely reboot sequence of test
to truly verify, tests provide guidance on stderr to direct.

Bug: 27176738
Change-Id: I17bb95980234984f6b2087fd5941b0a3126b706b
2016-03-28 11:07:00 -07:00
Prashant Malani
1500f11e81 recovery: Move SwipeDetector into common location
am: 9020e0f

* commit '9020e0f141d1c26dcf8b6fa4212ee94b7891d53f':
  recovery: Move SwipeDetector into common location
2016-03-18 17:01:44 +00:00
Prashant Malani
9020e0f141 recovery: Move SwipeDetector into common location
The SwipeDetector class is used almost unchanged in all locations.

This patch moves it into the recovery module, from which devices can
reference it if required.

The class is now renamed to WearSwipeDetector.

Bug: 27407422
Change-Id: Ifd3c7069a287548b89b14ab5d6d2b90a298e0145
2016-03-18 06:03:21 +00:00
Tao Bao
d80a99883d Fix the improper use of LOCAL_WHOLE_STATIC_LIBRARIES.
If two libraries both use LOCAL_WHOLE_STATIC_LIBRARIES and include a same
library, there would be linking errors when generating a shared library
(or executable) that depends on the two libraries both.

Also clean up Android.mk files.

Remove the "LOCAL_MODULE_TAGS := eng" line for the updater module. The
module will then default to "optional" which won't be built until needed.

Change-Id: I3ec227109b8aa744b7568e7f82f575aae3fe0e6f
2016-03-03 14:52:44 -08:00
Yabin Cui
99281df8e2 recovery: check battery level before installing package.
Bug: 26879394

Change-Id: I63dce5bc50c2e104129f1bcab7d3cad5682bf45d
(cherry picked from commit 53e7a0628f)
2016-02-23 11:03:10 -08:00
Yabin Cui
53e7a0628f recovery: check battery level before installing package.
Bug: 26879394

Change-Id: I63dce5bc50c2e104129f1bcab7d3cad5682bf45d
2016-02-19 18:08:09 -08:00
Jed Estep
a7b9a4660c IO fault injection for OTA packages
Bug: 25951086
Change-Id: I31c74c735eb7a975b7f41fe2b2eff042e5699c0c
(cherry-picked from commit f1fc48c6e6)
2016-02-10 10:49:38 -08:00
Tao Bao
e284cd58c8 Merge "Refactor existing tests to use gtest" am: 38b02cc6a0
am: 9865c55254

* commit '9865c55254a1583e18a7e8ac502f2c2143ed8b82':
  Refactor existing tests to use gtest
2016-02-05 18:47:14 +00:00
Jed Estep
432918603f Refactor existing tests to use gtest
Bug: 26962907
Change-Id: I5f80636af1740badeff7d08193f08e23f4e4fee1
2016-02-04 10:11:30 -08:00
Jed Estep
f1fc48c6e6 IO fault injection for OTA packages
Bug: 25951086
Change-Id: I31c74c735eb7a975b7f41fe2b2eff042e5699c0c
2016-01-06 12:23:42 -08:00
Tao Bao
7197ee0e39 Add update_verifier for A/B OTA update.
update_verifier checks the integrity of the updated system and vendor
partitions on the first boot post an A/B OTA update. It marks the
current slot as having booted successfully if it passes the verification.

This CL doesn't perform any actual verification work which will be
addressed in follow-up CLs.

Bug: 26039641
Change-Id: Ia5504ed25b799b48b5886c2fc68073a360127f42
(cherry picked from commit 1171d3a12b)
2015-12-08 11:24:11 -08:00
Tao Bao
6bc2155d22 Add update_verifier for A/B OTA update.
am: 1171d3a12b

* commit '1171d3a12b13ca3f1d4301985cf068076e55ae26':
  Add update_verifier for A/B OTA update.
2015-12-08 00:22:07 +00:00
Tao Bao
1171d3a12b Add update_verifier for A/B OTA update.
update_verifier checks the integrity of the updated system and vendor
partitions on the first boot post an A/B OTA update. It marks the
current slot as having booted successfully if it passes the verification.

This CL doesn't perform any actual verification work which will be
addressed in follow-up CLs.

Bug: 26039641
Change-Id: Ia5504ed25b799b48b5886c2fc68073a360127f42
2015-12-07 10:25:02 -08:00
Dan Albert
56deefba73 Stop using libstdc++.
These are already getting libc++, so it isn't necessary. If any of the
other static libraries (such as adb) use new or delete from libc++,
there will be symbol collisions.

Change-Id: I55e43ec60006d3c2403122fa1174bde06f18e09f
(cherry picked from commit e49a9e527a)
2015-11-16 14:28:40 -08:00
Tao Bao
7101b2e285 recovery: Switch to clang
And a few trival fixes to suppress warnings.

Change-Id: Id28e3581aaca4bda59826afa80c0c1cdfb0442fc
(cherry picked from commit 80e46e08de)
2015-11-16 14:28:40 -08:00
Tao Bao
4ea2b0c4ac Merge "recovery: Depend on mkfs.f2fs only if needed."
am: a412198699

* commit 'a4121986990d7dde7918252a96d87e4c3c11c13c':
  recovery: Depend on mkfs.f2fs only if needed.
2015-10-28 16:36:23 +00:00
Tao Bao
f68351209f recovery: Depend on mkfs.f2fs only if needed.
Don't build mkfs.f2fs unless device defines TARGET_USERIMAGES_USE_F2FS.

Change-Id: Ifac592c30315bbe7590c8fbf3a0844e6a7a31a1a
2015-10-27 22:00:35 -07:00
Tao Bao
ba781587cb am 337db14f: recovery: Factor out wear_ui.{cpp,h} into bootable/recovery.
* commit '337db14f274fc73dd540aa71d2c21c431fe686ec':
  recovery: Factor out wear_ui.{cpp,h} into bootable/recovery.
2015-08-25 01:23:18 +00:00
Tao Bao
337db14f27 recovery: Factor out wear_ui.{cpp,h} into bootable/recovery.
Every watch has a (mostly identical) copy of the wear_ui. Factor them
out into a single copy for easier maintenance. Device-specific settings
should be defined in recovery_ui.cpp that inherits WearRecoveryUI class.

Bug: 22451422
Change-Id: Id07efca37d1b1d330e6327506c7b73ccf6ae9241
2015-08-24 17:31:47 -07:00
Tao Bao
0d4e002670 recovery: Switch fuse_* to C++.
Change-Id: Id50c3e6febd0ab61f10a654b9b265cf21a2d1701
(cherry picked from commit 71dc365f25)
2015-07-24 11:22:05 -07:00
Tao Bao
71dc365f25 recovery: Switch fuse_* to C++.
Change-Id: I68770ad1a9e99caee292f8010cfd37dfea3acc64
2015-07-20 11:57:40 -07:00
Tao Bao
80e46e08de recovery: Switch to clang
And a few trival fixes to suppress warnings.

Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
2015-06-03 11:30:03 -07:00
Dan Albert
e49a9e527a Stop using libstdc++.
These are already getting libc++, so it isn't necessary. If any of the
other static libraries (such as adb) use new or delete from libc++,
there will be symbol collisions.

Change-Id: I55e43ec60006d3c2403122fa1174bde06f18e09f
2015-05-19 11:33:18 -07:00