Commit graph

7940 commits

Author SHA1 Message Date
Yifan Hong
41fd3c3ad9 Merge "updater: Fix build for new CreateLogicalPartition signature."
am: 18c3f78779

Change-Id: Id0deb6160cf5b1bd04c99081a766df412a26e7f5
2019-08-16 11:24:53 -07:00
Yifan Hong
18c3f78779 Merge "updater: Fix build for new CreateLogicalPartition signature." 2019-08-16 17:41:22 +00:00
Tianjie Xu
03fd851f61 Merge "Remove common.h"
am: 899f7b5105

Change-Id: Ic5b9e24cb87ef292f5d8e53de485e44e455f3185
2019-08-15 18:05:25 -07:00
Tianjie Xu
899f7b5105 Merge "Remove common.h" 2019-08-16 00:24:41 +00:00
Tao Bao
f934163f4c Merge "minui: Support input device hotplug in recovery mode."
am: ecc208286f

Change-Id: Ic20b0a1459e3b77413ec6b5869b184272a559284
2019-08-15 16:13:31 -07:00
Tao Bao
ecc208286f Merge "minui: Support input device hotplug in recovery mode." 2019-08-15 22:43:30 +00:00
Tianjie Xu
b63a2215b5 Remove common.h
Additionally kill the global variable: reason, stage; move them to a
separate BootState class instead. Vendor specific recovery code will
need to call getters from Device() class to access these variables.

Bug: 137705917
Test: unit tests pass, boot sailfish into recovery, code search and no
code includes common.h in vendor specific recovery.
Change-Id: Ia50a5ea951212c25548562f29cc9cf78505b5e34
2019-08-15 13:40:16 -07:00
Xihua Chen
a7952ac141 minui: Support input device hotplug in recovery mode.
In the old code, the recovery only enumerated the input devices at the
startup, and read the input events from these devices.
So if a USB input device is probed after the recovery startup, then the
recovery can't read the events from this device.
This patch use inotify to monitor /dev/input for new added input
device, then support input device hotplug in recovery mode.

Bug: 111847510
Test: can use USB keyboard hotplugged in recovery mode
Change-Id: I7e7dcbd619d3c66a2f40a43418f5dac6a50c859e
Signed-off-by: Liu Shuo A <shuo.a.liu@intel.com>
Signed-off-by: Ming Tan <ming.tan@intel.com>
2019-08-14 14:18:58 -07:00
David Anderson
3cbd7ae687 updater: Fix build for new CreateLogicalPartition signature.
Bug: 135752105
Test: mm libupdater_device
Change-Id: I9dc6dc1e9112177ee5c0a96b8969dc3dc02d95f2
2019-08-14 12:32:55 -07:00
Xin Li
1ba485fbde DO NOT MERGE - Skip qt-dev-plus-aosp-without-vendor (5713463) in stage-aosp-master
Bug: 134405016
Change-Id: I98da75f9e4ab07527759b5cc372e14e1f79f2498
2019-08-14 11:35:07 -07:00
Vic Yang
76d80ba102 Merge "bootloader_message: Remove global std::string"
am: 7b87949ae1

Change-Id: I9a374505c325b041876bc7d659d5b211a6d50ca3
2019-08-07 18:47:47 -07:00
Treehugger Robot
7b87949ae1 Merge "bootloader_message: Remove global std::string" 2019-08-08 01:24:29 +00:00
Vic Yang
e94b64ae86 bootloader_message: Remove global std::string
A global std::string, even if not used, pollutes the bss section
unnecessarily.  Since this object is only there for testing, make it
std::optional<std::string>, which is constexpr constructible.

Bug: 138856262
Test: Along with a fix in fs_mgr, see that the bss section for
      libbootloader_message.so is now clean on cuttlefish for several
      processes.

Change-Id: I6df837dded88d979ffe14d5b2770b120bcf87341
2019-08-07 14:12:36 -07:00
Tianjie Xu
be3f56543e Merge "Simulator: add the argument to keep the updated images"
am: c34e4e7fb5

Change-Id: Idb86f6ee1b5a99c626150acaa86d8152b2a8ba99
2019-07-31 16:16:56 -07:00
Tianjie Xu
c34e4e7fb5 Merge "Simulator: add the argument to keep the updated images" 2019-07-31 22:34:34 +00:00
Tianjie Xu
60b242cfd5 Simulator: add the argument to keep the updated images
Add the command line option to select the work directory and save the
updated image files. Because some people might have interested in
getting updated images from an ota file.

Also, fix a minor issue that the destination of package_extract_file
needs to be updated if it's a block device. Otherwise, an unintended
file may be extracted in the callers' directory.

Test: run simulation, run unit tests

Change-Id: Ic6a7db0580bc1748d6e080102e4654da4e41fd8c
2019-07-30 17:11:35 -07:00
Tianjie Xu
b25d741563 Merge "Create a new function to return the help message for menu"
am: 5d9f963e4e

