libsnapshot_init is linked by microdroid. Adding libselinux as whole_static_libs in `libsnapshot_defaults` will bloat the super image of microdroid.
Instead, statically link libselinux for libsnapshot_init.
On Pixel 7 Pro:
Microdroid super image: 47173836
Baseline (Without this change): 47161548
Bug: 362839899
Test: Build, verify microdroid super image size.
Change-Id: I3c589097173b305c1d39af9edbfb8c5e29f21410
Signed-off-by: Akilesh Kailash <akailash@google.com>
We want to avoid the usage of size_t for any integer value that could
exceed 2^32 (for 32 bit platforms). Let's update the usage here for
future compatibilty and avoid silent truncation failures.
Bug: 361048795
Test: th
Change-Id: I9ce2ca21706270a218f06f7d2b7dc9fade185a68
F2FS does not support page_size!=block_size configuration, and
dev option devices need to toggle between 4K/16K mode, hence F2FS
requires a data wipe every time page size changes. This is inconveinent,
skip F2FS formatting instead.
Test: th
Bug: 353436188
Change-Id: Ic33dbc39c16db3aee4c47349a9693aacec240de8
snapshot metadata files are stored in /metadata. This means, we cannot
wipe after installing any update.
This patch does the following:
1: Create a scratch space in super partition. The scratch space for ota
metadata is just about 1MB.
2: Create ext4 filesystem on top of scratch block device.
3: Mount the scratch on /mnt/scratch_super
4: When snapshot-manager instance is created, point the /mnt/scratch/ota
to metadata_dir_ so that all the snapshot files are stored in the new
path.
All the logic of OTA remains the same. This flow is enabled only on userdebug builds for now and the only consumer would be snapshotctl
$snapshotctl apply-update /data/nbd/ -w
During init, we would have to mount the scratch partition to detect
if there is any pending updates.
With this, we would now be able to wipe the device along with the update flow. This will help incremental flashing wherein we would end up saving ~35-40 seconds on Pixel devices.
With this flow, the end-to-end update for incremental builds takes
~20-30 seconds.
Bug: 330744468
Test: Pixel 6 incremental flashing with wipe, Full OTA, vts_libsnapshot
Change-Id: Iac6ce2cf37b70ea221cd18175c8962988d03d95b
Signed-off-by: Akilesh Kailash <akailash@google.com>
If bootconfig hibernation_resume_device is present in boot config, then
we write that value to /sys/power/resume
Bug: 339688542
Test: Check resume from hibernation/boots with/without config present
Change-Id: I1a9bf63af4dab07e494740722898c1aba33c00b5
for things that works in VTS, they should be buildable in general-tests
zip rather than device-tests. Which is cheaper in term of build resources.
The underlying issue should have been fixed in b/349278999
Change-Id: I611db1d60bd5b29f42f3404ed8b313024aca39ce
Test: presubmit
Bug: 358400696
This reverts commit 61c07a09e8.
Reason for revert: Likely culprit for b/359414718 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: Ie40dcc6d3549183ba146c4ff37edc0d1e57d0cca
This refactors HandleImminentDataWipe to address some shortcomings
discovered through testing. Previously, it always called
CreateSnapshotsAndLogicalPartitions, which meant trying to use snapuserd
even if completely unnecessary.
Instead we now peek at the update state and eliminate the "easy" cases
ahead of time. These are "none", "initiated", and "unverified" when
either a rollback happens or there is no forward merge indicator. In
this case we simply return early and allow the wipe to continue
(disabling the current slot if necessary).
The hard case, when a merge is needed, is still handled within
ProcessUpdateStateOnDataWipe. However it's no longer recursive, and it
can assume a merge is about to initiated or already in progress.
In all cases except a merge failure, we change the update state to None
to clear any roadblocks update_engine or the bootloader might encounter.
A merge failure, however, still blocks a data wipe. The way to recover
from this is adb sideload.
Bug: 350613336
Test: vts_libsnapshot_test
wipe in INITIATED state, no merge
wipe in UNVERIFIED state, no merge
wipe in UNVERIFIED + rollback state, no merge
wipe in MERGING state, merge
Change-Id: I387aabcfa6304118be88ddbb85842111d5c2ef6a
For Android 12 vendor project, SnapshotTestEnvironment setup is skipped. So, test_device is not initialized, which will cause other tests to fail.
Change-Id: I6ce6a9e7ea2c210e25c2a5ffadaaa6348086ea7f
BUG:350678717
Test:run vts -m vts_libsnapshot_test
Original CL reverted due to missing permission on vold.
The missing permission is added in aosp/3202313 , hence re-submit.
This reverts commit 1f00f794e6.
Reason for revert: b/349507086
Change-Id: Ia1086f3c8c65c476bdc119fe59ed4fd3a21f8591
This removes implicit assumption that BufferSink can only be used with
dm-user. User of BufferSink can specify size of header during
BufferSink::Initialize to reserve the space for the header.
Also get rid of now unused structure dm_user_payload and
dm_user_message.
Test: TH
Test: ota
Test: vts_snapused_test
Bug: 357711761
Change-Id: I1e550393ce1f0277fe215015fa6948ad3c3b68ba
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
Mount option "nomblk_io_submit" was deleted from
upstream kernel v3.9 in 36ade451a5d736e61ac8302b64aacc5acb5e440f
and has not reappeared since then.
Now it only generates 'Ignoring removed nomblk_io_submit option'
in the logs
Test: manual
Change-Id: Ie609e7d3d38e808eeede1f1c55435ed027726025
This CL adds a check to ensure that there is enough free space on
the device before creating the zram backing device.
If there is not enough space, the zram backing device will not be
created.
Adding a system property 'ro.zram_backing_device_min_free_mb' to
define the minimum free space reserved for booting.
If the property is not set, skip the available space check.
Bug: 322821637
Bug: 326877642
Test: Fill up userdata, enlarge zram backing device size on next
boot.
Change-Id: I135b4beee2a8a21f8214f6579368a8d0d8792255
If we're partially through setting up metadata encryption, failures
leave the partition in a known bad state, and we can avoid an eventual
boot into recovery by taking the format path.
Bug: 351704691
Test: Inserted debug code to reboot during initial encryption setup
Verified device boots successfully on second attempt
Change-Id: I2d8591fa68ab0656e42b7b12f69001a5897e1a61
This reverts commit c6dfdbb761.
Reason for revert: Likely culprit for b/356319388 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: Ibd85b26a02f0278676f330c6825d3cb15eefe3fc
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices
that have config_multiuserVisibleBackgroundUsers enabled. The main use
case is Automotive's multi-display Whole Cabin experience where
passengers (modeled as visible background users) can interact with the display
in front of them concurrently with the driver (modeled as the the
current user) interacting with driver's display.
Bug: 349714805
Flag: EXEMPT test fix
Test: atest CtsFsMgrTestCases
Test: atest --user-type secondary_user_on_secondary_display CtsFsMgrTestCases
Change-Id: I0e4498fd431f5c70135d8704f1d2fa5476620ef1
Add test to make sure that setting the protobuf successfully propogates
the gflag argument to snapuserd_handler.
Bug: 332255580
Test: th
Change-Id: Ic7a008bee7dd3ca29faa0a5409f0513f1551bf37
Set op processing window during snapshot merge from the build. The lower
the merge count, the lower the memory strain during the merge process
Bug: 332255580
Test: verify merge_size propogates to snapuserd daemon
Change-Id: Ic7770115bca963d923a7a276897c5deac30f9faf