Commit graph

81685 commits

Author SHA1 Message Date
Daniel Zheng
5769b268bf use FlashingPlan sparse_limit for testing
Have get_sparse_limit() return FlashingPlan's sparse limit if set. Used
for testing to compare task lists

Test: fastboot_test
Change-Id: I7ac1eb4dc83a53b3d7aa59aa668a780b4b550664
2023-06-22 09:52:06 -07:00
Daniel Zheng
d62002cf06 Add flag to disable super optimization
Adding flag to turn off the super optimization. Makes for easier testing
as dynamic partitions flash tasks won't be replaced by one flash super
layout task

Test: fastboot flashall --disable-super-optimization
Bug: 194686221
Change-Id: I9142490ecfe587725872e4b734486d3db1728aa7
2023-06-22 09:49:09 -07:00
Daniel Zheng
59c22c33a0 Removing local image lookup from load_buf
The initial logic for adding this in was incorrect. This changed had
allowed us to do fastboot flash dts dt.img on command line. But really
we should enforce that we pass in the path to the image. This change was
added so the command line tool with resemble fastboot-info format which
will support flash dts dt.img (situation where image name and partition
name don't match).

Test: fastboot flash {partition}, fastboot flashall
Bug: 194686221
Change-Id: I62f170e14860d865453ab52793e346fe4066c6d4
2023-06-22 09:49:09 -07:00
Nikita Ioffe
2032b2f6a9 Merge "Introduce microdroid variants of init_first_stage and init_second_stage" 2023-06-22 10:11:31 +00:00
Daniel Rosenberg
2127b87b70 Only skip checkpointing for freshly formatted ext4
"Do not reboot with commit failure when ext4 userdata is wiped" has
caused a regression in cuttlefish on f2fs. Overlay.img rapidly grows to
the full userdata size. This updates that CL to only affect partitions
marked for block based checkpointing.

Test: Boot Cuttlefish, monitor overlay.img for 5 minutes
Bug: 285019395
Change-Id: I7d8634e6535ee1531a0df9fb51c6f9c410cbfe92
2023-06-21 18:56:28 -07:00
David Anderson
8542f3e4bb Merge "libsnapshot: Remove ISnapshotWriter." 2023-06-21 22:41:18 +00:00
Daniel Zheng
7f8fff0360 Moving source class declaration
Moving zipImageSource and localImageSource to header file to be used for
testing purposes

Test: m fastboot
Bug: 194686221
Change-Id: I689e73eb0102d3b2cdd0c4fc232b2b60b9022c47
2023-06-21 14:23:56 -07:00
Roy Luo
7f72b30e65 Merge "fastboot: remove retries on invalid IO iterator in OSX" am: be65e040d4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2631070

Change-Id: I72e150f757da768780af09bc2484bf21c95a59b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-21 20:35:30 +00:00
Treehugger Robot
867458fa6b Merge "libdm: don't expect uevent for devices that have never been activated" am: 684a66c8ec
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2628999

Change-Id: Iafd0fd9df3b38ecc1d1ac30dd6d063b7744e987f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-21 20:34:31 +00:00
Roy Luo
be65e040d4 Merge "fastboot: remove retries on invalid IO iterator in OSX" 2023-06-21 19:33:29 +00:00
Treehugger Robot
684a66c8ec Merge "libdm: don't expect uevent for devices that have never been activated" 2023-06-21 19:05:56 +00:00
Nikita Ioffe
55dd32538f Introduce microdroid variants of init_first_stage and init_second_stage
These variants will compile with -DMICRODROID flag, which will allow us
to exclude init features that are not needed for Microdroid, and
introduce features that only work in Microdroid.

Bug: 287206497
Test: build com.android.virt APEX
Change-Id: Ib9af0cfcdf06c70fc39e6e6ac8ef07bb69982969
2023-06-21 16:44:40 +01:00
Jiyong Park
e09de2a5ca libdm: don't expect uevent for devices that have never been activated
Previously, libdm ensured that uevent will be generated when a dm device
is deleted. However, there actually are cases where uevent can't be
expected; for example, if an empty dm device is created, but then gets
deleted without being activated, then there should be no uevent upon
deleting because there actually is nothing to remove from /dev. (dm
device gets added to /dev only if it is activated).

Actually such a case exists in apexd. As a performance optimization, it
proactively creates empty dm devices for all APEXes it scanns. But
some of them don't ever get activated if the APEX is already in a
dm-verity protected block device (i.e. the pre-instaled APEX is the
latest one). In that cases, the empty dm devices are deleted at the end
of the boot process as a clean up.

The libdm triggered error during the clean up, because there was no
uevent generated for the empty dm devices. This has triggered a lot of
false alarms to the apex team.

This CL fixes this by ensuring uevent only for activate dm devices. If
the dm device doesn't show up in /dev, we just delete the in-kernel
object and don't expect it to generate uevent for it - which actually is
the kernel's behavior.

Bug: 286176029
Test: build and run aosp_cf_x86_64_phone. observe dmesg.

Before the change:
I apexd   : Deleting unused dm device com.android.hardware.core_permissions
E apexd   : Didn't generate uevent for [com.android.hardware.core_permissions] removal
W apexd   : Failed to delete dm-device com.android.hardware.core_permissions

After the change:
I apexd   : Deleting unused dm device com.android.hardware.core_permissions
<no error or warning logs>

Change-Id: I52042de7d4d9ab62e6a13428c32a67e13395d1b5
2023-06-22 00:43:32 +09:00
Roy Luo
d1d5f5ab69 fastboot: remove retries on invalid IO iterator in OSX
When IOServiceGetMatchingServices returns an invalid
iterator, IOIteratorReset doesn't help. Break the loop
to prevent being stuck in the reset loop forever.
This should be fine as the open_device() call in the
upper layer is already doing retries.

Bug: 286495045
Test: fastboot update
Change-Id: Ia58fa9285640be34aa22cd77e4f58cc9092679a4
2023-06-20 21:44:53 +00:00
Eric Biggers
c7f7743f4f Merge "Remove write permission from file mode of top-level user dirs" am: 46477f1d82
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2620458

Change-Id: Idc00da3c1d5ce7f5ffc8a3f7942b947fe1b59833
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-20 17:54:45 +00:00
Eric Biggers
46477f1d82 Merge "Remove write permission from file mode of top-level user dirs" 2023-06-20 17:15:24 +00:00
David Anderson
17421a93ba inspect_cow: Add --show_raw_ops.
This bypasses CowReader and shows ops directly from CowParserV2. This
will come in handy once CowOperation is versioned and CowReader will be
translating from older versions to new versions.

Bug: 280529365
Test: inspect_cow
Change-Id: Icaeba86105c31c4dfe2812309a4028dd1d0248c0
2023-06-15 11:18:25 -07:00
David Anderson
691b78a0fd inspect_cow: Switch to gflags.
gflags is a lot cleaner to use than getopt, and we don't really need any
advanced argument parsing.

Test: inspect_cow
Bug: N/A
Change-Id: I19007a787a2e5cd3a67486c7949b34ba76f762e4
2023-06-15 11:01:56 -07:00
Treehugger Robot
614857c782 Merge "Fix LruCache, allow std:string caching" am: 1477714262
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2627034

Change-Id: I633542894afa2dd1a8a6f84c222097bd41a4e68e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 15:05:17 +00:00
Treehugger Robot
1477714262 Merge "Fix LruCache, allow std:string caching" 2023-06-15 14:31:47 +00:00
Nikita Ioffe
dfd57251fe Merge "Reland "Treat Microdroid as OS with monolithic sepolicy"" am: 448b70a268
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2627370

Change-Id: I7c795df5084cbd34fd66757222a0a54941609dc9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 11:45:32 +00:00
Nikita Ioffe
448b70a268 Merge "Reland "Treat Microdroid as OS with monolithic sepolicy"" 2023-06-15 10:27:39 +00:00
Treehugger Robot
6929fc9f1a Merge "Check AServiceManager_isDeclared before AServiceManager_getService" am: fa58ead2cb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2623413

Change-Id: I651a15fbffdd1a13d92b66cc374397cd9d705a88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 06:57:29 +00:00
Treehugger Robot
fa58ead2cb Merge "Check AServiceManager_isDeclared before AServiceManager_getService" 2023-06-15 06:00:10 +00:00
Treehugger Robot
0afb83f595 Merge "init_kill_services_test: binder logs on apexd fail" am: 642929f8f8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2627030

Change-Id: I269f2df5c4ab3654a2e006a2e64a03020dcd505f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 03:55:45 +00:00
Treehugger Robot
642929f8f8 Merge "init_kill_services_test: binder logs on apexd fail" 2023-06-15 01:57:30 +00:00
David Anderson
dda9de4ed9 Merge changes I380bf705,I888b8792 am: ba3bddd153
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2625177

Change-Id: I72c87ea55ad595eac84830952f1ff6cc744587ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 01:41:15 +00:00
Steven Moreland
1501b0c344 init_kill_services_test: binder logs on apexd fail
Print logs necessary to understand why apexd isn't shutting
down when this test fails, due to a rare flake.

Bug: 285458033
Test: init_kill_services_test (and cause this error to be hit)
Change-Id: Ic9cbf7b2b9fa89504e4a53597065e94c32233e12
2023-06-15 00:44:31 +00:00
Fabien Sanglard
2aba0a2283 Fix LruCache, allow std:string caching
The default initalization for mNullValue uses 0 which is in the case of
a std::string TValue will invoke the contructor with undefined behavior
parameter.

Using an empty uniform initialization {} addresses the problem.

Test: Already tested in lrucache_test.cpp
Bug: 257127748
Change-Id: I37420ce8a16c99f3014538a0208d7e113870b1c7
2023-06-15 00:37:52 +00:00
David Anderson
ba3bddd153 Merge changes I380bf705,I888b8792
* changes:
  snapuserd: Create snapuserd_verify.h.
  snapuserd: Create snapuserd_readahead.h.
2023-06-15 00:26:25 +00:00
Nikita Ioffe
fa33f85f52 Reland "Treat Microdroid as OS with monolithic sepolicy"
Bug: 285855150
Test: presubmit
Change-Id: I477e1ef7268ac8e7d0fdae7ffcc611a69bb9d4fe
2023-06-14 20:31:17 +00:00
David Anderson
76622d444d libsnapshot: Remove dependence between CowWriterV2 and CowReader.
The plan of record for the new CowOperation layout is to automatically
translate from CowOperationV2. However, CowWriterV2 currently imports
directly from CowReader, which means we'd need two translation steps.

Luckily we now have CowParserV2, which means we can directly import into
CowWriterV2.

Bug: 280529365
Test: vts_libsnapshot_test
Test: cow_api_test
Change-Id: I11863dcb483f0448686d6c492d8eb128840ce18c
2023-06-14 12:03:59 -07:00
David Anderson
5eae2cb450 libsnapshot: Remove ISnapshotWriter.
This only added one real method to ICowWriter, so let's just fold it
into ICowWriter. CompressedSnapshotWriter goes away as well.
CompressedSnapshotReader is now part of libsnapshot_cow.

Bug: 280529365
Test: m otapackage
      apply ota
Change-Id: I55358c3c9be111d5aee1a0c22c29cb1539d05494
2023-06-14 12:03:58 -07:00
Pawan Wagh
421bb89a0d Merge "Revert "Treat Microdroid as OS with monolithic sepolicy"" am: 61b9935e50
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2626910

Change-Id: I3705bac0af860013dab32680eeee24bd280e31a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 18:57:22 +00:00
Pawan Wagh
61b9935e50 Merge "Revert "Treat Microdroid as OS with monolithic sepolicy"" 2023-06-14 18:40:59 +00:00
Pawan Wagh
85f52dd1ac Revert "Treat Microdroid as OS with monolithic sepolicy"
Revert submission 2625691

Reason for revert: b/287283650

Reverted changes: /q/submissionid:2625691

Change-Id: Ie62bbb4d4f1af528f42aafde79407b151bab46f9
2023-06-14 18:28:19 +00:00
David Anderson
4ac7d0e82e snapuserd: Create snapuserd_verify.h.
Bug: N/A
Test: builds
Change-Id: I380bf705520858dbec8053432c0a7c3fa8bed26d
2023-06-14 08:43:49 -07:00
David Anderson
1779dcca32 snapuserd: Create snapuserd_readahead.h.
This moves ReadAhead out of snapuserd_core.h so it's easier to find.

Bug: N/A
Test: builds
Change-Id: I888b87921950f2f7582b94c078e9e136f8fdd09e
2023-06-14 08:43:49 -07:00
Nikita Ioffe
4aeb74b76c Merge "Treat Microdroid as OS with monolithic sepolicy" am: 121e3b8320
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2617775

Change-Id: Ic92490103ef484154ebdebe3d3d1cd4636388a13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 15:30:48 +00:00
Nikita Ioffe
121e3b8320 Merge "Treat Microdroid as OS with monolithic sepolicy" 2023-06-14 15:20:18 +00:00
Nikita Ioffe
94ef7122d6 Treat Microdroid as OS with monolithic sepolicy
Bug: 285855150
Test: atest MicrodroidTestApp
Change-Id: Idfda3044716a021888017adef801ef67775a3eda
2023-06-14 13:28:05 +01:00
Subrahmanya Manikanta Venkateswarlu Bhamidipati Kameswara Sri
32e1c70f27 Check AServiceManager_isDeclared before AServiceManager_getService
Call AServiceManager_isDeclared before calling AServiceManager_getService
to avoid the waiting time when aidl service is not available.

Bug: 286969060
Test: run VtsHalGatekeeperTarget
Change-Id: I7d652a546cb810a601338a68950f01d065aea7a5
2023-06-14 02:43:54 +00:00
Treehugger Robot
29e1ccd5cc Merge "Removing duplicate CollectImages()" am: 18c531984c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2625181

Change-Id: I5fbf5df4c160c89ee5b96cffe962efed9d86bee6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-13 23:45:48 +00:00
Treehugger Robot
18c531984c Merge "Removing duplicate CollectImages()" 2023-06-13 23:18:50 +00:00
Daniel Zheng
3dc7fcc0b6 Removing duplicate CollectImages()
images are being flashed twice, because of an additional collectImages.
This is resulting in a ~50% increase in flashing time

Test: fastboot flashall -w
Change-Id: I6c271e1e1456cd789f37ebd67cefd221cabc6e7a
2023-06-13 14:57:25 -07:00
David Anderson
f78a62e9bd Merge "libsnapshot: Add CowWriterBase, clean up CowWriter." am: 812aaa9620
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2583491

Change-Id: If51e8c92a73663c7243695083926738dcfb50a96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-13 20:30:36 +00:00
David Anderson
812aaa9620 Merge "libsnapshot: Add CowWriterBase, clean up CowWriter." 2023-06-13 19:59:14 +00:00
David Anderson
6d20df582b Merge "fastboot: Include header for ostream_iterator and istream_iterator" am: 1347d3407e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2623149

Change-Id: I0e3efad29e3b73eeec5cdee22b25be6319349409
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-12 22:47:17 +00:00
Treehugger Robot
a5d6d55042 Merge "fastboot: Introduce FASTBOOT_DEVICE alias for ANDROID_SERIAL environment variable" am: 929a665f02
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2621310

Change-Id: I4b88af8a45aa86464c5eb435148233320f5a5665
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-12 22:46:03 +00:00
David Anderson
1347d3407e Merge "fastboot: Include header for ostream_iterator and istream_iterator" 2023-06-12 22:26:44 +00:00