Change-Id: I216097c1aea8ae73999ad9b880dd6898a3c94def
2019-07-26 11:13:22 -07:00
Tianjie Xu
5d9f963e4e Merge "Create a new function to return the help message for menu" 2019-07-26 17:39:20 +00:00
Tianjie Xu
e5032219fe Create a new function to return the help message for menu
Then we can override this function in the device specific recovery ui;
and allow customizing the help message.

Bug: 137965958
Test: Check the menu on sailfish
Change-Id: I09f23166f4205c5edf6c62eb42c8ada0fa710b26
2019-07-25 13:22:03 -07:00
Tianjie Xu
168ce56022 Merge "Clean up some global variables in common.h"
am: 80c405f692

Change-Id: Id50b466efaed118a6e7d1bac71c95000822be855
2019-07-24 17:26:53 -07:00
Tianjie Xu
80c405f692 Merge "Clean up some global variables in common.h" 2019-07-24 22:45:32 +00:00
Tianjie Xu
164c60a4f3 Clean up some global variables in common.h
Some global variables are only used for recovery.cpp and
recovery_main.cpp, remove them from common.h and handle their usage
accordingly. Variables include:
static constexpr int kRecoveryApiVersion;
extern struct selabel_handle* sehandle;
extern RecoveryUI* ui;
extern bool has_cache;
bool is_ro_debuggable();

Test: unit tests pass, boot into recovery mode and run graphic tests
Change-Id: If83a005786c9b38412731da97aaf85af69a3b917
2019-07-24 11:36:03 -07:00
Tianjie Xu
94bc9e1010 Merge "Add command line parser for simulator"
am: 7965a95adc

Change-Id: Ifa759b9f07a671ad509b0847c30bda4c17edac6c
2019-07-17 10:44:25 -07:00
Tianjie Xu
7965a95adc Merge "Add command line parser for simulator" 2019-07-17 17:19:51 +00:00
Tianjie Xu
7efd23338a Add command line parser for simulator
Add a command line parser. Also add the support to parse the oem
property file and skip certain functions.

Bug: 131911365
Test: run simulator for wear builds
Change-Id: Ide306b53d3f42b29c02279969aeb18bec4045d6f
2019-07-16 13:03:41 -07:00
Tianjie Xu
79e4e39be6 Merge "Drop the device specific support for update host simulator"
am: fc2ad88770

Change-Id: I2d0b32a139ac02952e1c365849b2036d74fad1bf
2019-07-14 16:13:05 -07:00
Tianjie Xu
fc2ad88770 Merge "Drop the device specific support for update host simulator" 2019-07-14 22:49:59 +00:00
David Anderson
d3d51e5066 Merge "Fix build for API change to DestroyLogicalPartition()."
am: 4c8e6eae28

Change-Id: Ifdc9b9560114d89c53ba99e5dc360769e157cdab
2019-07-13 11:18:02 -07:00
David Anderson
4c8e6eae28 Merge "Fix build for API change to DestroyLogicalPartition()." 2019-07-13 18:02:05 +00:00
Tianjie Xu
b42281a423 Drop the device specific support for update host simulator
The device specific libs prevent us from building an universal simulator to add
to the otatools. Drop the support since there is currently no active users of the
simulator extension; plus we will unlikely to implement the device specific simulator
runtime.

As a alternation, we will add the commandline arguments to skip certain unsupported
functions, and move the simulator build to the bp file.

Bug: 131911365
Test: mma
Change-Id: I3ff0f45dbebe3ed72d5f4670a869b40e6cfd5a7c
2019-07-12 11:55:59 -07:00
Tianjie Xu
36385bd9ee Merge "Remove libimgpatch"
am: ed96da6664

Change-Id: Id263dad2ce56b5268af5e65ee8d1cc55d2967e56
2019-07-10 18:04:27 -07:00
Treehugger Robot
ed96da6664 Merge "Remove libimgpatch" 2019-07-11 00:38:02 +00:00
Tao Bao
d9ec0bbd06 Merge "minadbd sends heartbeat to rescue service for getprop command."
am: 89cc79cbb6

Change-Id: Ia150b81bbb224db0fd6293d6a95bcc788e62cc49
2019-07-10 13:49:01 -07:00
Tianjie Xu
e99f4e88a2 Merge "Add a new key_pressed_mutex"
am: 33bb113af2

Change-Id: Ic9de2f770616aade4de13061b38540ed480f73f6
2019-07-10 13:48:44 -07:00
Tianjie Xu
0c666e3d5d Merge "Create a fallback to install from fuse if mmap fails"
am: 5f408dd48a

