Commit graph

56696 commits

Author SHA1 Message Date
Tom Cherry
641e9e45b5 Merge "base: access all new liblog symbols through liblog_functions" 2020-03-05 21:29:09 +00:00
Tom Cherry
d620ec7fb9 base: access all new liblog symbols through liblog_functions
The original CL was missing these.

Bug: 149591522
Test: build
Change-Id: I99615b81cfe9166a00c812a8642ecf1244bf08b9
2020-03-05 10:52:01 -08:00
Jeffrey Huang
8c20f9e6b5 Merge "Update init.rc for statsd setup" 2020-03-05 16:49:39 +00:00
Yifan Hong
198651c202 Merge changes from topics "libsnapshot_delete_initiate", "snapshotctl_cleanup", "update_engine_vab_metrics"
* changes:
  libsnapshot: SnapshotMergeStats::Start/Finish
  libsnapshot: Expose SnapshotMergeStats
  libsnapshot: delete WaitForMerge.
  libsnapshot: handle errors in RemoveAllUpdateState appropriately.
  libsnapshot: remove snapshots properly after flashing
  libsnapshot: RemoveUpdateState on rollback.
  libsnapshot: NeedSnapshotsInFirstStageMount don't test for IsRecovery
  Allow ProcessUpdateState to be paused.
  libsnapshot: Re-expose InitiateMerge and ProcessUpdateState
  libsnapshot: Add prolog to RemoveAllUpdateStates.
  snapshotctl don't auto-merge.
2020-03-05 16:41:16 +00:00
Alan Stokes
541d0d28b1 Merge "Fix /data_mirror permission" 2020-03-05 10:02:35 +00:00
Treehugger Robot
5dbd893784 Merge "fix some liblp file access for win32" 2020-03-05 03:01:41 +00:00
Peter Collingbourne
017a0acdca Merge "Create a ProcessInfo structure with the process-wide information from the crasher." 2020-03-05 01:25:14 +00:00
Haoran.Wang
f7d1a07952 fix some liblp file access for win32
The file accessing API in liblp don't work on win32. Add the O_BINARY
to correct the file stream access.
This patch follow the AOSP change 829979.

Change-Id: I97180e2f07cacf109a86593b6a12975597552053
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
2020-03-05 08:34:52 +08:00
Jeffrey Huang
8dccf3ffd1 Update init.rc for statsd setup
Apexes do not support "on" macros, so we are moving
them into the system partition

Bug: 145923087
Test: m -j
Change-Id: Ic671a51f2ec5b91f2f631bae0f509b4aa2d057b4
Merged-In: Ic84e77269f80097b675d6a1b0d206c2bae7d918d
2020-03-04 15:14:37 -08:00
Yifan Hong
97ebd91b0a libsnapshot: SnapshotMergeStats::Start/Finish
Change API for SnapshotMergeStats so that it is easier
for update_engine to use.

Test: apply OTA and look at stats
Bug: 147696014
Bug: 138817833
Change-Id: Ie4036ac7382102c00f0761f443d78e00b9e585d5
2020-03-04 11:17:17 -08:00
Ricky Wai
1a5ae50943 Fix /data_mirror permission
Test: Able to boot without error
Bug: 150671726
Change-Id: If366d284f4f01ebfa660e85bad57861c120ada7e
2020-03-04 13:30:09 +00:00
Automerger Merge Worker
e5e921b20a Merge "Refine the exported DSU status" am: 14ce87c7da
Change-Id: Ia92dfa7617cd0f921a8f307e86931510bfefc2a8
2020-03-04 09:34:58 +00:00
Howard Chen
14ce87c7da Merge "Refine the exported DSU status" 2020-03-04 09:16:47 +00:00
Automerger Merge Worker
0545b24520 Merge "snapshotctl: init reports merge statistics" am: 81f46d954b
Change-Id: I8a37c9888292d9fa7a386d81e449e87b71ea9bb9
2020-03-03 21:22:00 +00:00
Automerger Merge Worker
2a8ffdaa2e Merge "snapshotctl: send snapshot merge report metrics" am: 4d3857512a
Change-Id: Ieab97b84d894e4e3a304a9a506e9a448cc0fdf0e
2020-03-03 21:21:58 +00:00
Yifan Hong
038d6d7656 libsnapshot: Expose SnapshotMergeStats
Test: builds
Bug: 147696014
Change-Id: Ia59a3f9226628558bdd1fdb0966812c2f652190c
2020-03-03 13:19:49 -08:00
Yifan Hong
f21c7cdc4a libsnapshot: delete WaitForMerge.
Now that update_engine is responsible for initiating the
merge, WaitForMerge function becomes useless.

Bug: 147696014
Test: compiles
Change-Id: I3779bdf9dd8d1716238e21d09acf0499e3fc90a3
2020-03-03 13:19:49 -08:00
Yifan Hong
32253d92eb libsnapshot: handle errors in RemoveAllUpdateState appropriately.
In CheckMergeState / HandleCancelledUpdate, if removing update state
fails, just return the previous state. It used to return Cancelled,
and the error goes unnoticed.

