Commit graph

256 commits

Author SHA1 Message Date
Tao Bao
20976a0913 Merge "recovery: Configure device menu based on runtime info." am: e498ef2f03
am: bd32e1b50b

Change-Id: Id611c10a6f84afdec38ca01d6932f4c964f9c2ac
2018-05-11 10:57:40 -07:00
Tao Bao
6a542dcc3b Move device.cpp into librecovery_ui.
librecovery_ui will be exposed for device-specific RecoveryUI. With the
current code structure, 'device.h' and 'ui.h' will always be needed in
order to implement device-specific RecoveryUI.

Bug: 76436783
Test: lunch aosp_{angler,marlin,dragon,walleye}-userdebug;
      `mmma -j bootable/recovery` respectively.
Change-Id: I15e8851b230a65526ac9310e0ee6621b7daea589
2018-05-11 10:51:26 -07:00
Tao Bao
e5d2c25ecf recovery: Configure device menu based on runtime info.
Drop the dependency on build time flag of AB_OTA_UPDATER when compiling
device.cpp. Note that AB_OTA_UPDATER still guards the package install
behavior (install.cpp).

This can be extended to cover the entry of "Apply update from SD card".

Test: Build and boot into recovery on angler and walleye respectively.
      Check the recovery menu.
Change-Id: I36a6a6b4101ba61d4d374e32353c36cc5716f9ce
2018-05-10 20:46:46 -07:00
Tao Bao
6cd816859e tests: Add tests for ScreenRecoveryUI.
In order to support that, this CL adds Paths::set_resource_dir() to
override the default resource dir ("/res/images/") that's only available
under recovery. Note that since there're external modules depending on
libminui, it adds a separate function of res_set_resource_dir(), instead
of requiring the dependency on libotautil for everyone.

Test: mmma -j bootable/recovery
Test: Run recovery_unit_test on marlin.
Change-Id: I0a7dcf4476808bea9e634eaffc9676f6cbaf92b7
2018-05-08 15:53:56 -07:00
Jerry Zhang
152933a28e recovery: Refactor logging code into logging.cpp
Move common logging related functions to
rotate_logs.cpp, and rename that to logging.cpp.

Test: Recovery works
Bug: 78793464
Merged-In: I00f20a79a296680122b8437d54a87897c5cb2fc7
Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7
2018-05-07 14:14:17 -07:00
Jerry Zhang
cadf4ed451 recovery: Refactor logging code into logging.cpp
Move common logging related functions to
rotate_logs.cpp, and rename that to logging.cpp.

Test: Recovery works
Bug: 78793464
Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7
(cherry picked from commit 3c3f211d1e)
2018-05-07 19:25:03 +00:00
android-build-prod (mdb)
13415d9138 Merge changes I1cc5d702,I32ab9854 am: 420f7f8df4
am: c4ba6b738f

Change-Id: I7696fb68e13e214ee830b9de1bf66dc6f1cac691
2018-05-04 10:43:36 -07:00
Tao Bao
2c52639d01 Move reboot() from common.h into otautil/sysutil.h.
This breaks the dependency on common.h (which belongs to
recovery/librecovery) from librecovery_ui. reboot() is now owned by
libotautil, which is expected to be a leaf node to be depended on.

With the change, recovery and updater also share the same reboot() code
now.

Test: mmma -j bootable/recovery
Change-Id: I1cc5d702cfe49302048db33d31c9c87ddc97ac71
2018-05-03 23:18:38 -07:00
Tao Bao
6d99d4b457 recovery: Split main() into recovery_main.cpp.
This prepares for moving more codes from recovery into librecovery, so
that they will become more easily testable. recovery_main.cpp will be
the source code for recovery module, with the rest moved into
librecovery. recovery_main.cpp mainly does the initializations, such as
setting up the logger.

