Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 12.1 #1

Open
wants to merge 2,563 commits into
base: android-10.0
Choose a base branch
from
Open

Android 12.1 #1

wants to merge 2,563 commits into from

Conversation

anticop
Copy link

@anticop anticop commented Apr 24, 2023

H

android-build-team Robot and others added 30 commits March 12, 2021 02:09
Change-Id: I24114565d80d1e15a7f2d5f65b770d7b5b705134
Change-Id: I84d4a5733c4ca380076cbe2b04608b69aa78f8c8
Bug: 180535575
Test: apply OTA, snapshotctl dump
Change-Id: Iedd761b2f6923a56b11f9d6868d6baf569ad38d0
When DynamicPartitionControlAndroid is constructed, it initializes both
source and target slot to -1. These values get updated during
PreparePartitionsForUpdate call. And we only
PreparePartitionsForUpdate() when applying an OTA or applocating space
for an OTA(not when verifying OTA metadata). Which means if
VerifyPayloadApplicable() is called before any call two other APIs, we
could be using an "Uninitialiazed"  dynamic partition control.

To mitigate this problem, we pass in source_slot at ctor of
DynamicPartitionControl, also make IsDynamicPartition() api take in a
slot number to avoid reading uninitialized member fields.

Bug: 181643302

Test: apply an OTA, abort, restart update_engine, verify a payload
Change-Id: I9a8a0fe8a9aca48e91241e15bdec33a1c1228553
Bug: 172911822
Test: atest ApexHandlerAndroidTest (checked that file was created)
Change-Id: I8024695ebba1a9c1796c05b27a0eec3da3b3d1bc
Test: th & serve an OTA with veity enabled, vabc disabled
Change-Id: Ib1d5549ac615504a47c96a12b046975cfff01886
Change-Id: Idc12cd8be88fea2999672d59960d632872fc2df6
Change-Id: I4433bd8a409846cdae329635970a909c31b93c40
Change-Id: Ie8be28c5a38d90e601388635d4bd858ed4ccebb4
If we don't unmap partitions, snapuserd will keep running in the
background and do nothing. Unmap partitions so that memory associated
with daemon can be freed.

Test: th, apply an OTA, verify that _b partitions in /dev/block/mapper
are gone
Change-Id: I4a75f4abe3e69f9ad2a67a78472b61cfbd77b0eb

Change-Id: Icacf1699a32bf045c2b832f7c1f021d90805d676
Verity that we read everything in hashtree_data_extent before writing
hash tree.

Bug: 173432386
Test: th
Change-Id: I00ab8053de71b13991adaa243b6cb6c7efd6e60f
Change-Id: I866142205afbde97bf289c9ef032fb8b8f69330f
iskim517 and others added 29 commits June 24, 2021 23:44
Change-Id: I5b3e1cdef5b180d754964c5b51d248d78763c2dd
Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Completely migrate init first stage to Soong"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Update init_first_stage"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert "Add BOARD_BUILD_SYSTEM_ROOT_IMAGE to config vars"

Revert "Add install_in_root to cc_binary"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert submission 15071196-init_first_stage_soong

Reason for revert: fixes b/192248690
Reverted Changes:
I23cf4f975:Add ramdisk_available to init_first_stage's deps
Icd98c7e24:Add ramdisk_available to init_first_stage's deps
If9da9ba16:Add ramdisk_available to init_first_stage's deps
Ibc8668029:Add ramdisk_available to init_first_stage's deps
I3b4b8c475:Add ramdisk_available to init_first_stage's deps
I59cd149e0:Completely migrate init first stage to Soong
I36d789578:Add ramdisk_available to init_first_stage's deps
I2a0daa612:Add BUILD_USES_RECOVERY_AS_BOOT to soong config
Ic76c325ce:Directly create ramdisk dirs in ramdisk image rule...
I4c5374deb:Add BOARD_BUILD_SYSTEM_ROOT_IMAGE to config vars
I8aab5faf3:Add ramdisk_available to init_first_stage's deps
I9d5a10661:Add ramdisk_available to init_first_stage's deps
Iaa2edeb4a:Add ramdisk_available to init_first_stage's deps
I7cb582ca0:Update init_first_stage
I06091d15e:Add ramdisk_available to init_first_stage's deps
I8bdb8dda3:Add ramdisk_available to init_first_stage's deps
I7436b8dd1:Add ramdisk_available to init_first_stage's deps
I39693fd86:Add ramdisk_available to init_first_stage's deps
I0a9ba90f0:Add ramdisk_available to init_first_stage's deps
Ib66b4c4ea:Add ramdisk_available to init_first_stage's deps
I31ce63d23:Add ramdisk_available to init_first_stage's deps
Icb580f97c:Add ramdisk_available to init_first_stage's deps
I044a075b7:Add ramdisk_available to init_first_stage's deps
I33164a7e7:Fix ndk and aml arch order
Ib8d92904a:Add ramdisk_available to sysprop_library
Ibc3516453:Add install_in_root to cc_binary

