Commit graph

84443 commits

Author SHA1 Message Date
Treehugger Robot
a7d2ddb1cd Merge "Add static_assert to check sizeof off_t" into main am: 53a71f6b18
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2754946

Change-Id: I88a516d5cc76f06a142c75ea1b07dd4c21acedd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 23:15:42 +00:00
Treehugger Robot
53a71f6b18 Merge "Add static_assert to check sizeof off_t" into main 2023-09-18 22:39:48 +00:00
Daniel Zheng
445d13f73f Merge "Add CowOperationV2" into main am: a10bfe1d13
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2736100

Change-Id: Ib2c7b4cdc556db7e594c2a1df8b3117ec986471b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 22:21:49 +00:00
Daniel Zheng
a10bfe1d13 Merge "Add CowOperationV2" into main 2023-09-18 21:30:29 +00:00
Akilesh Kailash
6ea36bd1e4 Add static_assert to check sizeof off_t
Add compile time flags which got dropped during refactoring.

Bug: 300178204
Test: Build on 32-bit userspace
Change-Id: I16be0973cb2cb2e174ff98c8b10fde27f997e4ab
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-09-18 14:09:27 -07:00
Daniel Zheng
cc44c37468 Updating comments on cow layout
Updating comments to match current format. Scratch space exists in
between header and operation

Test: th
Change-Id: I2f86e9dc4078f03370cdc38918136c894c6ca484
2023-09-18 14:02:17 -07:00
Daniel Zheng
d2ad53cf81 Add CowOperationV2
this is going to replace the current version of CowOperation and will
work with writer v2 and parser v2. This will be the on disk format of
the cow, while CowOperation will be updated to be the in memory format
of 15 bytes (implicitly will be the v3 version).

Test: m libsnapshot

Test: m libsnapshot
Change-Id: Ibd00ef014a9fc11cdf2bad97c52462db8eef9502
2023-09-18 12:47:59 -07:00
Akilesh Kailash
5fdf90777e Merge "Compile with -D_FILE_OFFSET_BITS to support 32-bit userspace" into main am: 81400915ef
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2753909

Change-Id: Ic0411e9cf2f10abdb2ce0c33f89a88b856b631ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-17 20:11:13 +00:00
Akilesh Kailash
81400915ef Merge "Compile with -D_FILE_OFFSET_BITS to support 32-bit userspace" into main 2023-09-17 19:01:45 +00:00
Akilesh Kailash
0a59994c5a Compile with -D_FILE_OFFSET_BITS to support 32-bit userspace
This is to support when partition sizes are greater than 2GB (2^31)
on 32-bit userspace.

Bug: 300178204
Test: OTA on device with 32-bit userspace + product partition > 2GB
Change-Id: I7074682352d8388ed410c684cb7cb0fa346ba24c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-09-17 09:34:43 -07:00
Tomasz Wasilczyk
54702b2040 Merge "Revert "Lock down String8|16.string() usage"" into main am: c5365ad49e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2753395

Change-Id: I2b5c4a6b8a090ebf4057231dbb123cf1ba1e31f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 22:43:05 +00:00
Tomasz Wasilczyk
c5365ad49e Merge "Revert "Lock down String8|16.string() usage"" into main 2023-09-15 22:16:48 +00:00
Devika Krishnadas
7210b285c2 Revert "Lock down String8|16.string() usage"
This reverts commit 8b95a12489.

Reason for revert: DroidMonitor: Test failure

Change-Id: I09230ea7c3b80e1b4d277d3c6c6355a38f7bbc92
2023-09-15 18:46:03 +00:00
Tomasz Wasilczyk
998b5a1313 Merge "Lock down String8|16.string() usage" into main am: f9cae2c965
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2706173

Change-Id: Ic519e62493159876aa73a576f0fa564fce5003a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 15:33:55 +00:00
Tomasz Wasilczyk
f9cae2c965 Merge "Lock down String8|16.string() usage" into main 2023-09-15 14:17:49 +00:00
Daniel Zheng
d9c17e91bb Merge "Concatenate conditional" into main am: 5528777496
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2751931

Change-Id: I747433f20360ab65634db2642a8970c622d14d2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 00:19:29 +00:00
Daniel Zheng
5528777496 Merge "Concatenate conditional" into main 2023-09-14 23:42:15 +00:00
Tomasz Wasilczyk
8b95a12489 Lock down String8|16.string() usage
All users should migrate to .c_str()

Bug: 295394788
Test: make checkbuild
Change-Id: Ic6295848cf3377e0bf5334448d5ed7ea53fae7ae
2023-09-14 18:37:52 +00:00
Tomasz Wasilczyk
b19c86cdd3 Merge "Lock down String8.isEmpty() usage" into main am: 358a982b71
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2705824