Test: mmma -j bootable/recovery
Test: recovery_component_test
Test: Build and boot into recovery image on marlin.
Change-Id: I8e846524546b6f3f0e32ed869e851f62261eef23
Merged-In: I8e846524546b6f3f0e32ed869e851f62261eef23
2018-05-01 09:48:00 -07:00
Tao Bao
2ac56afc7b recovery: Split main() into recovery_main.cpp.
This prepares for moving more codes from recovery into librecovery, so
that they will become more easily testable. recovery_main.cpp will be
the source code for recovery module, with the rest moved into
librecovery. recovery_main.cpp mainly does the initializations, such as
setting up the logger.

Test: mmma -j bootable/recovery
Test: recovery_component_test
Test: Build and boot into recovery image on marlin.
Change-Id: I8e846524546b6f3f0e32ed869e851f62261eef23
(cherry picked from commit c241cb662440551eb0d2f42345f7ee08cf60a7dd)
2018-04-30 21:04:55 -07:00
android-build-prod (mdb)
1c1737b660 Merge "Merge libmounts into libotautil." am: 686353215f
am: cddf5dbf67

Change-Id: I57bcd1195084d2e60861aa5b410e2eb50c41c3c3
2018-04-28 09:55:49 -07:00
Tao Bao
9a319f01f8 Merge libmounts into libotautil.
Export its header (mounts.h) from there, and drop the dot dot dependency
from libupdater / updater.

Test: mmma bootable/recovery
Test: recovery_component_test
Change-Id: Ic26a6b9b78a34dbe1f178b138f3abaafffbec44c
2018-04-27 21:13:57 -07:00
android-build-prod (mdb)
cf277abb8f Merge "Rename the dir for SystemUpdaterSample." am: a544bfab2b
am: 4b52553cbb

Change-Id: If4113d931c95cb0e076035a384a9a5193e4a8369
2018-04-25 17:26:33 -07:00
Tao Bao
32118f6690 Rename the dir for SystemUpdaterSample.
Also replace the occurrence in README.md and PREUPLOAD.cfg.

Test: mmma -j bootable/recovery
Change-Id: I04c0ef00dd64f49e008ad2a4a2c1e8eaed76bf8d
2018-04-25 15:34:37 -07:00
Tao Bao
8206907cf0 Merge "update_verifier: Move to Soong." am: ed022fccdf
am: 9bc286dd71

Change-Id: I17da945eaa609f40d9601109c435110599ed88f6
2018-04-23 15:47:30 -07:00
Tao Bao
afb9fc29a2 update_verifier: Move to Soong.
Test: mmma -j bootable/recovery
Change-Id: I3a3574c89318304231c01f7633d32ece31df098c
2018-04-20 14:26:38 -07:00
Chih-Hung Hsieh
4d92ca3f65 Merge "Disable lld where it fails." am: 0c8eea86f9
am: dd2277a9bd

Change-Id: Ic245166068d1c87a1fbcb2fa36a0141914e9cd34
2018-04-16 11:48:42 -07:00
Chih-Hung Hsieh
83847e6ed9 Disable lld where it fails.
Bug: 77543887
Test: make checkbuild and boot
Change-Id: I4134a8eec592dac347c84cc7dc3f9f99f27bc50c
2018-04-16 09:39:07 -07:00
Pirama Arumuga Nainar
9e76ce0ad6 Use the non-LTO, non-PGO version of libhwbinder
am: 2ca4a403e7

Change-Id: Ic2cf355dd9faa2ed1c04f2673a41974df2c9f4a9
2018-04-10 11:29:27 -07:00
Pirama Arumuga Nainar
2ca4a403e7 Use the non-LTO, non-PGO version of libhwbinder
Bug: http://b/77320844

Android.mk doesn't have support for PGO either.  This causes linker
error (about missing __llvm_profile symbols) in the PGO-instrumentation
enabled builds in the release branch.

