Commit graph

56703 commits

Author SHA1 Message Date
Automerger Merge Worker
d3cc4e8dcf libsnapshot: Expose SnapshotMergeStats am: 038d6d7656
Change-Id: I77d3a1a67c9e75dd6a5bc0c59a92a89a01fa1ba6
2020-03-05 17:01:15 +00:00
Automerger Merge Worker
7d6832e97a libsnapshot: delete WaitForMerge. am: f21c7cdc4a
Change-Id: I6d8cf854d8ddce2635d3b944352f4218d40f248e
2020-03-05 17:01:09 +00:00
Automerger Merge Worker
64aa390f62 libsnapshot: handle errors in RemoveAllUpdateState appropriately. am: 32253d92eb
Change-Id: I30032e9dfa6a52b4e86bba2d3ccd5322f17699c5
2020-03-05 17:01:07 +00:00
Automerger Merge Worker
354b06ff10 libsnapshot: remove snapshots properly after flashing am: 44b93df300
Change-Id: I3358ca3c6648888daf62f58e1048e630b5b83afe
2020-03-05 17:01:05 +00:00
Automerger Merge Worker
65b6aad759 libsnapshot: RemoveUpdateState on rollback. am: e256e3b7d4
Change-Id: I6f106aa8f07945bcbd4842dadfccd0e028ecda30
2020-03-05 17:01:03 +00:00
Automerger Merge Worker
08e358c1a3 libsnapshot: NeedSnapshotsInFirstStageMount don't test for IsRecovery am: 7fd9b8b7f3
Change-Id: I67862ddd443805f765fc26d6c349107e57ad9591
2020-03-05 17:01:00 +00:00
Automerger Merge Worker
b5289b034d Allow ProcessUpdateState to be paused. am: 6187030652
Change-Id: I93424dc17e061c03efe49064b48e6c66caebc854
2020-03-05 17:00:58 +00:00
Automerger Merge Worker
b054406712 libsnapshot: Re-expose InitiateMerge and ProcessUpdateState am: 9aa7bbe161
Change-Id: I6eef9b3292e8d0ae3568e93c63a86702913643a2
2020-03-05 17:00:56 +00:00
Automerger Merge Worker
c7438b5ed3 libsnapshot: Add prolog to RemoveAllUpdateStates. am: ad74121bda
Change-Id: I5ca918969c0986b9cea20ce583571654394fbd36
2020-03-05 17:00:53 +00:00
Automerger Merge Worker
5b13c2cb27 snapshotctl don't auto-merge. am: 6d2a79839f
Change-Id: Ie66d2d290b921c066ef7e6c2ca848749c52f37ce
2020-03-05 17:00:50 +00:00
Automerger Merge Worker
b192a8111a Merge "Fix /data_mirror permission" am: 541d0d28b1
Change-Id: I9d85c00d191dcaa46c0182b5a15cd89dcdb9ea5e
2020-03-05 10:18:24 +00:00
Alan Stokes
541d0d28b1 Merge "Fix /data_mirror permission" 2020-03-05 10:02:35 +00:00
Automerger Merge Worker
9c6bd26292 Merge "fix some liblp file access for win32" am: 5dbd893784
Change-Id: I31fb233228f93a190a5d67f658dd0cd92ce7e534
2020-03-05 03:15:00 +00:00
Treehugger Robot
5dbd893784 Merge "fix some liblp file access for win32" 2020-03-05 03:01:41 +00:00
Automerger Merge Worker
a699c9e154 Merge "Create a ProcessInfo structure with the process-wide information from the crasher." am: 017a0acdca
Change-Id: Ib5c6eb84929dd808325d2589af71c6c07c216420
2020-03-05 01:45:15 +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
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