For currently unknown reasons, sideloading is broken with
libadbd_services as a cc_library_static.
Partial revert of commit a9b62d5452.
Bug: http://b/151056300
Test: xunchang@ tested manually
Change-Id: Iaffad9c476ba0adcffc5db512ba4a7ee0fb5cb22
(cherry picked from commit 7f8a37c8c7)
In case of GSI on DSU, /data is mounted on the following stack:
userdata -> userdata_gsi -> actual block device, and fstab returned from
ReadDefaultFstab() function will say that /data should be
mounted onto userdata_gsi. This configuration wasn't supported.
To support it, fs_mgr_get_mounted_entry_for_userdata now unwinds the
dm-device stack /data is mounted onto, and for each entry in fstab
resolves corresponding block device (in case of logical partitions by
asking DeviceMapper to resolve name -> path, and for other cases by
reading a symlink), and then checking whenever resolved block device
belongs to the unwinded stack.
Test: on both normal boot & DSU
Test: atest CtsUserspaceRebootHostSideTestCases
Test: atest CtsFsMgrTestCases
Bug: 148612148
Change-Id: I1bb3e64ae92d56de905b4f7f1997b7499b101b0f
In case multiple threads try to reference this variable while it is
being set, it should be atomic so that all threads always see a valid
value.
Bug: 150898477
Test: liblog, libbase unit tests
Merged-In: If6c9e291f2471b96a752dc6e76e3e63458b71391
Change-Id: If6c9e291f2471b96a752dc6e76e3e63458b71391
(cherry picked from commit bbb16022c7)
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
(cherry picked from commit 64ff82ba68)
When libbacktrace.a is statically lined to somewhere, that library had
to add libasync_safe.a to static_libs because libbacktrace.a has
references to libasync_safe.a. But libbacktace depending on
libasync_safe is an implementation detail of libbacktrace, and therefore
its client shouldn't be affected by it.
Fixing this by doing the whole static link to libasync_safe to
libbacktrace.a so that the former is included in libbacktrace.a
Bug: 149569129
Test: m
Change-Id: If7366a240bc945dda9944fe7c111e10d328165bb
libbase is a popular library that is used by many APEXes either directly
or transitively. It is being used by several Mainline modules that were
launched with Q, in which case everything in the APEX - including
libbase - shouldn't use new APIs that are added post Q, i.e. R.
libbase however is using a few new R symbols from liblog, and this is
preventing those Q-launching Mainline modules that are built in R source
tree from being installed to Q devices.
Fortunately, the dependencies to the new R symbols are guarded with a
flag; when the existence of the symbols are not guaranteed, it uses
dlsym. This change fixes the aforementioned problem by turning on the
flag also when libbase is built for an APEX.
Bug: 149569129
Test: TARGET_BUILD_APPS=com.android.media
vendor/google/build/build_mainline_modules.sh
adb install --staged out/dist/mainline_modules_arm64/com.android.media.apex
adb reboot
The APEX is installed and mediaextractor process doesn't crash
Change-Id: I44b5ec028850613cb45fc3e792f43cd8e87cfd00
This reverts commit faa49d1d00.
Reason for revert: Callstack should not be logged.
Test: none
Bug: 148818798
Change-Id: Ie5506ae0c7408e255a464b2f403d0a47d272229e
Now that update_engine is responsible for initiating the
merge, InitiateMergeAndWait function becomes useless.
Bug: 147696014
Test: libsnapshot_test
Change-Id: I5473dc543ca8ac2fd31f597720847b02d0e5e33d
Also fixes a bug in the tests where the platform version was being
checked by querying version.release instead of version.codename
(currently, version.release == 10, while version.codename == R).
Test: bit libstatspush_compat_test:* (on Q and R)
Test: libsstatssocket.so is not placed in resolv apex (on R)
1|bonito:/ $ ls apex/com.android.resolv/lib64
libclang_rt.ubsan_standalone-aarch64-android.so
libcrypto.so
libnetd_resolv.so
libssl.so
Test: NETWORK_DNS_EVENT_REPORTED atom is logged to statsd (on R)
- adb shell cmd stats print-stats (atom 116 count > 0)
Bug: 148743333
Change-Id: Ib3eaa32835905bcf6e3b003054bf0f3c4e7ec0a4
Merged-In: Ib3eaa32835905bcf6e3b003054bf0f3c4e7ec0a4
(cherry picked from commit 9848eb4f1c)
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
On userdebug/eng devices, check a system property to see whether we
should create tombstones or not. OEMs that would rather have core dumps
can set this property and configure /proc/sys/kernel/core_pattern
appropriately.
Bug: https://issuetracker.google.com/149663286
Test: set the property, cause a crash
Change-Id: If894b4582a1820b64bdae819cec593b7710cb6e3
(cherry picked from commit 530ab81e42)
am skip reason: Change-Id I1232fec5f1d0be7e5fb6aa5c46f6c2c5529bfc6c with SHA-1 8e77b789f8 is in history
Change-Id: I0e13c779e06c07a648e4ac8ccbfeec437f4dbb7a
The rollback indicator is created during first stage init and
is unlabeled. Need to restorecon it properly so that it can
be properly deleted by update_engine later.
Bug: 149956852
Bug: 150907679
Test: apply OTA, reboot, look at serial console
Change-Id: Ie954023b557865691fec2ae378145596bf1973a9
adb remount and snapshot-based updates use ImageManager in first-stage
init. This creates status files, which need to be labelled.
Bug: 148834619
Test: manual test
Change-Id: I72949fca2889f9e5612049844a78bf9355b48797
Merged-In: I72949fca2889f9e5612049844a78bf9355b48797
The original CL was missing these.
Bug: 149591522
Test: build
Merged-In: I99615b81cfe9166a00c812a8642ecf1244bf08b9
Change-Id: I99615b81cfe9166a00c812a8642ecf1244bf08b9
(cherry picked from commit d620ec7fb9)
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
Merged-In: Ie4036ac7382102c00f0761f443d78e00b9e585d5
Now that update_engine is responsible for initiating the
merge, WaitForMerge function becomes useless.
Bug: 147696014
Test: compiles
Change-Id: I3779bdf9dd8d1716238e21d09acf0499e3fc90a3
Merged-In: I3779bdf9dd8d1716238e21d09acf0499e3fc90a3
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
Merged-In: I9cb3d20c5c886afa1913740c903eaad08f0cc041
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
Merged-In: I0853d1e213566af2a3401e46fac7d9586cee7aaf
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
Merged-In: Ibfee11fb50e4f4fb7c6cf02b4921b35e77b8f5a5
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
Merged-In: Iac967baf4b51ea5ce9f6eb962a33cb7ee5819c1d
Change callback type of ProcessUpdateState to bool() so that, when callback
returns false, immediately returns Merging.
Test: libsnapshot_test
Bug: 147696014
Change-Id: I9dcb8e1658b95216c0f1991e2e4c1ea2e7e7b2e5
Merged-In: I9dcb8e1658b95216c0f1991e2e4c1ea2e7e7b2e5
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
Merged-In: Id8cb14f5f18b4893e2fc3d0d2b374a867a220e6f
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
Merged-In: I71bfc04a81ea4f94b3072558be50d2f80565113e
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
Merged-In: Ia2527a35e0c0f0789dbe5c477e174663ef406903
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>
Merged-In: Ie32a2c6d7d1671ca2b1846c6a8d33cea2ab22a4c
Some tests were temporarily disabled due to errors in Cuttlefish.
Now that the issues were fixed, the tests can be put back in presubmit.
Bug: 148889015
Test: vts_libsnapshot_test (Cuttlefish + Pixel 4)
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: Idcb2b7831b2183b2d734bdf8821fd34746f2beee
Merged-In: Idcb2b7831b2183b2d734bdf8821fd34746f2beee
Test: Able to boot without error
Bug: 150671726
Merged-In: If366d284f4f01ebfa660e85bad57861c120ada7e
Change-Id: I9d85c00d191dcaa46c0182b5a15cd89dcdb9ea5e
(cherry picked from commit 1a5ae50943)
The new exported DSU status removes the need to make blocking binder
calls out of system server during device boot.
Bug: 149790245
Bug: 149716497
Test: adb shell am start-activity \
-n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
-a android.os.image.action.START_INSTALL \
-d file:///storage/emulated/0/Download/system.raw.gz \
--el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
--el KEY_USERDATA_SIZE 8589934592
Change-Id: I27fae316214498407a73474ca8b93aec3518e4b5
Merged-In: I27fae316214498407a73474ca8b93aec3518e4b5
(cherry picked from commit 2e1c6b26a1)