Test: m ANDROID_PGO_INSTRUMENT=ALL
Change-Id: Ib5dfdea88073bd95da2cd02e92c85bfffcca80d6
2018-04-09 17:43:25 +00:00
Yi Kong
bbb5b84c51 Merge "Use non-LTO variant of libhwbinder" into pi-dev
am: 7fdb6355e4

Change-Id: Ib78dee41815c782e0377d2e1fcb3754010ec8bb2
2018-04-06 13:36:38 -07:00
Yi Kong
10b3faa10d Use non-LTO variant of libhwbinder
... as a workaround for build system does not currently infer non-LTO
usage from Android.mk.

Test: m
Bug: 77320844
Change-Id: I6e9954b895051cc20408a30d0761e164e4c5bfd9
2018-04-03 12:45:45 -07:00
Tao Bao
8c749a39bd Merge "Move a few modules to Soong." am: d408a865af
am: 47be7bcdba

Change-Id: Iba006e5a0df67382f258d1ba60728f4c54003360
2018-04-02 18:14:21 +00:00
Treehugger Robot
d408a865af Merge "Move a few modules to Soong." 2018-04-02 16:05:37 +00:00
Jiachen Zhao
4e12cd95be Merge "Create folder for SystemUpdate sample app." am: f0e2811092
am: c6152041fd

Change-Id: I48ec477c7e4bc0dea32bfe89032fefee75d30c16
2018-03-31 15:48:35 +00:00
Jiachen Zhao
051b968d7b Create folder for SystemUpdate sample app.
Test: no functional changes.

Change-Id: I2e8c654086ca49063c59ae0529e190323c84d6ad
2018-03-30 18:22:36 -07:00
Tao Bao
d2f2ad6a3c Move a few modules to Soong.
libmounts
librecovery_ui_default
librecovery_ui_wear
librecovery_ui_vr
libverifier
recovery-persist
recovery-refresh

They are all trivially converted.

Test: mmma -j bootable/recovery
Change-Id: Id783b3eec32bd15e74f42df17053732db5666675
2018-03-26 21:35:41 -07:00
Tao Bao
f6d25962bb Specify a default module for TARGET_RECOVERY_UI_LIB.
This aligns the logic between {default,wear,vr}_device.cpp. They all
implement their default make_device() functions, but using different
RecoveryUI variants.

This CL creates a new module librecovery_ui_default that uses
ScreenRecoveryUI, which serves as the default value for
TARGET_RECOVERY_UI_LIB.

Test: lunch aosp_{angler,marlin,dragon,walleye}-userdebug;
      `mmma -j bootable/recovery` respectively.
Change-Id: I6755b09d96e4809bb1c17142895fe1cad95e5a02
Merged-In: I6755b09d96e4809bb1c17142895fe1cad95e5a02
2018-03-26 19:45:06 -07:00
Tao Bao
f7e8012be3 Specify a default module for TARGET_RECOVERY_UI_LIB.
This aligns the logic between {default,wear,vr}_device.cpp. They all
implement their default make_device() functions, but using different
RecoveryUI variants.

This CL creates a new module librecovery_ui_default that uses
ScreenRecoveryUI, which serves as the default value for
TARGET_RECOVERY_UI_LIB.

Test: lunch aosp_{angler,marlin,dragon,walleye}-userdebug;
      `mmma -j bootable/recovery` respectively.
Change-Id: I6755b09d96e4809bb1c17142895fe1cad95e5a02
(cherry picked from commit 73fd036be8c7563423be0c3adbd4205c4f1bc2f5)
2018-03-26 15:26:34 -07:00
Tianjie Xu
5fe5eb67ef Factor out a menu class for screen ui
Also consolidate the duplicate codes to draw the menu in ScreenRecoveryUI
and WearRecoveryUI. This helps us to support text icons as menu in the
future.

