Commit graph

81693 commits

Author SHA1 Message Date
Nikita Ioffe
440354afa0 Support for conditionally mounting /vendor partition in Microdroid
first_stage_init will only mount the /vendor partition in Microdroid if
the androidboot.microdroid.mount_vendor=1 is provided in the kernel
cmdline.

Bug: 285855433
Test: atest MicrodroidTestApp
Change-Id: I5b840b5474bc52ec2696a0ba6ead0476acddfb1a
2023-07-07 14:45:58 +01:00
Nikita Ioffe
f17079ff58 Small refactoring in first_stage_mount
The existing approach in first_stage_init/first_stage_mount makes it
harder to add conditional logic that should only be applied for
Microdroid. Additionally, it forces the FirstStageMount object to be
created twice.

This change refactors the control flow to make first_stage_init take the
ownership of the FirstStageMount object. It will help with the follow up
change (which will add logic to conditionally mount /vendor partition
while booting Microdroid). As a nice side effect, this refactoring also
fixes the problem of the FirstStageMount being created twice.

This change also merges the FirstStageMount and FirstStageMountVBootV2
in a single class, since nobody actually uses FirstStageMount.

Bug: 285855433
Test: device boots
Test: atest MicrodroidTestApp
Change-Id: I38a72c0f20e7c1ac70031498aeeca22b091fa827
2023-07-07 14:45:01 +01:00
Kelvin Zhang
314e70966a Merge "Move libbinderwrapper to update_engine" 2023-07-06 02:45:14 +00:00
Kelvin Zhang
57e3c32bcc Move libbinderwrapper to update_engine
libbinderwrapper is only used by update_engine, it's better to move it
inside update_engine repo

Change-Id: Ia489f38a311b221744f7cf89c9da9c4f3682bb4c
2023-07-05 16:07:05 -07:00
Daniel Zheng
4f3d6e2be8 Merge "Adding parsing for fastboot-info" 2023-07-05 21:52:15 +00:00
Treehugger Robot
3c381ee074 Merge "Replace usage of base::Callback with std::function" 2023-07-05 21:15:04 +00:00
Daniel Zheng
c97eeed5e4 Adding parsing for fastboot-info
Adding back the parsing for fastboot info

Test: m fastboot, fastboot flashall
Change-Id: I0075266bad5d45dcb99dbf91aa431008ca336216
2023-07-05 13:17:39 -07:00
Kelvin Zhang
40e78443e9 Replace usage of base::Callback with std::function
base::Callback comes from libchrome which is undermaintained. Since
C++11 there's standard library support for function objects. Migrate to
a more well knowned solution for function objects.

Test: th
Change-Id: Id19bcd7e92691f57d97520f8f1f4909ca9c25b33
2023-07-05 12:48:13 -07:00
Daniel Zheng
c596830f16 Merge "Changing name of flash super layout" 2023-07-05 19:17:48 +00:00
Treehugger Robot
732d410d21 Merge "add 'nodad' support to ifc_add_address()" 2023-07-01 03:15:34 +00:00
Treehugger Robot
f5d4edaa31 Merge "libutils: rewrite Vector fuzzer" 2023-07-01 01:28:13 +00:00
Steven Moreland
379d5c83d5 libutils: rewrite Vector fuzzer
It could never have gotten much coverage.

Bug: 288741501
Test: libutils_fuzz_vector (2,000,000 iterations)
                           (~60k-100k iterations/s)
Change-Id: I6f442642b5a3246dd08784f735db5aad5fd4d398
2023-07-01 00:28:48 +00:00
Maciej Żenczykowski
25ec9c4db1 add 'nodad' support to ifc_add_address()
Test: TreeHugger
Bug: 242067762
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2c022f6af45eac7631213801a89aa270709d4a57
2023-06-30 16:36:21 +00:00
Jiakai Zhang
f43e20c9b4 Merge "Add a variant of ReadFstabFromFile for /proc/mounts." 2023-06-30 13:24:25 +00:00
Tomasz Wasilczyk
6ecea169ce Merge "Make atrace_*_body explicitly a part of API." 2023-06-29 22:23:16 +00:00
Jiakai Zhang
29ad6c2aa2 Add a variant of ReadFstabFromFile for /proc/mounts.
The variant excludes the code that is not for /proc/mounts, and
therefore saves code size when being called.

Also, after this change, the call to `SkipMountingPartitions` is skipped
for /proc/mounts because it is not needed.