Change-Id: I7c7f5feaca6e8e78a3334932847da14e46e4f01a
This also adds a manual call to WriteState(). If update_engine crashes
or the device reboots, it's possible that certain stats (such as the COW
file stats) will be gone by the time the merge state is recovered.
Forcing a write prevents this.

Note that the write was previously implicit in set_cow_file_size, but is
now explicit before calling InitiateMerge().

Bug: 188909957
Test: manual test
Change-Id: I27cdc72272a9fa4ff5df4968e200fc14f63d0146
Merged-In: I27cdc72272a9fa4ff5df4968e200fc14f63d0146
Bug: 188909957
Test: manual test
Change-Id: I108c20cf1e092478be2ae59701514f32d9b0a9f3
Merged-In: I108c20cf1e092478be2ae59701514f32d9b0a9f3
Change-Id: I42ea76ecaaeab7962b8e9af5d7d564b6d0b5ab7d
Change-Id: I30d873a8bfdd5cb0996d575adf89975aa8a4ce56
Test: th
Bug: 194661607
Bug: 194779085

Change-Id: I0e37136313914f1ee9a4eae0e5db59807adc7dc5
Merged-In: I0e37136313914f1ee9a4eae0e5db59807adc7dc5
Change-Id: I4df8fea97335e94d5f43d571ddbac43ad7b99db6
This reduces size of SP2A.210827.001-to-SP2A.210903.001.zip OTA
package from 83MB to 66MB. Which is ~21% improvement.

Tests: th
Bug: 199920825

(cherry picked from commit dc1f258)

Change-Id: I10fa03401e5920c633c3ce5d6cf737489fecb6de
Merged-In: I10fa03401e5920c633c3ce5d6cf737489fecb6de
Change-Id: I2dcfdf37efd292a57585c0f5ab1861867beaacff
Change-Id: I0ce626ef993c2a7c87e03f705ef2e866a3391db1
Change-Id: Ie450f500460fca282a78f338a4b50f55dceed450
Change-Id: I19800c02cd4f26ae54c35a45ef8bc927459d5672
Change-Id: I894c680f5d179b715cd3e4330045d81a40f21732
…in update file

Change-Id: Icb48720791812afed7741eb02ab15176f60d7350
(cherry picked from commit 70af8d5)
Change-Id: I89e80641a6154b5de4ecae6ccaf9b01cd73b0036
Change-Id: I33e38472579a145bb6858963eed74d96ee7078a2
These commits break full payload zip flashing on multiple devices

----------

Revert "conditionally allow creating snapshots for incrementals"

This reverts commit 37a06f4.

Revert "force PrepareSnapshotPartitionsForUpdate to fail in recovery"

This reverts commit f283598.

Change-Id: Ic54d7d31082c9b7722cc1e7c30660deea00b0d5b
Change-Id: I6d55638812cac29ea4d4cdd79b932a3f15c42b0a
Allows incremental update zips to be installed on virtual AB devices

Change-Id: I5b0115e50967cdacf47f13f5fc0107580ff52a7d
Change-Id: I96cc42fe22a460a0af834a30a335c3f190fc0e58
The override is needed in cases where update_engine erroneously concludes that there isn't sufficient space for dynamic partitions.

This prevents some ROMs from being flashed. This patch allows the available space to be overridden, via a prop (ro.dynamic.full_size).

In a typical situation where this problem occurs, you will see something like this in the recovery log:
'update_engine_sideload E 12-17 04:06:00   809   809 [ERROR:dynamic_partition_control_android.cc(830)]
The maximum size of all groups for the target slot (9126805504) has exceeded allocatable space for dynamic partitions 9125756928'

So, update_engine has used a calculation of the allocatable space that doesn't match the actual available space.

In this example, running "resetprop ro.dynamic.full_size 9126805504" via runatboot.sh or postrecoveryboot.sh will override the allocatable space and allow the ROM to flash.

If the prop is used, the override will only be triggered if the value supplied is higher than the calculated allocatable space.

If the prop is not used at all, then everything will carry on as normal.

Change-Id: I25e69d416c3cd0c766901bed0119e74b4708fbca
bigbiff pushed a commit that referenced this pull request Nov 2, 2024
Current check point works by writing different prefs to different files
under a pending directory, and rename the pending directory to actual pref
directory afterwards to achieve atomicity. It has two pitfalls:

1. Before the rename() call, existing prefs dir must be rm -rf'ed , this
   deletion process isn't atomic. If device rebooted during rm -rf, we
   will end up with a partially deleted old pref.

2. fsync() on the parent directory is needed after rename()

This CL addresses both issues. For #1, we rename() the old pref dir to a
tmp dir first, and then rm -rf the tmp dir. Upon device restart, if the
current prefs dir is empty, we can simply rename() the pending directory
to actual pref directory.

Test: th
Bug: 295252766
Change-Id: Ic671a18245986c579b51d7443c3e8c10e206c448
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.