Bug: 74397117
Test: Check the menu under recovery on bullhead and a wear device.
Change-Id: Iba9b646c3828670f0e78a7e07d1a94a44e96bb0b
Merged-In: Iba9b646c3828670f0e78a7e07d1a94a44e96bb0b
2018-03-23 23:57:29 -07:00
Tianjie Xu
ba0460c981 Factor out a menu class for screen ui
Also consolidate the duplicate codes to draw the menu in ScreenRecoveryUI
and WearRecoveryUI. This helps us to support text icons as menu in the
future.

Bug: 74397117
Test: Check the menu under recovery on bullhead and a wear device.
Change-Id: Iba9b646c3828670f0e78a7e07d1a94a44e96bb0b
(cherry picked from commit 2b3f80068e)
2018-03-24 01:20:10 +00:00
Yifan Hong
91b48f9161 recovery: add libhidl-gen-utils depedency
introduced as a depedency to libvintf.

Test: builds
Bug: 73556059
Change-Id: Ia51ba81ef462879481dcacb80d9ea9ea35e8b0bb
Merged-In: Ia51ba81ef462879481dcacb80d9ea9ea35e8b0bb
2018-03-13 10:56:51 -07:00
Yifan Hong
584c52a0a1 Merge "recovery: add libhidl-gen-utils depedency" am: fc39f3ffd7
am: da5bb13507

Change-Id: I9811a65335a51006593a332f276deddf1bbf1864
2018-03-12 21:13:58 +00:00
Yifan Hong
fc39f3ffd7 Merge "recovery: add libhidl-gen-utils depedency" 2018-03-12 20:50:25 +00:00
Yifan Hong
495c521ed3 recovery: add libhidl-gen-utils depedency
introduced as a depedency to libvintf.

Test: builds
Bug: 73556059
Change-Id: Ia51ba81ef462879481dcacb80d9ea9ea35e8b0bb
2018-03-07 18:35:15 -08:00
Tao Bao
399febd111 Merge "Export fuse_sideload.h for libfusesideload." am: ddf93c0055
am: 9b0c133ff5

Change-Id: I9576800cae927de195baddef2141f7e1ef01082b
2018-03-07 22:24:13 +00:00
Tao Bao
15bc28727a Merge "minadbd: Move to Soong." am: 56160b2b03
am: 734f76fc38

Change-Id: Ic7c86ba406ab051ddb0da32544290196e1d4d779
2018-03-07 19:18:19 +00:00
Tao Bao
4b51c3ab40 Export fuse_sideload.h for libfusesideload.
Move the module into a separate directory so that we can export only the
expected header.

With this change, minadbd no longer needs to include bootable/recovery.

Test: mmma -j bootable/recovery
Change-Id: I69b888ceb160a33a67d79c5bda208dc17ad6ed86
2018-03-07 10:01:51 -08:00
Tao Bao
8c7761edec minadbd: Move to Soong.
Test: mmma -j bootable/recovery
Change-Id: Ic4cd676a842f0e8c4735cc6731fcbf13b844510c
2018-03-06 20:36:35 -08:00
Hridya Valsaraju
bd84bd438a Statically link with libhealthstoragedefault
This is to add empty implementations of Health
HAL methods to report storage info.

Bug: 68388678
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: I4f093903f485519e16f39384f5c96fcd031438ba
2018-01-11 17:48:09 -08:00
Jaegeuk Kim
a296fea692 Merge "add sload.f2fs for recovery format" am: 4eaf7a157d am: 3d4359d3ae
am: adb8f660a2

Change-Id: I551f6fe2e040720ea02cbdacfc73bc3aaa5b2e3d
2017-12-08 17:00:50 +00:00
Jaegeuk Kim
c1c7311b8a add sload.f2fs for recovery format
Change-Id: Iddfe54b2b36f2d531925cbe61c98dbfb4903c0d1
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-12-04 20:27:49 -08:00
Yifan Hong
e8e4c40246 is_battery_ok use health 2.0 HAL
Test: call is_battery_ok in graphics test, and test manually
Bug: 69268160
Bug: 63702641

