Commit graph

81203 commits

Author SHA1 Message Date
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
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
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
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
812aaa9620 Merge "libsnapshot: Add CowWriterBase, clean up CowWriter." 2023-06-13 19:59:14 +00:00
David Anderson
1347d3407e Merge "fastboot: Include header for ostream_iterator and istream_iterator" 2023-06-12 22:26:44 +00:00
Treehugger Robot
929a665f02 Merge "fastboot: Introduce FASTBOOT_DEVICE alias for ANDROID_SERIAL environment variable" 2023-06-12 22:01:54 +00:00
Biswapriyo Nath
816480b56e fastboot: Include header for ostream_iterator and istream_iterator
This fixes the following compiler errors with gcc

storage.cpp:45:20: error: 'ostream_iterator' is not a member of 'std'
storage.cpp:50:10: error: 'istream_iterator' is not a member of 'std'

Change-Id: I570e332d100bb18e445644a9d57dc14d80f104b5
2023-06-13 00:28:24 +05:30
David Anderson
1f876a81dd Merge "fastboot: Add header that declares std::function" 2023-06-12 18:09:59 +00:00
Jiyong Park
acfc93f924 Merge "init: non-crashing service can restart immediately" 2023-06-12 01:02:34 +00:00
Biswapriyo Nath
214f37c249 fastboot: Add header that declares std::function
This fixes the following compiler error with gcc
fastboot_driver.h:51:10: error: ‘function’ in namespace ‘std’ does not name a template type

Change-Id: I3a4d9b48bfdc2c76e443e2efe1761ec9503c6dc5
2023-06-10 20:08:29 +05:30
John Stultz
9d2fb9ca3c fastboot: Introduce FASTBOOT_DEVICE alias for ANDROID_SERIAL environment variable
The ANDROID_SERIAL env is useful for managing multiple
directly connected devices at one time.

Unfortunately for network connected devices, its harder to use.

This is because both adb and fastboot use the same ANDROID_SERIAL
environment value to identify the device to use, and while that
one value works for directly connected devices, when using
network connected devices, the fastboot and adb port numbers may
differ for the same device.

So if I set: `ANDROID_SERIAL="tcp:127.0.0.1:44403"`
fastboot will work, but when I type `adb shell`, I'll get:
 adb: device 'tcp:127.0.0.1:44403' not found

As `adb devices` outputs:
List of devices attached
localhost:36697 device

To resolve this, we need separate environment variables,
so introduce a FASTBOOT_DEVICE variable for fastboot.

If FASTBOOT_DEVICE is set, it will use that, and if not
it will fall back to the ANDROID_SERIAL if it is set.

Using an explicit -s argument will still override both.

Change-Id: Icd7db6f29e51ed2decd219e35537f6ed98d698b8
Signed-off-by: John Stultz <jstultz@google.com>
2023-06-09 22:54:09 +00:00
William McVicker
bb8637b399 Merge "Revert "Revert "libmodprobe: LPM: Load all modules in *.load with *.dep satisfied""" 2023-06-09 18:54:42 +00:00
Jiyong Park
0d277d777f init: non-crashing service can restart immediately
This CL allows restart_period to be set to a value shorter than 5s.
Previously this was prohibited to rate limit crashing services. That
behavior is considered to be a bit too conservative because some
services don't crash, but exit deliverately.

adbd is the motivating example. When adb root or adb unroot is
requested, it changes its mode of operation (via sysprop), exits itself,
and restarts (by init) to enter into the mode. However, due to the 5s
delay, the mode change can complete no earlier than 5 seconds after adbd
was started last time. This can slow the mode change when it is
requested right after the boot.

With this CL, restart_period can be set to a value smaller than 5. And
services like adbd can make use of it. However, in ordef to rate limit
crashing service, the default is enforced if the service was crashed
last time. In addition, such intended restart is not counted as crashes
when monitoring successive crashes during booting.

Bug: 286061817
Test: /packages/modules/Virtualization/vm/vm_shell.sh start-microdroid \
 --auto-connect -- --protected
* with this change: within 2s
* without this change: over 6s

Change-Id: I1b3f0c92d349e8c8760821cf50fb69997b67b242
2023-06-09 13:06:06 +09:00
Treehugger Robot
3b210bc653 Merge "init: Fix ramdump when enabling shutdown animations." 2023-06-08 16:38:37 +00:00
David Anderson
874fdaed43 libsnapshot: Add CowWriterBase, clean up CowWriter.
To support multiple implementations of CowWriter, we will need to move
direct usage of CowWriter to ICowWriter. This CL does this while also
adding some small cleanups:

- Move ICowWriter implementation methods to a new CowWriterBase class.
  This keeps ICowWriter as a clean interface.
- Make the "Add" methods pure virtual, move the "Emit" methods to
  CowWriterBase as an implementation detail.
- Simplify Initialize/InitializeAppend so they can be shared.
- Rename CowWriter to CowWriterV2.
- Rename cow_writer.cpp to writer_v2.cpp.
- Rename cow_api_test.cpp to test_v2.cpp.
- Remove ICowWriter::options, replace with GetBlockSize.
- Add a CreateCowWriter helper to avoid implementation details in
  update_engine.