Change-Id: Ie8a54863426bb3558600b96c2ef7338eb0171cd3
2019-07-10 13:41:30 -07:00
Tao Bao
89cc79cbb6 Merge "minadbd sends heartbeat to rescue service for getprop command." 2019-07-10 19:52:44 +00:00
Tianjie Xu
45c40ec876 Remove libimgpatch
Stop building libimgpatch as it's merely a subset of libapplypatch.

Test: unit tests pass

Change-Id: I0735ec053344404434a50e53a36e3f55964c2e4f
2019-07-10 12:41:45 -07:00
Tianjie Xu
33bb113af2 Merge "Add a new key_pressed_mutex" 2019-07-10 17:46:27 +00:00
Tianjie Xu
5f408dd48a Merge "Create a fallback to install from fuse if mmap fails" 2019-07-10 17:40:37 +00:00
Justin Yun
29adb8f0f2 Merge "Change the symlink to system_ext"
am: c992962503

Change-Id: I3dcd6e9acd6d661eea7c20fbd362761fd7a5011e
2019-07-09 22:05:14 -07:00
Treehugger Robot
c992962503 Merge "Change the symlink to system_ext" 2019-07-10 04:39:52 +00:00
Tianjie Xu
b8a959b00f Add a new key_pressed_mutex
The following variables in recovery ui were protected by
key_queue_mutex. But the purpose of key_queue_mutex is to protect the
key_queue, which will be changed after we already have a key code. So
getting the key pressed should be orthogonal to the key queue. And
adding a mutex will help to avoid deadlocks in b/135078366.

Variables include:
  char key_pressed[KEY_MAX + 1];
  int key_last_down;
  bool key_long_press;
  int key_down_count;
  bool enable_reboot;

Bug: 135078366
Test: boot into recovery and press keys
Change-Id: Ie2cfcf1f2fec49b53f8fac97aa9a2c60f15b84f9
2019-07-09 16:47:07 -07:00
Justin Yun
ea3c4a4948 Change the symlink to system_ext
As system_ext partition will be linked to system/system_ext, update
the path to system/system_ext.

Bug: 134359158
Test: build
Change-Id: I5a49adfe7e045e24bf6dfbf6990a965b8a5e1ce1
2019-07-09 23:33:26 +00:00
Tao Bao
4324e07a29 Merge "recovery_ui: Remove RecoveryUI::last_key."
am: 04b4ff695d

Change-Id: If9f78bd849948a80eaadfbfedc81c4ee3d94ff05
2019-07-09 16:27:30 -07:00
Tao Bao
04b4ff695d Merge "recovery_ui: Remove RecoveryUI::last_key." 2019-07-09 22:04:33 +00:00
Tianjie Xu
e521861508 Create a fallback to install from fuse if mmap fails
We may fail to memory map the package on 32 bit builds for packages with
2GiB+ size. This cl tries to install the package with fuse when memory map
fails in such cases.

Bug: 127071893
Test: build 32 bit version sailfish, push package and block.map, reboot into recovery with
the corresponding update_package argument.

Change-Id: I5dae4f3e27ccaf8d64ff3657d36f0e75db2330b0
2019-07-09 14:15:18 -07:00
Josh Gao
32aeca8e78 Merge "minadbd: delete unnecessary fdevent.h include."
am: e1701454b2

Change-Id: Iaca242da9406d1d30e8e9ec4b7958bc11485e9d8
2019-07-09 13:34:38 -07:00
Josh Gao
e1701454b2 Merge "minadbd: delete unnecessary fdevent.h include." 2019-07-09 20:02:29 +00:00
Tao Bao
1df3ce7ea8 recovery_ui: Remove RecoveryUI::last_key.
It's a private member, and the last user has been removed in [1] in
2015.

[1] commit ec28340cf3,
https://android-review.googlesource.com/c/platform/bootable/recovery/+/146330

Test: mmma -j bootable/recovery
Change-Id: I65a2370cb20a7b296888425a44a42c8b90abc766
2019-07-09 11:21:18 -07:00
Tao Bao
2223e6a9f8 minadbd sends heartbeat to rescue service for getprop command.
We start minadbd and rescue services in two processes. In particular,
minadbd handles the requests from host, then communicates with rescue
service to do install/wipe works. When resuce service doesn't see any
request in a pre-defined timeout (currently 300s), rescue service will
exit to avoid endless waiting.

This CL changes minadbd to additionally send a no-op command to rescue
service as a heartbeat signal, so that host side can finish
time-consuming operations (e.g. downloading over network) while keeping
rescue service alive.

Bug: 136457446
Test: Enter resuce mode on blueline. Send `adb rescue getprop
      ro.build.fingerprint` and check that rescue service doesn't exit.
Test: Stop sending the getprop command. Check that rescue service exits
      after 300s.
Change-Id: Ib9d5ed710cfa94ecfe6cf393a71a0b67b2539531
2019-07-09 11:09:34 -07:00