Change-Id: Ifcf4d2e2cb459689c11fc5d1b880bb053aaae8ae
2017-11-14 11:29:53 -08:00
Tao Bao
a2a68a522e uncrypt: Move to Soong.
Test: mmma -j bootable/recovery
Change-Id: I405f2a70f51904c02c49a287c23cbc115a4c5132
2017-11-09 12:34:00 -08:00
Jin Qian
000148dbc9 recovery: fix library dependency
After removing some deadcode from libext4_utils, libz is optimized
out by linker. However, it's still required by libvintf. Moving libz
down the list fixed the build.

Bug: 64395169
Change-Id: I23ecd70c83af83a219faced59d8227dc3c4e43d5
2017-11-03 13:43:48 -07:00
Tao Bao
b058c5c481 Merge "applypatch: Move to Soong." 2017-10-12 16:12:48 +00:00
Tao Bao
99f0d9e52b Drop -Wno-unused-parameter.
The only one left is libedify. Will handle that in a separate CL.

Test: mmma bootable/recovery
Change-Id: I732a5f85229da90fd767bee2e46c5c95f529c396
2017-10-11 16:56:12 -07:00
Tao Bao
582b67850f applypatch: Move to Soong.
Test: mmma bootable/recovery
Change-Id: Ie163aff1c4c2b3b15bb705825779ada6bc38ad67
2017-10-11 16:26:06 -07:00
Tao Bao
09e468f84c Move rangeset.h and print_sha1.h into otautil.
Also drop the "bootable/recovery" path in LOCAL_C_INCLUDES from
applypatch modules.

Test: lunch aosp_{angler,bullhead,fugu,dragon,sailfish}-userdebug;
      mmma bootable/recovery
Change-Id: Idd602a796894f971ee4f8fa3eafe36c42d9de986
2017-10-10 15:52:11 -07:00
Tao Bao
e6f7f95d34 edify: Export the header and move to Soong.
Also make matching changes to applypatch modules which include
edify/expr.h.

Test: mmma bootable/recovery
Change-Id: Ia72be3caa010d7f56a70add2da345e631b306378
2017-10-09 14:08:00 -07:00
Tao Bao
cfe53c2c01 otautil: Export headers.
Test: mmma bootable/recovery
Change-Id: Ic01b68e2a394d578fc9fc09da2dabe9061b98122
2017-10-03 14:41:32 -07:00
Tao Bao
a26e32d2a3 otafault: Move to soong.
Test: mmma bootable/recovery
Change-Id: I5f2520ea457ba66743aa3aa1d5b3b488a93084a3
2017-09-29 11:05:24 -07:00
Tianjie Xu
11f68b6b69 Merge "Turn on -Wall for recovery modules" 2017-08-29 17:21:09 +00:00
Tianjie Xu
c89d1e7e2a Turn on -Wall for recovery modules
Turn on -Wall for all modules. Also remove the obsolete file_cmp() in
apply_patch test and now() in wear_ui.

The only exception is lib_edify due to the unused functions in the
intermediate cpp files generated from the lex files. It will be handled
in a seperate CL.

Bug: 64939312
Test: mma, unit tests pass
Change-Id: Ic53f76b60b6401ab20db3d98130d674c08e3702f
2017-08-28 21:56:33 -07:00
Treehugger Robot
d179c923d8 Merge "Add libasyncio." 2017-08-29 03:28:25 +00:00
Tao Bao
eea3af3f91 wear_ui: Expose menu_unusable_rows via Makefile var.
This variable is useful on small screens (e.g. on watches) to handle
long menus. We should have better way to handle this value smartly.
Prior to that, expose the value to be overridable by using the generic
wearable UI module (librecovery_ui_wear).

Bug: 64307776
Test: Define the variable, build and boot into recovery image and check
      the UI menu.
