Commit graph

84490 commits

Author SHA1 Message Date
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
eb6aa6ae0f Merge "Drop all path-related methods from android::String8" into main am: cc64ed9865
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2724277

Change-Id: I810db0b728028c24e984e98e5a5e0b92114dac87
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 15:42:26 +00: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
426e8bf306 Merge "Only restart media.tuner when it's running" into main am: f3dd1c9389
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2745819

Change-Id: Iace55a4feec3aed0935c737db612b0e3925c2933
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 06:54:20 +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
Chun-Wei Wang
a564954bc8 Merge "Disallow fastboot to modify locked DSU" into main am: 66b68dde92
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2744993

Change-Id: I39173cd7c8b05cf9724e585808c78ab50c7bae0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 03:42:17 +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
1d4fc0b9c2 Merge "Remove stray newline from err() call." into main am: f00639393a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2746273

Change-Id: If0fac41b352a1c8562e46009d76d40e9c23b7cfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 21:22:28 +00:00
Julien Desprez
49b04b7a82 Merge "Reland exporting create_snapshot" into main am: 5b3f7c3283
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2745757

Change-Id: I0b33232aa996505cb8003312d8213fbc89edba98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 21:20:18 +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
Daniel Zheng
3d23275859 Merge "Adding testing for optimized flash super" into main am: 7d8ac7f122
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2725773

Change-Id: I2b4c116da18f15fd075559607d304fab0e1e6feb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 17:18:32 +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
ec37283a03 Merge "Revert "Export create_snapshot to sdk targets"" into main am: b03378fe71
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2743796

Change-Id: I198fec6b385cf95e70b8e678e23133d5bf514506
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 10:04:06 +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
3da4bba60b Merge "Export create_snapshot to sdk targets" into main am: 2095008f32
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2743815

Change-Id: I009bd84211743e89c1ee47be55cc68add72f8328
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 01:13:48 +00: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
Treehugger Robot
8857bc99b7 Merge "snapshotctl: Create and write pre-created snapshots" into main am: 51e3b9cbca
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2739093

Change-Id: Ibcbdd6add41873d40c913f6ef8b73f59211de914
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 09:36:47 +00:00
Treehugger Robot
51e3b9cbca Merge "snapshotctl: Create and write pre-created snapshots" into main 2023-09-06 09:02:07 +00:00
Andrei Diea
4424ca9424 Merge "debuggerd: add socksetopt to seccomp policy" into main am: 15956777be
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2741613

Change-Id: I6a52cc2f3907dd2463383986368eed6e4ee730c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 08:04:17 +00:00
Andrei Diea
15956777be Merge "debuggerd: add socksetopt to seccomp policy" into main 2023-09-06 07:11:37 +00:00
Akilesh Kailash
340acbad36 Merge "create_snapshot: Create snapshot patch comparing two partition images" into main am: 3c41230654
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2738233

Change-Id: I313a119875acd8ddb6f13a5f6649bfc014459f90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 06:29:44 +00:00
Akilesh Kailash
9ccb84a8ba snapshotctl: Create and write pre-created snapshots
Extend snapshotctl binary on the device
to create and apply pre-created snapshots.

snapshotctl map-snapshots <directory-where snapshot patches are present>

1: snapshotctl creates the block device based on the size of the
       snapshot patches.

2: snapshotctl will copy the data to the block device.

unmap and delete snapshots will cleanup.

No change in libsnapshot library except with minor refactoring.

This patch doesn't yet prepare the device to reboot from these
snapshots.

On Pixel 6 Pro, applying pre-created snapshots for all partitions
takes ~3 seconds wherein the delta between two builds are 24 hours apart.

Bug: 299011882

Test: snapshotctl map-snapshots /data/test-snapshots/
snapshotctl unmap-snapshots
snapshotctl delete-snapshots

Change-Id: I98a0fbd9cf7234c2188bad85cdd092ded8997710
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-09-06 06:02:51 +00:00
Akilesh Kailash
3c41230654 Merge "create_snapshot: Create snapshot patch comparing two partition images" into main 2023-09-06 06:02:39 +00:00
Thiébaud Weksteen
c3493ef261 Merge "Revert "Use Apex sepolicy if it's available"" into main am: 158a26da4a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2738173

Change-Id: Ib1daceeea9b3187f167b988da632e99d1cc0b36b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 04:55:04 +00:00
Thiébaud Weksteen
158a26da4a Merge "Revert "Use Apex sepolicy if it's available"" into main 2023-09-06 04:16:41 +00:00
Hsin-Yi Chen
9fa3941217 Merge "Check the ABI of libutils for vendor and product only" into main am: c2b4411b43
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2736196

Change-Id: I15ebfdda7d7f4ba338432e679fb7ac2faef702cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 03:20:58 +00:00
Hsin-Yi Chen
c2b4411b43 Merge "Check the ABI of libutils for vendor and product only" into main 2023-09-06 02:43:32 +00:00
Thiébaud Weksteen
50f03fd58e Revert "Use Apex sepolicy if it's available"
This reverts commit baeece6d0c.