Bug: 287958783
Test: atest CtsFsMgrTestCases
Change-Id: Ie243257fa2e87e666be7decf97ec36c806bc4524
2023-06-29 21:46:15 +00:00
Tomasz Wasilczyk
0c44d8d68d Make atrace_*_body explicitly a part of API.
Also, remove leftover atrace_set_debuggable(bool) symbol.

Bug: 289151149
Test: it builds
Change-Id: Id9fdf9451567d85b64971a6bb409336b12d3f535
2023-06-29 13:28:37 -07:00
Treehugger Robot
a33362ed50 Merge "libmodprobe: LPM: Cleanup of redundant check" 2023-06-29 17:21:18 +00:00
Daeho Jeong
47c0bfa8c7 Merge "init.rc: set f2fs seq_file_ra_mul to 128" 2023-06-29 15:52:51 +00:00
Tomasz Wasilczyk
d0e499f287 Merge "Drop const assignment operator." 2023-06-29 13:36:00 +00:00
Daeho Jeong
d6d8c1f81c init.rc: set f2fs seq_file_ra_mul to 128
Based on experiments, we fount out 128 (128 x global readahead window
size = 16mb) is the optimal multiple to boost up read speeds for the
sequentially accessed files with POSIX_FADV_SEQUENTIAL.

Bug: 195311558
Test: check the /sys/fs/f2fs/<userdata partition>/seq_file_ra_mul value
Change-Id: I7563ad6e47b9ab76ae7fe36978d0e5970a7490e8
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2023-06-28 14:35:30 -07:00
Matthew Maurer
de4ad68fa7 Merge "Bindgen 0.65.1 no longer supports size_t-is-usize" 2023-06-28 18:48:34 +00:00
Tomasz Wasilczyk
aab4105ef6 Drop const assignment operator.
Also, silence cert-oop54-cpp - self-assignment is already handled in
VectorImpl class.

Bug: 289151149
Test: it builds
Change-Id: I8be7714ed53d1515df7cfdf6de6f3c90b3e5cc76
2023-06-28 11:21:47 -07:00
Treehugger Robot
38b572c9e5 Merge "Improve error message of libmodprobe" 2023-06-27 22:31:27 +00:00
Kelvin Zhang
db15b6f93d Improve error message of libmodprobe
Log path of module if that module is not found.

Bug: 273752147
Test: th
Change-Id: I428a116ee26f97455229df642acbdc1297098a32
2023-06-27 13:53:43 -07:00
Kelvin Zhang
fe7a3dae2c Merge "Update some fs_mgr/debuggerd to use getpagesize() instead of PAGE_SIZE" 2023-06-27 19:18:53 +00:00
Kelvin Zhang
786dac3d50 Update some fs_mgr/debuggerd to use getpagesize() instead of PAGE_SIZE
Test: th
Bug: 279808236
Change-Id: I9d30cfe19d2b1a7d624cc5425e4315dc6e3b2ad2
2023-06-27 10:50:07 -07:00
Daniel Zheng
3e04857a59 Changing name of flash super layout
OptimizedFlashSuper makes more sense and is more consistent with
should-optimize-super

Test: m fastboot
Change-Id: I6ceb31144dce591e0a53faec68b932112d9cd360
2023-06-27 10:19:58 -07:00
Treehugger Robot
8ec7d3da58 Merge "Revert "snapuserd: Make header_response a state variable."" 2023-06-27 06:55:22 +00:00
David Anderson
e2e8f55b81 Revert "snapuserd: Make header_response a state variable."
This reverts commit d4e035ebc3.

Reason for revert: Breaks incremental OTAs

Change-Id: Ib9703a66b83e08114ca4d11370d669b8bcdf4789
2023-06-27 05:29:20 +00:00
Jooyung Han
c288e14001 Merge "No need to read ro.apex.updatable now" 2023-06-27 00:55:25 +00:00
David Anderson
53bb327f29 Merge "snapuserd: Make header_response a state variable." 2023-06-26 22:51:41 +00:00
Matthew Maurer
dee32db249 Bindgen 0.65.1 no longer supports size_t-is-usize
The flag has been a default, and now is not accepted.

Test: Treehugger, m rust
Bug: 279198502
Bug: 276464273
Change-Id: Ifdf9968bfcdb278f73cf31ab68bc6b488b39436b
2023-06-26 22:27:09 +00:00
David Anderson
b41cd681aa Merge changes I07031e89,I1ba276e1
* changes:
  libsnapshot: Remove direct accesses of CowOperation::source and compression.
  libsnapshot: Add helpers for accessing CowOperation offsets.