Change-Id: I5d7a6baa8bb4cc852bfcc2a7b3cc9686c1c8817e
2017-08-11 13:53:58 -07:00
Tao Bao
0470ceea38 Allow customizing WearRecoveryUI via Makefile variables.
With the following Makefile variables, we can reduce the work of writing
(copy/pasting) device-specific WearRecoveryUI classes.

The list of Makefile variables (the ones useful for Wear devices):
- TARGET_RECOVERY_UI_MARGIN_HEIGHT (default: 0)
- TARGET_RECOVERY_UI_MARGIN_WIDTH (default: 0)
  Specify the margin space that we don't want to display texts. They
  replace the former outer_width and outer_height.

- TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD (default: 50)
- TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD (default: 90)
  Specify the sensitivity of recognizing a swipe. Devices give absolute
  positions, so for some devices we need to adjust the thresholds.

- TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE
  Specify the progress bar vertical position, which should be adjusted
  to the actual height of a device. It replaces the former
  progress_bar_y.

- TARGET_RECOVERY_UI_ANIMATION_FPS (default: 30)
  Specify the animation FPS if using device-specific animation images.
  It replaces the former animation_fps.

Devices can specify "TARGET_RECOVERY_UI_LIB := librecovery_ui_wear",
with optionally defined Makefile vars above, in BoardConfig.mk to
customize their WearRecoveryUI.

Also remove the obsolete wear_touch.{cpp,h}, which has been merged into
ui.cpp in commit 5f8dd9951d.

Bug: 64307776
Test: Change the device BoardConfig.mk and test recovery image.
Change-Id: Id0fb2d4e3977ab5ddd31e71f9535470cab70e41b
2017-08-10 09:31:17 -07:00
Tao Bao
5f8dd9951d ui: Move the support for touch inputs into RecoveryUI.
- Added detection for EV_ABS events in minui/events.cpp, if it's
  allowed;
- Added listening and processing touch inputs in ui.cpp;
- Fixed an issue in recognizing swipe with multi-touch protocol A;
- Changed the logic in RecoveryUI::ProcessKey() to be swipe-aware. It
  now allows turning on text mode with <power> + <swipe-up>.

The last change also fixed an issue on devices with protocol A: prior
to this CL, user may accidentally toggle the text mode during an OTA.
Because it was considered as a single-button device, a long tap that
sent BTN_TOUCH event would turn on text mode.

Test: Allow detecting touch inputs. Swiping (up, down, enter) works on
      angler, angelfish, dorado respectively.
Bug: 36169090
Change-Id: I4bc882b99114ce4ab414f8bdb8f4f7a525b8a8fd
2017-08-01 18:30:48 -07:00
Jin Qian
ded2dac082 recovery: replace make_ext4 with e2fsprogs
Execute mke2fs to create empty ext4 filesystem.
Execute e2fsdroid to add files to filesystem.

Test: enter recovery mode and wipe data
Bug: 35219933
Change-Id: I10a9f4c1f4754ad864b2df45b1f879180ab33876
(cherry picked from commit ac31808cd3)
2017-07-20 11:42:17 -07:00
Jerry Zhang
d428e79139 Add libasyncio.
libadbd_usb depends on libasyncio.

Bug: 37916658
Test: Use adb in recovery on bullhead/marlin
Change-Id: I77ac3bb2a580d29551e7b5c471bc3cfbf1a3219d
2017-07-18 11:42:59 -07:00
Treehugger Robot
f9fe6a705d Merge "Add missing libziparchive dependency." 2017-06-28 16:35:39 +00:00
Elliott Hughes
e1bb7a5752 Add missing libziparchive dependency.
Bug: http://b/37560614
Test: builds even after removing system/core/include/ziparchive
Change-Id: Ib7ed45cafe83d24ed55aac28b4f41a073c371bc2
2017-06-28 08:00:17 -07:00
Luke Song
9d4839c60f Restructure vr_ui
Get rid of pixel offset variables, and use makefile variables in
BoardConfigs.