Test: boot aosp_cf_x86_64_phone-userdebug
Bug: 297794885
Change-Id: I0515bc30eba42589c407deb587684b4da011aead
2023-09-06 10:52:49 +10:00
Chun-Wei Wang
8eb1e5ad6e Merge "Add a fastboot command to show GSI status" into main am: 62051237a2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2735077

Change-Id: I4174c0ccc2e5fcb308959458b2ed63a979017aef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-05 22:42:26 +00:00
Akilesh Kailash
214d62e3f7 create_snapshot: Create snapshot patch comparing two partition images
This is a host based tool wherein it compares two Android images and generates snapshot patches which are similar to Android OTA format.

There are few advantages:

1: All the computation of snapshot logic is pushed onto the host.
2: Each partition can have different compression algorithm.
3: All the libsnapshot_cow changes can be tested very quickly.

Here is the test run. This compares two builds which are 24 hours apart.

```

create_snapshot --source=$ANDROID_PRODUCT_OUT/system.img --target=./images/system.img --compression="zstd" &
create_snapshot --source=$ANDROID_PRODUCT_OUT/product.img --target=./images/product.img --compression="lz4" &
create_snapshot --source=$ANDROID_PRODUCT_OUT/vendor.img --target=./images/vendor.img &
create_snapshot --source=$ANDROID_PRODUCT_OUT/system_ext.img --target=./images/system_ext.img --compression="gz" &
create_snapshot --source=$ANDROID_PRODUCT_OUT/vendor_dlkm.img --target=./images/vendor_dlkm.img &

echo "Waiting for snapshot patch creation"
wait $(jobs -p)
echo "Snapshot patch creation completed"
```

========================================
Waiting for snapshot patch creation
Snapshot patch: vendor_dlkm.patch created successfully
Snapshot patch: vendor.patch created successfully
Snapshot patch: system_ext.patch created successfully
Snapshot patch: product.patch created successfully
Snapshot patch: system.patch created successfully
Snapshot patch creation completed

real	0m3.848s
user	0m14.239s
sys	0m8.045s
========================================

It takes ~4 seconds to generate the snapshot patches on the host. Snapshot patches are named as <partition-name>.patch.

Bug: 299011882
Test: create_snapshot between two builds as mentioned above.
Change-Id: Ic87dd3349a866b5626fa03f1f879f417a8116cc2
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-09-05 15:42:11 -07:00
Chun-Wei Wang
62051237a2 Merge "Add a fastboot command to show GSI status" into main 2023-09-05 22:18:40 +00:00
Treehugger Robot
1598c5f4d9 Merge "Skip UP1A.230905.019" into aosp-main-future 2023-09-05 19:54:48 +00:00
Andrei Diea
e3bda36e0b debuggerd: add socksetopt to seccomp policy
aosp/2734054 added socket timeouts for nonblocking liblog ops.
seccomp policy was not updated so tests failed when unallowed
socksetopt syscall was made.

Bug: 298420226
Test: atest debuggerd_test

Change-Id: Iace232ec8b94e5d316d344abc5d866fe314607e0
Signed-off-by: Andrei Diea <adiea@google.com>
2023-09-05 19:29:13 +00:00
Chun-Wei Wang
671a2a551a Add a fastboot command to show GSI status
The command will be used by RMA tool to skip
device wiping when it is already in GSI mode.

This change also makes it easier to add more
gsi commands in the future without needing to
update the host side tool (fastboot).

Bug: 298130522
Bug: 298138572
Test: 1. reboot into fastboot mode
      2. fastboot gsi status
Change-Id: Ic81f89a93b854f9ec70aebe2d209bfd1f98e3645
2023-09-05 23:31:01 +08:00
Dmitrii Merkurev
dec9caf1cc Merge "fastboot: get rid of manual transport memory management" into main am: f667b6d8ba
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2736776

Change-Id: Icf0624a7ee50d493c4a2e5a7417d9918fae411ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-05 14:42:30 +00:00
Dmitrii Merkurev
f667b6d8ba Merge "fastboot: get rid of manual transport memory management" into main 2023-09-05 14:04:54 +00:00
Thiébaud Weksteen
baced3df83 Merge "Remove SeamendcHostTest from TEST_MAPPING" into main am: 9fb6b49131
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2735076

Change-Id: I65ef081ba994aa4d36392d3eccbfe1f79d930845
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-05 06:15:32 +00:00
Thiébaud Weksteen
9fb6b49131 Merge "Remove SeamendcHostTest from TEST_MAPPING" into main 2023-09-05 05:10:01 +00:00
Hsin-Yi Chen
e474f21a45 Check the ABI of libutils for vendor and product only
It is not necessary to compare the dumps with the library installed in
system partition.

Test: m out/target/product/generic_x86_64/lsdump_paths.txt
Bug: 280008249
Change-Id: I8fc39ad17d37cd43bf1d77ba23dde55d05dadce1
2023-09-04 03:38:15 +00:00
Dmitrii Merkurev
0b627d92c4 fastboot: get rid of manual transport memory management
Existing code has transport memory leaks. Use smart pointers
for transport to get rid of those cases and manual memory
management

Test: atest fastboot_test
Test: manually checked transport isn't leaking anymore
Bug: 296629925
Change-Id: Ifdf162d5084f61ae5c1d2b56a897464af58100da
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-09-03 17:30:46 +01:00