Test: pass
Bug: 147696014
Change-Id: I9cb3d20c5c886afa1913740c903eaad08f0cc041
2020-03-03 13:19:49 -08:00
Yifan Hong
44b93df300 libsnapshot: remove snapshots properly after flashing
If updated then immediately flashed target slot at unverified
stage, update_engine attempts to call RemoveAllSnapshots, but
it used to fail because unmapping fails. In reality, these devices
are dm-linear targets, so unmapping them is optional.

- Introduce a GetSnapshotFlashingStatus function that expose more
information than AreAllSnapshotsCancelled. We can use the returned
map<string, bool> to determine whether a partition is flashed or
not.
- Introduce ShouldUnmapDeleteSnapshot which determines whether
unmapping / deleteting a snapshot is needed in RemoveAllSnapshots.

Test: apply OTA, flash target slot, then inspect logs
Bug: 147696014
Change-Id: I0853d1e213566af2a3401e46fac7d9586cee7aaf
2020-03-03 13:19:49 -08:00
Yifan Hong
e256e3b7d4 libsnapshot: RemoveUpdateState on rollback.
If rollback is detected in ProcessUpdateState, call
RemoveUpdateState and return UpdateState::Cancelled. Now that
update_engine is reponsible for initiating the merge, it can react to
this state and clean up markers appropriately.

Test: libsnapshot_test
Test: apply OTA, manually rollback (by setting the active slot), then
  inspect /metadata/ota as well as /data/misc/update_engine/prefs.

Bug: 147696014

Change-Id: Ibfee11fb50e4f4fb7c6cf02b4921b35e77b8f5a5
2020-03-03 13:19:49 -08:00
Yifan Hong
7fd9b8b7f3 libsnapshot: NeedSnapshotsInFirstStageMount don't test for IsRecovery
Init skips first stage mount entirely in recovery, so
the check is useless. Also, __ANDROID_RECOVERY__ is always
set for first stage init.

Also add logs if rollback indicator is set.

Fixes: 149956852
Test: apply OTA, manually rollback, reboot, see rollback indicator
Change-Id: Iac967baf4b51ea5ce9f6eb962a33cb7ee5819c1d
2020-03-03 13:19:49 -08:00
Yifan Hong
6187030652 Allow ProcessUpdateState to be paused.
Change callback type of ProcessUpdateState to bool() so that, when callback
returns false, immediately returns Merging.

Test: libsnapshot_test
Bug: 147696014

Change-Id: I9dcb8e1658b95216c0f1991e2e4c1ea2e7e7b2e5
2020-03-03 13:19:49 -08:00
Yifan Hong
9aa7bbe161 libsnapshot: Re-expose InitiateMerge and ProcessUpdateState
These functions are used directly in update_engine now that
it is responsible for initiating the merge. update_engine has
its own message loop, so WaitForMerge / InitiateMergeAndWait
becomes useless and are deprecated.

Bug: 147696014
Test: compiles

Change-Id: Id8cb14f5f18b4893e2fc3d0d2b374a867a220e6f
2020-03-03 13:19:49 -08:00
Yifan Hong
ad74121bda libsnapshot: Add prolog to RemoveAllUpdateStates.
Add an optional prolog arg (function<bool()>) that is invoked
before snapshots are deleted and update state set to none.

This allows update_engine to delete markers before deleting snapshots
to avoid depending on the erroneous markers. Otherwise, if update_engine
delete markers after libsnapshot deletes update states, the device could
technically get into a state where update_engine thinks the update has
been applied, but snapshots are gone.

Bug: 147696014
Test: libsnapshot_test

Change-Id: I71bfc04a81ea4f94b3072558be50d2f80565113e
2020-03-03 13:19:49 -08:00
Yifan Hong
6d2a79839f snapshotctl don't auto-merge.
update_engine is now responsible for initiating the merge. snapshotctl
becomes a debugging tool for libsnapshot now.

Bug: 147696014
Test: libsnapshot_test

Change-Id: Ia2527a35e0c0f0789dbe5c477e174663ef406903
2020-03-03 13:19:49 -08:00
Treehugger Robot
81f46d954b Merge "snapshotctl: init reports merge statistics" 2020-03-03 21:06:10 +00:00
Treehugger Robot
4d3857512a Merge "snapshotctl: send snapshot merge report metrics" 2020-03-03 21:06:10 +00:00
Alessio Balsini
a296f20f4f snapshotctl: init reports merge statistics
Enable the --report flag in init rc script to collect and send snapshot
merge statistics after OTA.

Bug: 138817833
Test: statsd_testdrive
Change-Id: Ie32a2c6d7d1671ca2b1846c6a8d33cea2ab22a4c
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-03-03 11:47:39 -08:00
Automerger Merge Worker
51230e4acf Merge "fastbootd: use FastbootDevice::GetCurrentSlot to get current slot suffix" am: 220b6ebd05
Change-Id: I498a98bc3e2d3c2b0bbba70763bcf9bd1d489704
2020-03-03 12:20:41 +00:00
Treehugger Robot
220b6ebd05 Merge "fastbootd: use FastbootDevice::GetCurrentSlot to get current slot suffix" 2020-03-03 12:03:38 +00:00
Automerger Merge Worker
025b239f1e Merge changes Ic2af40b8,I9c8cfebe am: 824f0095b0
Change-Id: I239af47affe95ebbf3f019e579cbe050e1d5766d
2020-03-03 06:38:55 +00:00
Treehugger Robot
824f0095b0 Merge changes Ic2af40b8,I9c8cfebe
* changes:
  Reland "adb: turn CHECKs into an error + transport restart."
  Reland "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor"