2023-06-26 18:39:57 +00:00
Nikita Ioffe
4ad8a68f2d Merge "init selinux.cpp: use a better way to detect if we run in Microdroid" 2023-06-26 18:31:34 +00:00
Treehugger Robot
c5d1978666 Merge "Make libfstab available to APEXes." 2023-06-26 16:29:26 +00:00
Nikita Ioffe
a66adf45aa init selinux.cpp: use a better way to detect if we run in Microdroid
We are now conditionally compiling init binaries & libinit for
Microdroid (adding -DMICRODROID=1 cflag), so instead of checking for the
presence of the /system/etc/selinux/microdroid_precompiled_sepolicy we
can check if the code is compiled for Microdroid.

In a follow-up changes we can split the sepolicy loading logic into 2
separate headers (one for Android and one for Microdroid) and include
the necessary one depending on the target we compile for.

Bug: 287206497
Test: atest MicrodroidTestApp
Change-Id: Id9c837d03a96ff9564688d33955ec85094eee487
2023-06-26 16:43:16 +01:00
Jiakai Zhang
cf16f4d794 Make libfstab available to APEXes.
The ART module needs this library to determine whether to put dexopt
artifacts in dalvik-cache.

Bug: 287958783
Test: m
Change-Id: Idf338702d4f54e9c40c0692ea29e7d83e91aca38
2023-06-23 22:28:49 +01:00
David Anderson
d4e035ebc3 snapuserd: Make header_response a state variable.
header_response is meant to only be true for the first call to
WriteDmUserPayload. Codify this by making it a member variable and
resetting it on each request.

Bug: 288273605
Test: snapuserd_test
Change-Id: Ia125f86b7f22f4801be1e0796e8f85540ed5f31f
2023-06-23 13:14:50 -07:00
David Anderson
cf311bd00f libsnapshot: Remove direct accesses of CowOperation::source and compression.
For the remaining use cases of accessing CowOperation::source and
compression, directly, introduce helper functions, since these fields
will be removed in the v3 format.

Bug: 280529365
Test: cow_api_test
Change-Id: I07031e8968525a7c1314ca45c284e476b51d8104
2023-06-23 13:14:50 -07:00
David Anderson
09ccef4961 libsnapshot: Add helpers for accessing CowOperation offsets.
These helpers avoid manual inspection of CowOperation::source, and
fiddling with block sizes.

Bug: 280529365
Test: cow_api_test
      vts_libsnapshot_test
      apply OTA
Change-Id: I1ba276e155eb8232a3115066caaa11030c171e11
2023-06-23 13:14:50 -07:00
Treehugger Robot
8790a71bc4 Merge "Remove dead code from fs_mgr" 2023-06-23 20:07:09 +00:00
David Anderson
c6d615dd17 Merge "libsnapshot: Add a helper around CowReader::GetRawBytes." 2023-06-23 18:33:44 +00:00
Paul Lawrence
c7998f2abb Remove dead code from fs_mgr
Test: Compiles
Change-Id: I76402758396b658fc1539f81541b162723b709a2
2023-06-23 09:27:55 -07:00
Jooyung Han
918971c69e No need to read ro.apex.updatable now
Bug: 288202251
Test: m
Test: device boots
Change-Id: I97a3c2fab69489cdfbb5103b148194d7e2ee4d1a
2023-06-23 14:22:44 +09:00
David Anderson
27fb5200aa libsnapshot: Add a helper around CowReader::GetRawBytes.
This avoids having to use op->source which will require more work after
the new format lands.

Bug: 280529365
Test: inspect_cow
Change-Id: Iffa18974bb0152dad73d69bb03c683f1aa549031
2023-06-22 20:52:10 -07:00
Treehugger Robot
c7465ab5d2 Merge "Build libsparse and simg2img for Mac OS X as part of Cuttlefish launcher tools" 2023-06-23 02:12:44 +00:00
Treehugger Robot
b190adfc2e Merge "init_kill_services_test: wait 120s for apexd" 2023-06-23 01:07:14 +00:00
A. Cody Schuffelen
0236af54cd Build libsparse and simg2img for Mac OS X as part of Cuttlefish launcher tools
Bug: 288493595
Test: m libsparse simg2img
Change-Id: I9e0c5c77b9b2b5994bf52e1ca9fdb84bc1523d5d
2023-06-22 17:11:37 -07:00
Treehugger Robot
fe4066520e Merge "Only skip checkpointing for freshly formatted ext4" 2023-06-22 23:28:01 +00:00