Bug: 37779982
Test: Verified vr ui has same behavior.
Change-Id: Ifbf44e27d7101aedbe3c0e6db4b8181d56efadfd
(cherry picked from commit 81a8e4cab2)
2017-06-23 16:51:00 -07:00
Tao Bao
4521b7027f Use Makefile variables to specify margin settings.
Instead of defining device-specific UI class, this CL allows using
Makefile variables to specify margin values directly.

Values explicitly defined via TARGET_RECOVERY_UI_MARGIN_HEIGHT and
TARGET_RECOVERY_UI_MARGIN_WIDTH will be used. Otherwise they will
default to zero.

Bug: 62732748
Test: Specify the height and width and check recovery texts.
Change-Id: Icb6f7466c8d407f877b93da38aebfdf7e6b41be7
(cherry picked from commit a92d8fb456)
2017-06-23 09:22:34 -07:00
Luke Song
e2bd876043 Introduce VR recovery ui
A version of screen ui with specific adjustments for vr device
compatibility.

(cherrypick of a44dba7f4e to AOSP)

Bug: 37779982
Test: "adb reboot recovery" to view
Change-Id: If6b0f26c1b587f8d0176060685b5efb6c67593b1
2017-06-16 15:33:02 -07:00
Tom Cherry
600e806384 libbootloader_message: convert to Android.bp
Test: build
Change-Id: Ia0c2e141673e37eea29306817d2f4b2c944213b0
2017-05-17 11:43:29 -07:00
Treehugger Robot
106ca8e93f Merge "otautil: Android.mk -> Android.bp" 2017-05-10 03:05:25 +00:00
Steven Moreland
f3ae55a167 otautil: Android.mk -> Android.bp
Test: flash and boot recovery on internal angler
Change-Id: Id8845b4b422d0078b251333eb6d30ce14771ef10
2017-05-09 16:09:41 -07:00
Tao Bao
b168f5f857 recovery: Use libverifier instead of rebuilding the sources.
Test: mmma bootable/recovery
Change-Id: Ie8cec009b00c121948179518ba9cbc26a82352bf
2017-05-08 11:04:07 -07:00
Tao Bao
ed13819a0d fuse_sideload: Change the minimal block size to 4096.
run_fuse_sideload() is passing the block size as the max_read
option, so it will only handle a request that involves at most two
blocks at a time. However, the minimal allowed value was set to 1024
prior to this CL, which is inconsistent with the kernel code
(fs/fuse/inode.c) that sets it to the greater of 4096 and the passed-in
max_read option. This would fail the calls with a block size / max_read
less than 4096 due to the wrongly computed block indices.

Note that we didn't observe real issue in practice, because we have been
using 64 KiB block sizes for both of adb and sdcard sideload calls. The
issue only shows up in my local CL (to come later) that uses 1024 block
size in run_fuse_sideload() tests.

Test: recovery_component_test
Test: adb sideload with the new recovery image on angler
Change-Id: Id9f0cfea13d0d193dcb7cd41a1553a23739545f2
2017-05-02 15:56:22 -07:00
Tao Bao
20126e1e28 libfusesideload: Clean up the CFLAGS for the module.
Remove "-DADB_HOST=0" since it doesn't include adb related stuff.

Test: mmma bootable/recovery
Test: sideload on marlin
Change-Id: Ia83a8edd31eedd803435d687513d561c873ffabe
2017-04-27 11:04:18 -07:00
Tao Bao
d8039acce6 recovery: Remove the include of adb.h.
recovery.cpp doesn't have a direct dependency on adb.h (only minadbd
does). 'adb.h' was once needed for DEFAULT_ADB_PORT, until being killed
by commit acb2a2fa4c.

