Commit Graph

56810 Commits

Author SHA1 Message Date
Nikita Ioffe 30b0c01dd8 Move GetMountedEntryForUserdata to fs_mgr.h
Logic of unwinding dm-device stack to figure out what entry was used to
mount userdata turned out to be a little bit more involved, and it
shouldn't be part of libfstab

This CL just moves code around and cleans API a little bit, actual fix
will be in the follow-up CL.

Test: atest CtsFsMgrTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 148612148
Change-Id: If0f8a765dba63adb0e6a711eb81fffdcabea3480
Merged-In: If0f8a765dba63adb0e6a711eb81fffdcabea3480
(cherry picked from commit 8f50cfc28d)
2020-03-06 19:50:10 +00:00
Ian Kasprzak e6e87fd705 Revert "Fixed a typo in the version name"
This reverts commit eb94c7802d.

Reason for revert: b/150949964 - Broke boot test on aosp-master-with-phones.

Merged-In tags to revert just aosp-master/stage-aosp-master where boot
is broken.

Change-Id: Ic76e36b42060b5948f48af41f67544598d6f9f87
Merged-In: I0e1e7da1cfbe320ba6605f8de9dcdb5091c41e4f
Merged-In: Icff3bd68b31f8c1d5a71f05c7c52eae6e896bfc2
2020-03-06 19:38:13 +00:00
Elliott Hughes 151e74894f Merge "debuggerd: add an opt-out for OEMs that would rather collect core dumps." 2020-03-06 17:17:51 +00:00
Josh Gao 64ff82ba68 adb: defer acknowledgement of pushed files until the end.
Previously, we were waiting for the other end to respond after every
file sent, which results in massive slowdown when there's any amount of
latency on the transport.

This improves performance on a cuttlefish instance with ~7ms RTT from:

    system/: 2037 files pushed, 0 skipped. 2.8 MB/s (762803979 bytes in 262.964s)

to:

    system/: 2037 files pushed, 0 skipped. 11.9 MB/s (762803979 bytes in 61.278s)

Bug: https://issuetracker.google.com/150827486
Test: ./test_device.py
Change-Id: I3a0c893faa5d455cc6ccbc86915a17e1b5abbfbe
2020-03-05 19:48:11 -08:00
Jiyong Park fd4e66221a Merge "Fixed a typo in the version name" 2020-03-06 00:53:07 +00:00
Elliott Hughes 14dc6ad240 Merge "run-as: improve error messages." 2020-03-05 23:51:57 +00:00
Treehugger Robot 561df7bfb3 Merge "liblog: Fix bugprone-macro-parentheses warnings" 2020-03-05 22:44:04 +00:00
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 58c88615f2 Add new directory for stats metadata
Also reordered the directories in alphabetical order

Test: m -j
Bug: 149838525
Change-Id: I1a918d189d8bcb394ec6f818d033dbf7e4518713
2020-03-05 08:53:11 -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
Luca Stefani dfdbae0e11 liblog: Fix bugprone-macro-parentheses warnings
Change-Id: I91ab6d578e459b351468c0b6fc4b76b5f53d2441
2020-03-05 12:01:32 +01: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
Elliott Hughes 4a77a84a55 run-as: improve error messages.
Include the relevant argument when reporting failed calls.

Test: treehugger
Change-Id: I49c691d9edfb825dfee22ab5eb57e7d025c08c21
2020-03-04 18:11:18 -08: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
Jiyong Park eb94c7802d Fixed a typo in the version name
Bug: 149569129
Test: m
Merged-In: I7401e8c092d4ee329fb1b5f23b7797f706b58faa
(cherry picked from commit 3d79b37a41)
Change-Id: I7401e8c092d4ee329fb1b5f23b7797f706b58faa
2020-03-04 12:03:04 +09: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
Howard Chen f6abdf6e0d Convert gsid to use the dynamic AIDL service infrastructure
Replace the original on demand start mechanism with the new dynamic
AIDL service infrastructure to resolve a possible race condition.

Bug: 149130673
Test: gsi_tool status

Change-Id: Ia5f32579a8dcf62d700d974c7f4e3c65647f3b8b
2020-03-03 17:44:32 +08: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