2020-03-03 06:29:55 +00:00
Automerger Merge Worker
670c58dbd8 Merge "Disable AdbPairingConnectionTest#MultipleClientsOnePass." am: 49d4dd23ca
Change-Id: I2a8a1dc3bbe26c5a88df8259c215bde32b39868a
2020-03-03 00:47:39 +00:00
Automerger Merge Worker
115af190e2 Merge "fs_mgr: remain elapsed time of fsck in prop" am: 5d4855680d
Change-Id: I057410e062f702c8543e5c9ca9f02c926d80c023
2020-03-03 00:47:32 +00:00
Joshua Duong
49d4dd23ca Merge "Disable AdbPairingConnectionTest#MultipleClientsOnePass." 2020-03-03 00:36:22 +00:00
Jaegeuk Kim
5d4855680d Merge "fs_mgr: remain elapsed time of fsck in prop" 2020-03-03 00:33:49 +00:00
Josh Gao
7b3048446d Reland "adb: turn CHECKs into an error + transport restart."
This reverts commit 2547f740ea.

Bug: http://b/134695864
Bug: http://b/133872605
Test: manually unplugged/replugged
Change-Id: Ic2af40b81354138a7842eb93aacc303885ac952e
2020-03-02 13:55:04 -08:00
Josh Gao
bfe3dac36d Reland "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor"
This reverts commit ba4684c2b2.

Bug: http://b/129283234
Test: manually unplugged/replugged
Change-Id: I9c8cfebe09b2855cab986068273a835a13247b77
2020-03-02 13:45:52 -08:00
Hridya Valsaraju
45719a8f07 fastbootd: use FastbootDevice::GetCurrentSlot to get current slot suffix
Using FastbootDevice::GetCurrentSlot to get the current slot suffix
instead of reading the same from the device's boot control HAL
is required to account for the prior set_active commands issued via
fastbootd in the same boot.

Test: fuzzy_fastboot
--gtest_filter=Conformance.Slots:Conformance.SetActive --gtest_repeat=10
Bug: 146589281

Change-Id: I2edb0f024d93c2483659623423ef5c69c717c7af
2020-03-02 13:14:11 -08:00
Joshua Duong
2e1ee8ee51 Disable AdbPairingConnectionTest#MultipleClientsOnePass.
Will re-enable once flaky failure is fixed.

Bug: 150529485
Bug: 150388912

Test: atest adb_pairing_connection_test doesn't run above test.
Change-Id: I63ac3fc2fd2d289b977dd3b9f6eccfb65866769c
2020-03-02 12:56:59 -08:00
Automerger Merge Worker
7ca2c0ddf2 Merge "fsck.f2fs: enable cache" am: 6576db1d1c
Change-Id: I8e79b35a9a3bc7dd7565319998b1746e591938af
2020-03-02 19:32:53 +00:00
Treehugger Robot
6576db1d1c Merge "fsck.f2fs: enable cache" 2020-03-02 19:18:27 +00:00
Jaegeuk Kim
c461e16d05 fsck.f2fs: enable cache
Bug: 149418646
Bug: 149844577
Bug: 111241572
Bug: 134988435
Change-Id: I8f5a9701442302339f7b5880133a960e89114b55
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-03-02 09:18:53 -08:00
Automerger Merge Worker
f53cca4d26 Merge "Observe new apexd status value of "activated" as required." am: 2f11663fc9
Change-Id: I9d279cc422fcae2bf8828081d7304de10baf9832
2020-03-02 10:33:47 +00:00
Oli Lan
2f11663fc9 Merge "Observe new apexd status value of "activated" as required." 2020-03-02 10:24:21 +00:00
Automerger Merge Worker
aebe5f91b0 Merge "Fix missing Result::ok() call in init" am: 8d144f6612
Change-Id: I37ecbf07fe122fa4998f3cb174e96e49b94f5181
2020-03-01 15:24:03 +00:00
Bernie Innocenti
8d144f6612 Merge "Fix missing Result::ok() call in init" 2020-03-01 15:14:39 +00:00
Automerger Merge Worker
ea7af90e3e Merge "Mark updatable APEXes" am: ab8a7e35ec
Change-Id: Iaa4dba96e1ad565094c054d6d35b2e6b845d3c09
2020-03-01 00:41:22 +00:00
Jiyong Park
ab8a7e35ec Merge "Mark updatable APEXes" 2020-03-01 00:39:18 +00:00
Automerger Merge Worker
def80b3e9d Merge changes from topic "userspace-reboot-bootstrap-namespace" am: 3efe4c37ea
Change-Id: I3d9b641eb81a2ceb247a543fc02ed01003d4474f
2020-02-29 13:13:59 +00:00