Commit graph

82054 commits

Author SHA1 Message Date
Kelvin Zhang
b4987345ff Only skip _16k/_64k kernel modules dirs on 4K builds
The initramfs.img from kernel builds do not store kernel modules under
_16k directory. Currently, init is programmed to only load kernel
modules from _16k dir if running on 16K page size kernel. Relax this
restriction so that booting on custom 16K kernel would work without
going through platform rebuild.

Test: th
Bug: 293313353
Bug: 300184677

Change-Id: I9ee3c74066ad9ec5127f1e8662f7c1273445994c
2023-09-22 09:14:43 -07: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
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
f9cae2c965 Merge "Lock down String8|16.string() usage" into main 2023-09-15 14:17:49 +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
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
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
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
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
0e0d682d8e Merge "Disable warning which is not detecting problems." into main 2023-09-12 21:27:50 +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
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
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
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
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
Tomasz Wasilczyk
b2b037d9f0 Merge "Revert "Revert "Drop all path-related methods from android::String8""" into main 2023-09-08 19:59:48 +00:00
Tomasz Wasilczyk
9cbae9d75b Merge "Drop String8::std_string" into main 2023-09-08 18:17:25 +00:00
Tomasz Wasilczyk
4b6a7c3940 Revert "Revert "Drop all path-related methods from android::String8""
This reverts commit cff2e40d19.

Reason for revert: Attempt re-submit

Change-Id: I8802b519e4ae3046858b854815ba580c7a6b965d
2023-09-08 11:03:59 -07:00
Ross Kettleson
acc7ff19f9 Merge "Revert "Drop all path-related methods from android::String8"" into main 2023-09-08 17:09:54 +00:00
Tomasz Wasilczyk
cff2e40d19 Revert "Drop all path-related methods from android::String8"
This reverts commit b9dc1c2991.

Reason for revert: http://b/299624573

Change-Id: I0d5993295df65ec31c180b6b5a76fbe939891f45
2023-09-08 17:08:39 +00:00
Tomasz Wasilczyk
adaf33026a Drop String8::std_string
This method was preserved under assumption it would be baked into many
prebuilts, but since it's inline, there should be no linkage to libutils
- thus, should be safe to remove anyway.

Bug: 35363681
Bug: 295394788
Test: treehugger
Change-Id: I59964935600e9e786424136177bfc8a70bebec67
2023-09-08 09:51:24 -07:00
Tomasz Wasilczyk
cc64ed9865 Merge "Drop all path-related methods from android::String8" into main 2023-09-08 14:47:14 +00:00
Hongguang Chen
f3dd1c9389 Merge "Only restart media.tuner when it's running" into main 2023-09-08 06:06:50 +00:00
Hongguang Chen
32f6920404 Only restart media.tuner when it's running
Fix: 287520719
Test: Kill system_server on TV device w/o tuner. media.tuner is not restarted.
Change-Id: I13006f16746a12c33960feca1288aa17ef2ed9c9
2023-09-08 04:19:34 +00:00
Tomasz Wasilczyk
b9dc1c2991 Drop all path-related methods from android::String8
Move them to androidfw and aapt, the last users.

Bug: 295394788
Test: m checkbuild
Change-Id: I7268b88d11bf221f93efed06cfd1ee65449a2421
2023-09-08 03:07:52 +00:00
Chun-Wei Wang
66b68dde92 Merge "Disallow fastboot to modify locked DSU" into main 2023-09-08 02:59:32 +00:00
Elliott Hughes
f00639393a Merge "Remove stray newline from err() call." into main 2023-09-07 20:39:36 +00:00
Julien Desprez
5b3f7c3283 Merge "Reland exporting create_snapshot" into main 2023-09-07 20:15:59 +00:00
Elliott Hughes
a8e259db66 Remove stray newline from err() call.
err() does this itself, and includes strerror() too.

Test: treehugger
Change-Id: I0e844f9cc3992e80a302b2f3ca1084b165582a9b
2023-09-07 19:30:31 +00:00
Julien Desprez
670f983f45 Reland exporting create_snapshot
Previous attempt: aosp/2743815
Disabled on windows & mac.

Test: presubmit, (previously failed build: https://android-build.googleplex.com/builds/abtd/run/L06100000962955289?referrer=email now passing)
Bug: 290951369
Change-Id: I3d8084c13d843ea5919e3b50a0513faf386ccfed
2023-09-07 17:05:50 +00:00
Daniel Zheng
7d8ac7f122 Merge "Adding testing for optimized flash super" into main 2023-09-07 16:12:30 +00:00
Marvin Ramin
b03378fe71 Merge "Revert "Export create_snapshot to sdk targets"" into main 2023-09-07 09:11:57 +00:00
Marvin Ramin
a4d34c5715 Revert "Export create_snapshot to sdk targets"
This reverts commit bf72b25a07.

Reason for revert: DroidMonitor: Culprit for b/299411079

Change-Id: I9d46abcbcc81d43fde23d4431b6757d3520d4b2c
2023-09-07 09:03:25 +00:00
Chun-Wei Wang
e72b3ad204 Disallow fastboot to modify locked DSU
This enhances the security requirement by only allowing
the owner app to change a locked DSU.

Bug: 277691885
Bug: 296985785
Test: 1. ensure device is OEM locked
      2. adb shell am start-activity \
         -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
         -a android.os.image.action.START_INSTALL \
         --el KEY_USERDATA_SIZE 2147483648 \
	 --es KEY_DSU_SLOT foo.lock
      3. adb reboot fastboot
      4. `fastboot gsi disable|wipe` should be blocked

Change-Id: I1a0cb8a074412468d16043ddf4101fbb76490115
2023-09-07 15:18:23 +08:00
Julien Desprez
2095008f32 Merge "Export create_snapshot to sdk targets" into main 2023-09-07 00:20:51 +00:00
Julien Desprez
bf72b25a07 Export create_snapshot to sdk targets
Similar to fastboot binaries. This will ease the
automation to use this tool

Test: presubmit
Bug: 290951369
Change-Id: I5c879acc7cdecbafebfa074ef76034403cb0cd72
2023-09-06 11:10:03 -07:00