Adding in XOR operation to v3 writer. Parser has to go through ops and
create a mapping of XOR operation to it's data
Test: cow_api_test
Bug: 307452468
Change-Id: I51e13a59ba472b62bdcc05921f2e5d6e2c8ad2af
This change will allow a later CL to wait for SIGCHLD without discarding
the SIGTERM information.
Bug: 308687042
Change-Id: I5b9ab4562060455573cd816cc48bf90576b39ab9
Signed-off-by: Bart Van Assche <bvanassche@google.com>
PLOG depends on errno being set to a useful value, otherwise it will
print a meaningless error string. A few PLOG call sites occur where
either errno is not set at all, or it is set only some of the time where
there are already PLOG calls closer to where the error occurs. Convert
these PLOG calls to LOG.
Bug: 301871933
Change-Id: Ifa6bd2401f9dd9b84b2506e886336e89bac81bb1
These headers are exported by libfs_mgr and libfstab. Users should use
those libraries instead of directly referencing the include dir with
LOCAL_C_INCLUDES.
Bug: 293695109
Test: presubmit build pass
Change-Id: I888f59879f31fb75ddd5a0d243d4796415b57c7d
Add in replace ops to WriterV3 without compression support (will be
added in later). CowReader also has to be changed since we no longer
have a CowFooter (our checks need to be updated correspondingly).
We need next_data_pos_ to be pointed to after the operation buffer. This
section is appended to incrementally as we write replace + xor
operations
Test: cow_api_test
Change-Id: Ie979c72f842edd04337d900fd43dac8031207517
Add zero block operation to writer v3. We currently write this operation
to after the scratch space. Once resume point support is added we may
need to change this to write after the resume point. This CL only
supports zero blocks, so writeoperation does not take in data yet.
Bug: 307452468
Test: cow_api_test
Change-Id: I659b2e2e4f6e0d96e374ed29012318cc34b4158d
Also adds a test for CowWriterV3 + CowParserV3.
Bug: 307452468
Test: read a header written by v3 writer
Change-Id: I77cf048604c82a010cfdbfb38d0f8beef597d112
Only report status information for the processes that are still running.
Additionally, make the logging output look better by starting the
process information from /proc start on a new line.
Fixes: ea595ba2a0 ("init: Log more information if stopping times out")
Change-Id: I3c882c364f11278087a78efb7a8e8fee8e582417
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Fix the following compiler warning:
//system/core/init:host_init_verifier clang++ host_init_verifier.cp
system/core/init/host_init_verifier.cpp:112:9: warning: ISO C++ requires field designators to be specified in declaration order; field 'pw_shell' will be initialized after field 'pw_uid' [-Wreorder-init-list]
.pw_uid = 0,
^~~~~~~~~~~
system/core/init/host_init_verifier.cpp:111:21: note: previous initialization for field 'pw_shell' is here
.pw_shell = static_shell,
^~~~~~~~~~~~
Change-Id: I930c668d7fb1d12ebe9307b1549776da71a9a95a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Fix the following compiler warning:
system/core/init/init.cpp:754:57: warning: ISO C++ requires field designators to be specified in declaration order; field '' will be initialized after field 'sa_flags' [-Wreorder-init-list]
const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP };
^~~~~~~~~~~~~~~~~~~~~~~~
system/core/init/init.cpp:754:34: note: previous initialization for field '' is here
const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP };
^~~~~~~~~~~~~~~~~~~~~
Change-Id: I29e2d51dfdff85212a33eebfd51b241268cdfe9a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Add in Parser base class and refactor code to work with it. Base class
will have ops() method which returns a vector of v3 operations.
v2_parser translates it's v2 operations to v3 operations with this
method.
Bug: 307452468
Test: Test with critical OTA paths?
Change-Id: I52d0d0554973714189a6e1013d026f96503238b6
unit tests
1, Previous implementation has the staged prop application done in
property_service, which caused a number of unnecessary changes which
including exposing apis like AddPersistentProperty. In addition, it made
the property_service logic complicated. A better design is to have the
staged value application done while reading the persistent properties
from file. This way, no change to property service. In addition, unit
test is much cleaner and efficient.
2, add a unit test to lock down the behavior. Specifically, it locks down that when a prop is staged, it should be applied the next time when the persistent prop is loaded. In addition, it should lock down that other persistent props are not overwritten.
Bug: b/307752841, b/300111812, b/306062513
Change-Id: I43c603efbb803195065dda3f0bc2145716302bbc
Add in Parser base class and refactor code to work with it. Base class
will have ops() method which returns a vector of v3 operations.
v2_parser translates it's v2 operations to v3 operations with this
method.
Bug: 307452468
Test: Test with critical OTA paths?
Change-Id: Iccc9755a892911a1638f5b62d7d6a2402c68ab20
The new 6.6 kernel headers added a new segv type, SEGV_CPERR. Add this
to the switch statement.
Test: Unit tests pass.
Change-Id: I77eb4748e51c7e7d7291bfd2180b0ccb3b5a6ded
The max_processes calculation is incorrect for KillProcessGroup because
the set of processes in cgroup.procs can differ between the multiple
reads in the implementation. Luckily the exact value isn't very
important because it's just logged. Remove max_processes from the API
and remove the warning about the new behavior in Android 11.
Note that we still always LOG(INFO) that any cgroup is being killed.
Bug: 301871933
Change-Id: I8e449f5089d4a48dbc1797b6d979539e87026f43
Added a check to avoid possible NPD when duplicate partitions are created and changed slot value range which is being fetched using FuzzedDataProvider.
exec/s: 16440
Test: ./liblp_builder_fuzzer
exec/s: 26412
Test: ./liblp_super_layout_builder_fuzzer
exec/s: 9178
Test: ./liblp_apis_fuzzer
Bug: 307978015
Change-Id: I63abc828cc3f4c44c1dd89a01acfb33dc08813b8
This reverts commit c7a6fe684c.
Repply the blkio controller migration because it was not responsible
for the test failures that led to the revert. See also the following bugs:
* https://b.corp.google.com/issues/260143932
(v2/android-virtual-infra/test_mapping/presubmit-avd test failure)
* https://b.corp.google.com/issues/264620181
(CtsInitTestCases.RebootTest#StopServicesSIGKILL failure)
The only change compared with the previous version is that the io
controller has been declared optional. This is necessary because some
devices have a kernel that does not support the io controller.
Bug: 213617178
Test: Cuttlefish and various phones
Change-Id: I490740e1c9ee4f7bb5bb7afba721a083f952c8f2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
After mapping COW device, wait for the device to appear
before initializing it.
Bug: 305829996
Test: OTA on Pixel
Change-Id: If9e0e1ce684aa15bc9f3fd5a01e4f0421de87e81
Signed-off-by: Akilesh Kailash <akailash@google.com>
If remounting "/system" caused "/" to be set to MS_PRIVATE, restore it
to MS_SHARED after remount.
Bug: 306124139
Test: adb-remount-test
Test: remount /system and verify /proc/self/mountinfo
Change-Id: I12bc2ccdaf7d2b2de330064b61a8533b96defe00
When juggling submounts, the temp dir holding the references to
submounts should be MS_PRIVATE. Otherwise the submount propagation type
would be changed according to section 5d,
https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt
For example, a root mount tree of
<mountpoint> <shared/private>
/dev shared
/product shared
/product/app private
When executing "remount /product", "/product/app" would be moved to a
temp dir under "/dev", which is MS_SHARED. This would also change the
state of the mount to MS_SHARED.
/dev shared
/product shared
/dev/temp shared (moved from /product/app)
Thus after "/product" overlay is mounted, and "/dev/temp" is moved back,
"/product/app" would be unintentionally changed to MS_SHARED.
/dev shared
/product private
/product shared (overlayfs override)
/product/app shared (moved from /dev/temp)
This change fixes this issue by setting up a standalone mount tree under
/dev to hold the temporary moved submounts.
This way we don't need to modify the state of "/dev" whatsoever, and can
guarantee the propagation type of mounts moved in and out of the temp
dir are not changed.
Bug: 306124139
Test: adb-remount-test
Test: remount a parent mount and then verify the mount flag of submount
Change-Id: I8174257cff6b93dd95303c6ab49b42f90b02df0c
Vendor overlay was introduced to enable system-only update with small
changes on the vendor, but this is no longer required with same reason
of VNDK deprecation - more frequent Vendor update than expected, and
makes system-vendor interface unstable. This change adds more comments
to explain that Vendor overlay will be deprecated along with VNDK, and
skip test if VNDK is deprecated.
Bug: 307925435
Bug: 307902290
Test: fs_mgr_vendor_overlay_test passed with CF trunk-staging device
Change-Id: I7b9359a5754e8740e749c48f6265a1b0f92f13af