Bug: 280529365
Test: builds
Change-Id: If50faf03b292c6c8b23a6170e3f37329fb759ff6
2023-06-07 20:42:14 -07:00
Automerger Merge Worker
78bb0a8548 Merge changes from topic "am-fa9741c9c05a4b19ab12f2b89663cacb"
* changes:
  [automerger skipped] Merge "Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev am: 50cac03f37" into android13-tests-dev am: 2520bfb0d9 -s ours
  [automerger skipped] Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev am: 50cac03f37 am: b30ffaea19 -s ours
2023-06-07 22:44:37 +00:00
Automerger Merge Worker
d68b1254c2 [automerger skipped] Merge "Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev am: 50cac03f37" into android13-tests-dev am: 2520bfb0d9 -s ours
am skip reason: Merged-In Ic84901ce5af766338b2cab07c3cf10841ba9a150 with SHA-1 40b59a61fc is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2617475

Change-Id: I6445e78c3e5bb50f1eb9ac73631853743100e160
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 22:44:34 +00:00
Automerger Merge Worker
d5531c3faf [automerger skipped] Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev am: 50cac03f37 am: b30ffaea19 -s ours
am skip reason: Merged-In Ic84901ce5af766338b2cab07c3cf10841ba9a150 with SHA-1 40b59a61fc is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2617475

Change-Id: I4346f368dc445832bedb831fa9eefad6873f9548
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 22:44:32 +00:00
Automerger Merge Worker
2520bfb0d9 Merge "Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev am: 50cac03f37" into android13-tests-dev 2023-06-07 22:18:20 +00:00
Automerger Merge Worker
b30ffaea19 Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev am: 50cac03f37
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2617475

Change-Id: Ia1640c6f62b2c3260620a775a439e5dbd715c9d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 22:18:18 +00:00
Automerger Merge Worker
50cac03f37 Merge "Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf" into android12L-tests-dev 2023-06-07 21:59:14 +00:00
Treehugger Robot
0b3153f9c0 Merge "libcutils_test: static libjsoncpp" into android12-tests-dev am: 9825551dbf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2617475

Change-Id: I80baf972eba778b21195028782a2cf63fc7b85f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 21:59:11 +00:00
Treehugger Robot
9825551dbf Merge "libcutils_test: static libjsoncpp" into android12-tests-dev 2023-06-07 21:25:59 +00:00
David Anderson
aa45319453 Merge changes Ie2f531bd,I7e418ffe
* changes:
  libsnapshot: Remove OnlineKernelSnapshotWriter.
  libsnapshot: Remove unused SupportsCopyOperation.
2023-06-07 15:20:11 +00:00
David Anderson
8aee6d4a41 Merge "vts_fs_test: Relax filesystem constraints for fixed partitions." 2023-06-07 04:10:26 +00:00
David Anderson
084c94e43e vts_fs_test: Relax filesystem constraints for fixed partitions.
Adjust this test to align with VSR. First, skip the test if kernel is
< 5.10 or < Android 13. Second, allow non-dynamic partitions to be vfat.

Bug: 286038059
Test: vts_fs_test on CF
Change-Id: I5bd874f68296f7155d8c4366ebc13fe3d59c3ee6
2023-06-06 16:46:21 -07:00
David Anderson
82804e5dd0 Merge changes Ibc0f9818,I29b5617e
* changes:
  libsnapshot: Reject bad cow versions.
  libsnapshot: Split CowReader into CowParserV2.
2023-06-06 22:59:01 +00:00
Steven Moreland
7681f71b43 Merge "libcutils_test: static libjsoncpp" 2023-06-06 21:34:44 +00:00
Eric Biggers
b9be43ae5c Merge "fs_mgr_fstab: allow fileencryption without equals sign" 2023-06-06 19:43:49 +00:00
David Anderson
3a079130de Merge "Move ENOSPC tests to libfiemap." 2023-06-06 18:19:51 +00:00
Steven Moreland
447b4a4bf0 libcutils_test: static libjsoncpp
The 32-bit variant of libjsoncpp is not always installed
on 64-bit devices, so it must always be statically included.

We should probably collapse libcutils_test with
libcutils_test_static in the future.

Bug: 285357054
Test: libcutils_test
Merged-In: Ic84901ce5af766338b2cab07c3cf10841ba9a150
Change-Id: Ic84901ce5af766338b2cab07c3cf10841ba9a150
2023-06-06 17:54:52 +00:00
Steven Moreland
40b59a61fc libcutils_test: static libjsoncpp
The 32-bit variant of libjsoncpp is not always installed
on 64-bit devices, so it must always be statically included.

We should probably collapse libcutils_test with
libcutils_test_static in the future.