Change-Id: I5bc53c672684341d978118fb3d802d0fd9cc3680
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 16:52:05 +00:00
Tomasz Wasilczyk
358a982b71 Merge "Lock down String8.isEmpty() usage" into main 2023-09-14 16:18:49 +00:00
Tomasz Wasilczyk
8b5c8477f9 Lock down String8.isEmpty() usage
All users should migrate to .empty()

Bug: 295394788
Test: make checkbuild
Change-Id: I5ec7921b9cf70e6b0857e1087f141dce958d2587
2023-09-14 15:04:00 +00:00
Daniel Zheng
f5a280a03e Merge "Adding block sz to compressors" into main am: 7f13bc4f47
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2748856

Change-Id: I4ca4ee725b58a77aeb59144196ad98d0ac6ed0c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 05:48:44 +00:00
Daniel Zheng
7f13bc4f47 Merge "Adding block sz to compressors" into main 2023-09-14 05:15:31 +00:00
Daniel Zheng
19a6aa6241 Concatenate conditional
Move two separate conditional checks to one in writer_v2

Test: m libsnapshot
Change-Id: Id70db313754b770e3fa091e9c127839b9f2a5138
2023-09-13 22:14:19 -07:00
Daniel Zheng
b309292859 Adding block sz to compressors
Adding block sz to compressor classes to prepare for variable block size
compression

Test: m libsnapshot
Change-Id: I84db20c80c0f95188f79ccc73b5c30678bd75e78
2023-09-13 22:14:19 -07:00
Yi-Yo Chiang
fd7424338a Merge "fs_mgr: Refactor fs_mgr_overlayfs_already_mounted() to be more readable" into main am: 9603a82932
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2745620

Change-Id: Icfb8815815f2587ede67cf81feca4ab43577697b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 11:23:57 +00:00
Yi-Yo Chiang
9603a82932 Merge "fs_mgr: Refactor fs_mgr_overlayfs_already_mounted() to be more readable" into main 2023-09-13 10:39:49 +00:00
Yi-Yo Chiang
ed0de0be90 Merge "fs_mgr: Use /proc/mounts to check if /cache is mounted" into main am: 7881073ec8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2745619

Change-Id: Ica993eb012ed1dba6e86b7378ab96e6a4c7c2678
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 07:08:14 +00:00
Yi-Yo Chiang
7881073ec8 Merge "fs_mgr: Use /proc/mounts to check if /cache is mounted" into main 2023-09-13 06:46:58 +00:00
Christopher Ferris
40aa3a7125 Merge "Disable warning which is not detecting problems." into main am: 0e0d682d8e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2748855

Change-Id: Ic11c33515954bbe4dd26c2605e6e87f662865ddd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 22:02:32 +00:00
Christopher Ferris
0e0d682d8e Merge "Disable warning which is not detecting problems." into main 2023-09-12 21:27:50 +00:00
Tomasz Wasilczyk
2b3630be4d Merge "Implement android::String access methods that avoid C string cast" into main am: 771bda6c0b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2748673

Change-Id: I8465ee304ef29af2104744ff7af5c713864246af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 21:14:34 +00:00
Tomasz Wasilczyk
771bda6c0b Merge "Implement android::String access methods that avoid C string cast" into main 2023-09-12 20:43:20 +00:00
Christopher Ferris
f58b009b7b Disable warning which is not detecting problems.
A clang update enabled -Wreorder-init-list by default. Since it doesn't
provide any benefit to the debuggerd code, disable the warning.

Test: Builds without warnings.
Change-Id: I75cfe064ba92c74312ba33f329b1364258eba06c
2023-09-12 13:01:10 -07:00
Tomasz Wasilczyk
86c9ea8f86 Implement android::String access methods that avoid C string cast
Bug: 295394788
Test: m checkbuild
Change-Id: If25fd69319171e8c549fc8fcfd95a0819291d8e6
2023-09-12 17:25:29 +00:00
Tomasz Wasilczyk
74ee2a40f2 Merge "Revert "Revert "Revert "Revert "Drop all path-related methods from android::String8""""" into main am: 8245afd47d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2747144

Change-Id: I516a496f3299bc207ab1c1e2c5789cf61777ef86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 14:32:50 +00:00
Tomasz Wasilczyk
8245afd47d Merge "Revert "Revert "Revert "Revert "Drop all path-related methods from android::String8""""" into main 2023-09-12 14:02:13 +00:00
Yi-Yo Chiang
37467f3665 fs_mgr: Refactor fs_mgr_overlayfs_already_mounted() to be more readable
Bug: 293695109
Test: adb_remount test
Change-Id: Idadd5b99e48fa601b1046aef533027ea6ba5c2f6
2023-09-12 16:08:30 +08:00
Yi-Yo Chiang
244e581a31 fs_mgr: Use /proc/mounts to check if /cache is mounted
The fstab provided by the user/caller might not be the default fstab,
which might not include the /cache mount entry. We should just use the
procfs mount info to determine if /cache is currently mounted.

