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)
WaitForFile/WaitForDeletedFile both early return true if an error like
EPERM occurs. This was intentional because the code was modeled off
earlier fs_mgr code, but it makes libdm inherently racy if sepolicy is
not configured correctly. It's better to have these result in explicit
and consistent failures.
Bug: 148103327
Test: fastboot flashall
Change-Id: I0c78818962e1db91b556e523c418db28f7d78fae
Merged-In: I0c78818962e1db91b556e523c418db28f7d78fae
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
Merged-In: I2edb0f024d93c2483659623423ef5c69c717c7af
* changes:
Stop & Resume property service when switching to bootstrap namespace
init: handle property service callbacks asynchronously
Refactor libinit_test_utils to not use libinit and expose its libraries
am skip reason: Change-Id I6bc1e068368e64cb0bbf6ef63805444b35a1fdfb with SHA-1 a2ac846ff3 is in history
Change-Id: Ib423d80893de7cf45e231221764b1e1d99ea21bb
am skip reason: Change-Id Iaa7521ef40b94f13fe3c9c61d276678f47c60b98 with SHA-1 b697d47eb3 is in history
Change-Id: Ib97982ceb61dc853f2080ec8205e7cff7ced2b65
Add some requested logging options that can be turned on at runtime
without having to restart adbd.
Bug: http://b/141959374
Test: manual
Change-Id: Ib97acc6d199e0b91238a6758e18b7cb75f8688d9
(cherry picked from commit 52d0b67f19)
If we get unlucky and something else (or ourselves, in another thread)
beats us to listening on our hardcoded ports, we can deadlock.
Bug: http://b/149829737
Test: ./test_adb.py
Change-Id: I8f14004a6b2e77366abad6e88786ea8941629020
(cherry picked from commit e8829c6bfc)