Test: mmma bootable/recovery
Change-Id: I84f87988d01c3f0c3d1383cc3cffde2e7d5e7aea
2017-04-24 12:22:44 -07:00
Tao Bao
b24510cd60 librecovery: Remove -Wno-unused-parameter and add -Wall.
Test: mmma bootable/recovery
Change-Id: I5598d32bebb9dbda4a183a1502e0b7dc4918392e
2017-04-24 09:06:38 -07:00
Tao Bao
919d2c9a53 Call libvintf to verify package compatibility.
The libvintf API has landed. Hook up to do the actual verification.

Bug: 36597505
Test: recovery_component_test
Test: m recoveryimage; adb sideload on angler and sailfish, with
      packages that contain dummy compatibility entries.
Test: m recoveryimage; adb sideload on angler and sailfish, with
      packages that don't contain any compatibility entries.
Change-Id: Idbd6f5aaef605ca51b20e667505d686de5ac781f
(cherry picked from commit da320ac6ab)
2017-04-19 15:17:16 -07:00
Tao Bao
7fdcb19e10 Add the missing LOCAL_CFLAGS for librecovery.
The -DAB_OTA_UDPATER part was missing when separating the librecovery
module (commit 62e0bc7586).

Bug: 37300957
Test: Build sailfish recovery image and sideload full OTA.
Change-Id: Idd25662f6bc812c1aca95b096802f59b051f8d63
(cherry picked from commit 25dbe1717e)
2017-04-17 15:58:56 -07:00
Tao Bao
1d866050eb Verify the package compatibility with libvintf.
verify_package_compatibility() is added to parse the compatibility entry
(compatibility.zip) in a given OTA package. If entry is present, the
information is sent to libvintf to check the compatibility.

This CL doesn't actually call libvintf, since the API there is not
available yet.

Bug: 36597505
Test: Doesn't break the install with existing packages (i.e. w/o the
      compatibility entry).
Test: recovery_component_test
Change-Id: I3903ffa5f6ba33a5c0d761602ade6290c6752596
(cherry picked from commit 62e0bc7586)
2017-04-12 22:46:09 -07:00
Alex Deymo
fb00d82f32 Boot control HAL based on the A/B headers.
The added bootctrl.bcb module implement the legacy interface for the
bootctrl HAL based on the Boot Control Block (BCB) and the headers
already specified in the booloader_message library.

This serves as a reference implementation of the boot_control HAL.

Bug: 32707546
Test: Tested internally that a device can use this HAL to flip slots and
recovery from a /misc wipe.

Change-Id: Ic02e5aaf4de7d0a1780eac4e8705dae20d0b3e10
2017-04-03 11:25:33 -07:00
Tao Bao
5f85d1fb0a Log the error message when failing to mount/umount.
Test: Observe the error messaage for a umount failure case.
Bug: 36686818
Change-Id: I28e335c2df4454dd0192f95e3909599fcc9dc1c0
2017-03-28 21:21:28 -07:00
Tao Bao
d7bf82eb53 Remove the dead #include's in verifier.cpp.
A follow-up to commit 5e535014dd.
Also clean up Android.mk, since libverifier no longer needs anything
from libminui.

Test: mmma bootable/recovery
Test: recovery_component_test passes.
Change-Id: I1c11e4bbeef67ca34a2054debf1f5b280d509217
2017-03-18 09:28:42 -07:00
Tao Bao
0ecbd76b22 minui: Export minui/minui.h.
For libminui static and shared libraries.

Test: build
Change-Id: Ib30dc5e2ef4a3c8b3ca3a0cec68cb65e229a0c16
2017-01-16 21:28:18 -08:00
Alex Deymo
67f3aa8804 Remove "_static" suffix from libsparse
Bug: 34220783

Change-Id: I358f931f0b29f5bd526e1475180e477e2e90b936
2017-01-11 14:38:30 -08:00
Alex Deymo
31653660ad Remove "_static" suffix from libext4_utils.
Bug: 34220783
Change-Id: I34ccc3b11da0d1b48805967ad75b9ddade569930
2017-01-11 14:02:13 -08:00
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