Bug: 300036012
Test: adb_remount test
Change-Id: I4643d0a21ae21f3513f715de424f0be1fe64ff9e
2023-09-12 16:08:30 +08:00
Daniel Zheng
e7360f4eb3 Merge "Adding test for IsDynamicPartition" into main am: 1b547892f6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2727086

Change-Id: I5d5cbf130a44fe74e832ffe03040c1c9f3abae9c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 22:09:40 +00:00
Daniel Zheng
b5bb46cd25 Merge "documenting optimized flash super" into main am: a3b232c30c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2725774

Change-Id: I68a8ae36335a2aec2ea1e085a672da649552d319
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 22:08:38 +00:00
Daniel Zheng
1b547892f6 Merge "Adding test for IsDynamicPartition" into main 2023-09-11 21:06:32 +00:00
Daniel Zheng
a3b232c30c Merge "documenting optimized flash super" into main 2023-09-11 21:06:02 +00:00
Tomasz Wasilczyk
a1853516ff Revert "Revert "Revert "Revert "Drop all path-related methods from android::String8""""
This reverts commit 141255f30c.

Reason for revert: Attempt re-submit again

Change-Id: I0e568fdf8f7a141ee3c5d54f68530ff478a47439
2023-09-11 17:45:16 +00:00
Rhed Jao
494f1ea496 Merge "Revert "Revert "Revert "Drop all path-related methods from android::String8"""" into main am: d395f638fa
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2744996

Change-Id: I666d28c5fc2f8a06c70fed42f686e3650588fda6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 04:22:24 +00:00
Rhed Jao
d395f638fa Merge "Revert "Revert "Revert "Drop all path-related methods from android::String8"""" into main 2023-09-11 03:43:31 +00:00
Rhed Jao
141255f30c Revert "Revert "Revert "Drop all path-related methods from android::String8"""
This reverts commit 4b6a7c3940.

Reason for revert: b/299695302, b/299694769

Change-Id: I89c6719d23446f2f9ce24e5b75d321538b580431
2023-09-11 02:05:58 +00:00
Akilesh Kailash
eaf919aa34 Merge "libsnapshot_cow: Prepare device to boot from pre-created snapshots" into main am: 6b78aac2cf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2746258

Change-Id: Ifd60bf5bd01084a28a47244fefdf7867a62ac10c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-09 07:47:07 +00:00
Akilesh Kailash
6b78aac2cf Merge "libsnapshot_cow: Prepare device to boot from pre-created snapshots" into main 2023-09-09 07:03:40 +00:00
Akilesh Kailash
bcae6b5e60 libsnapshot_cow: Prepare device to boot from pre-created snapshots
Two new API's have been added:

1: BootFromSnapshotsWithoutSlotSwitch: This will create a new marker
which indicates first-stage init to mount the partitions off snapshots.

We need this marker as during boot, there are couple of places during
mounting snapshots wherein the marker is used. However, there is no
change in the existing I/O path related to OTA.

2: PrepareDeviceToBootWithoutSnapshot: This will delete the marker so
that subsequent reboot will not have the partitions mounted without the
snapshots.

VTS tests covers both these API's. Additionally, when these
markers are present, new OTA's cannot be installed. All these
are covered in VTS tests.

===========================================================

snapshotctl: General flow to apply and revert pre-created snapshots

1: To install the pre-created snapshots:

$snapshotctl map-snapshots <directory path containing snapshots patches>

Now the device is ready to boot from snapshots.

2: After device reboots, partitions are mounted off the snapshots. There
   is no snapshot-merge.

3: In order to go back to previous build:

$snapshotctl revert-snapshots

Now the device is ready to boot from base build.

4: After device reboots back to previous build, all the snapshot states
   and COW images are removed.

============================================

Additional commands:

To delete the pre-created snapshots:

$snapshotctl delete-snapshots

======================================

Tested it on Pixel 6 Pro between two builds which are ~24 hours apart.

1: Creating snapshots on a linux-host - ~4-6 seconds
2: Applying pre-created snapshots - ~10-15 seconds (includes intermediate
   transfer of patches to the device). This depends on the size of snapshot patches.
3: Device reboot - ~12-14 seconds.

Bug: 299011882
Test: 1: Apply pre-created snapshots
2: Reboot device: Verify new build
3: Apply OTA when partitions are mounted of snapshots and verify OTA
   fails.
3: Revert-snapshot and reboot.
4: Verify device goes back to base build.

Full OTA on Pixel. vts_libsnapshot_test

Change-Id: I36a72d973d8f70ae49773ebd45dd996fac22a4e3
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-09-08 23:09:45 -07:00