Bug: 285357054
Test: libcutils_test
Change-Id: Ic84901ce5af766338b2cab07c3cf10841ba9a150
2023-06-06 17:52:39 +00:00
Daniel Zheng
95303da18e Merge "Adding GetInfo method for tasks" 2023-06-06 17:16:35 +00:00
Treehugger Robot
20db4e3d17 Merge "Add the Missing Header" 2023-06-05 22:43:11 +00:00
David Anderson
6cef6905d7 Move ENOSPC tests to libfiemap.
These tests are still giving us trouble. Move them to libfiemap, which
(1) is closer to the source of implementation, and (2) allows us to
re-use the temporary filesystem code. This won't perturb the state of
the actual device.

The new test creates a 64MB ext4 or f2fs mount point as a sandbox, which
should be much safer.

Bug: 285197715
Test: fiemap_writer_test
Change-Id: I33502d49613be4f269a80e5c632514fc56a0246a
2023-06-05 15:06:29 -07:00
Daniel Zheng
665a460e8a Adding GetInfo method for tasks
Using for easier debugging. Replacing old getter methods in flash task
with GetInfo(key)

Test: fastboot_test
Change-Id: If42df86c4b0278c3dc5525b1058f1947f0b34794
2023-06-05 14:40:50 -07:00
Hao Chen
b3e1993ee5 Add the Missing Header
`stderror` is used in this file and it is defined in `string.h/cstring`, so
the header file needs to be directly included.

Test: build
Bug: 285204695
Change-Id: Idf34126626ad0e9bb397df3d5da50439bf18381d
2023-06-05 13:49:17 -07:00
Edward Liaw
da739b2eea Merge "KernelLibcutilsTest: change test file push location" 2023-06-05 20:19:09 +00:00
David Anderson
07533c520c init: Fix ramdump when enabling shutdown animations.
Fix a bug where services weren't stopped properly if shutdown animations
were enabled.

Bug: 285241485
Test: Pixel w/ ro.init.shutdown_animation=true
Change-Id: I7f35572b5223f03f3f5a341fa7b5e90c01d56ce3
2023-06-05 12:59:54 -07:00
Daniel Zheng
819a3529b5 Merge "Adding in wipe tasks before other tasks run." 2023-06-05 19:15:30 +00:00
Daniel Zheng
303fb49cc0 Adding in wipe tasks before other tasks run.
if we call -w and a reboot task runs beforehand, we don't actually wipe
the given partitions. We want the wipe to occur before reboots.

Test: fastboot flashall -w
Change-Id: If327c5de0858e222cf5fc14531bc20fb741c2960
2023-06-05 10:30:44 -07:00
Eric Biggers
cc4a15b97a fs_mgr_fstab: allow fileencryption without equals sign
A point of confusion that has been encountered recently is that the
fileencryption argument is optional (since Android 11), yet the fstab
parser requires the equals sign in "fileencryption=".  Thus, someone
wanting to use the default options must use "...,fileencryption=,...".

Make "fileencryption" by itself mean the same thing so that it works as
expected.

Test: atest CtsFsMgrTestCases
Change-Id: I65ce6b9513942bec2107838396835e7aafb3bf37
2023-06-05 14:35:11 +00:00
Automerger Merge Worker
9bf90f14d4 Merge changes from topic "am-6109f81bfb984ecaa06f3f826ebeee7d"
* changes:
  [automerger skipped] Merge "Merge "libsnapshot: Use SnapshotManager to delete devices." into android12L-tests-dev am: 11caad9d6c" into android13-tests-dev am: 0412ff9c1e -s ours
  [automerger skipped] Merge "libsnapshot: Use SnapshotManager to delete devices." into android12L-tests-dev am: 11caad9d6c am: 4fc18600ac -s ours
2023-06-03 00:49:33 +00:00
Automerger Merge Worker
2bb9e20eeb [automerger skipped] Merge "Merge "libsnapshot: Use SnapshotManager to delete devices." into android12L-tests-dev am: 11caad9d6c" into android13-tests-dev am: 0412ff9c1e -s ours
am skip reason: Merged-In Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685 with SHA-1 e02ef9e9ce is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2604246

Change-Id: Ic32842628663805e2402a90d66b5815d45ca19de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-03 00:49:30 +00:00
Treehugger Robot
dfffb368ce [automerger skipped] Merge "libsnapshot: Use SnapshotManager to delete devices." into android12L-tests-dev am: 11caad9d6c am: 4fc18600ac -s ours
am skip reason: Merged-In Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685 with SHA-1 e02ef9e9ce is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2604246

Change-Id: I7580cbd4fec14c89bc905e67c6466cb6bba00a96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-03 00:49:28 +00:00
Automerger Merge Worker
2c20fe32d3 Merge changes from topic "am-66f20a14a62845e6a805742ccf92e07a"
* changes:
  Merge changes from topic "am-adb4dc995e83421e9148d1453567507c" into android13-tests-dev am: d42cd6887d -s ours
  [automerger skipped] Merge "libsnapshot: Remove flaky image creation test." into android12L-tests-dev am: cf62ede082 -s ours am: fcfa292007 -s ours
2023-06-03 00:49:00 +00:00