Commit graph

84686 commits

Author SHA1 Message Date
Bart Van Assche
a75f210398 init: Make WaitToBeReaped() wait less long
Reduce the time spent in WaitToBeReaped() by waiting for SIGCHLD instead
of waiting for 50 ms.

Bug: 308687042
Change-Id: I5e259fdd22dec68e45d27205def2fc6463c06ca3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-07 10:52:26 -08:00
Bart Van Assche
43323a7e7a init: Create different file descriptors for SIGCHLD and SIGTERM
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>
2023-11-06 10:38:20 -08:00
Treehugger Robot
6c7dca816f Merge "Update fmtlib to 10.1.1" into main 2023-11-05 03:36:11 +00:00
Daniel Zheng
c7c6605c35 Merge "libsnapshot: Implement CowWriterV3::EmitCopy" into main 2023-11-03 03:48:35 +00:00
Daniel Zheng
fc94e8a96f Merge "libsnapshot: Implement CowWriterV3:EmitBlocks" into main 2023-11-03 03:48:31 +00:00
Bart Van Assche
63d52783de Merge changes I3c882c36,I930c668d,I29e2d51d into main
* changes:
  init: Fix a bug in the WaitToBeReaped() logging code
  init/host_init_verifier: Fix a compiler warning
  init: Fix a compiler warning
2023-11-03 00:55:57 +00:00
Daniel Zheng
9f53082e3b Merge "libsnapshot: Implement CowWriterV3::EmitzeroBlocks." into main 2023-11-02 21:52:18 +00:00
Daniel Zheng
cdb935e95f Merge "libsnapshot: Parser v3 implementation" into main 2023-11-02 21:51:45 +00:00
Daniel Zheng
a1014852a1 libsnapshot: Implement CowWriterV3::EmitCopy
Add copy operation to v3 writer

Test: cow_api_test
Bug: 307452468
Change-Id: I5956084bfadff4536bad11f3683d639408a79892
2023-11-02 14:40:23 -07:00
Daniel Zheng
805d10fa16 libsnapshot: Implement CowWriterV3:EmitBlocks
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
2023-11-02 14:38:37 -07:00
David Anderson
53bd5585e9 libsnapshot: Implement CowWriterV3::EmitzeroBlocks.
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
2023-11-02 13:38:37 -07:00
Daniel Zheng
ee35a8184c libsnapshot: Parser v3 implementation
Also adds a test for CowWriterV3 + CowParserV3.

Bug: 307452468
Test: read a header written by v3 writer
Change-Id: I77cf048604c82a010cfdbfb38d0f8beef597d112
2023-11-02 13:38:37 -07:00
Daniel Zheng
c9c120e0b1 Merge "libsnapshot: Add Parser v3 + stub" into main 2023-11-02 20:07:54 +00:00
Daniel Zheng
cb618c18c9 Merge "libsnapshot: Add Parser base class" into main 2023-11-02 20:07:50 +00:00
Bart Van Assche
7ce6453aa8 init: Fix a bug in the WaitToBeReaped() logging code
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>
2023-11-02 13:06:23 -07:00
Bart Van Assche
4844092066 init/host_init_verifier: Fix a compiler warning
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>
2023-11-02 13:06:23 -07:00
Bart Van Assche
ac8b5bd0bc init: Fix a compiler warning
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>
2023-11-02 13:06:22 -07:00
Daniel Zheng
875df3436d libsnapshot: Add Parser v3 + stub
previously upload patch broke build -> bug id: 308868619

This patch updates the unimplemnted pure virtual method data_loc()
Adding in parser v3 plus stub implementation.

Bug: 307452468
Test: th
Change-Id: I815a741b01c46a11a2e60f59305843ce8329a065
2023-11-02 10:20:48 -07:00
David Anderson
e5a343b1af libsnapshot: Add Parser base class
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
2023-11-02 10:19:31 -07:00
Dennis Shen
fa21f12e3b Merge "Move staging value application logic to persistent_properties and add unit tests" into main 2023-11-02 17:00:44 +00:00
Dennis Shen
79283ef377 Move staging value application logic to persistent_properties and add
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
2023-11-02 14:17:33 +00:00
Hsiu-Chang Chen
77aa824423 Merge changes from topic "revert-2781730-YHMBOJWFHT" into main
* changes:
  Revert "libsnapshot: Add Parser base class"
  Revert "libsnapshot: Add Parser v3 + stub"
2023-11-02 04:24:16 +00:00
Hsiu-Chang Chen
e2ce495aa2 Revert "libsnapshot: Add Parser base class"
Revert submission 2781730

Reason for revert: It breaks build

Reverted changes: /q/submissionid:2781730

Bug: 308868619
Change-Id: I255263d14a1ced57b80efd373dd22eb22bb6efc1
2023-11-02 03:25:24 +00:00
Hsiu-Chang Chen
ad37351bd1 Revert "libsnapshot: Add Parser v3 + stub"
Revert submission 2781730

Reason for revert: It breaks build

Reverted changes: /q/submissionid:2781730

Bug: 308868619
Change-Id: I53b6b619635f150455cdba00237d130cae5df347
2023-11-02 03:25:24 +00:00
Daniel Zheng
a4c2d78763 Merge changes Ie01f94d0,Iccc9755a into main
* changes:
  libsnapshot: Add Parser v3 + stub
  libsnapshot: Add Parser base class
2023-11-02 01:05:42 +00:00
Daniel Zheng
4ca81f26d8 libsnapshot: Add Parser v3 + stub
Adding in parser v3 plus stub implementation.

Bug: 307452468
Test: th
Change-Id: Ie01f94d036c2062e34dbdf32456dc0a4612492d3
2023-11-01 13:06:55 -07:00
David Anderson
c165e84b15 libsnapshot: Add Parser base class
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
2023-11-01 13:06:54 -07:00
Henri Chataing
6bdb5f86cd Update fmtlib to 10.1.1
Test: m
Change-Id: I1f23ea1a07c792c3b4974414aef9aeb9ae8f11d7
2023-11-01 17:25:37 +00:00
Shin-Yu Wang
8ebc82576e Merge "Revert "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy""" into main 2023-11-01 07:28:26 +00:00
Shin-Yu Wang
3b16967f0f Revert "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy""
This reverts commit d71f9e5fbb.

Reason for revert: p0 failed test (b/308687042)

Change-Id: I3d8cb899d79634bb1c80f7d05af5c1311358c25c
2023-11-01 06:26:31 +00:00
Christopher Ferris
cb8ee7580d Merge "Add new segv type SEGV_CPERR." into main 2023-11-01 02:14:31 +00:00
Christopher Ferris
6aa72490dc Add new segv type SEGV_CPERR.
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
2023-10-31 14:01:09 -07:00
Treehugger Robot
848b36c254 Merge "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy"" into main 2023-10-31 20:00:51 +00:00
Akilesh Kailash
9eeebf7043 Merge "libsnapshot: Wait for COW path" into main 2023-10-31 17:44:36 +00:00
Treehugger Robot
1f5e877185 Merge "Initialize the appcompat system property folder" into main 2023-10-31 02:29:56 +00:00
Bart Van Assche
d71f9e5fbb Reapply "Migrate the blkio controller to the v2 cgroup hierarchy"
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>
2023-10-30 16:55:14 -07:00
Akilesh Kailash
8fb49bc0a2 libsnapshot: Wait for COW path
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>
2023-10-30 12:14:15 -07:00
Kiyoung Kim
dfe80e48f9 Merge "Deprecate Vendor Overlay when VNDK is deprecated" into main 2023-10-30 05:12:37 +00:00
Kiyoung Kim
260e48f07e Deprecate Vendor Overlay when VNDK is deprecated
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
2023-10-30 13:19:12 +09:00
Tomasz Wasilczyk
3f214d7a09 Merge "Allow disabling callstack" into main 2023-10-29 00:46:54 +00:00
Treehugger Robot
fe72eca034 Merge "Create integration test for fastboot CLI" into main 2023-10-27 18:52:47 +00:00
Tomasz Wasilczyk
b6f459abbc Allow disabling callstack
Bug: 302723053
Test: mma
Change-Id: Idea326cc9914d4c81d75dad287e169c09a736486
2023-10-27 10:48:43 -07:00
William Hester
bdf0b1bb83 Create integration test for fastboot CLI
We rely on parsing the `fastboot devices` output in device labs, and a
format change previously broke us. This test will ensure that the output
is exactly what we expect.

Test: atest --host fastboot_integration_test

Change-Id: I7606e7b3e4a1edfe487ff14bb06cbd3c0a3aa777
2023-10-26 16:51:33 -07:00
Automerger Merge Worker
8fbaaa33a1 Merge "Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev am: 76a9eb4374" into main 2023-10-26 21:26:53 +00:00
Treehugger Robot
54f2e06cf5 Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev am: 76a9eb4374
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2800753

Change-Id: I403f0915937a0c8b24a54b5b265b70b1ce529ff2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-26 21:26:48 +00:00
Christopher Ferris
268c408310 Merge "Fix indices in fuzzer." into main 2023-10-26 18:37:06 +00:00
Steven Moreland
f1168c7b0b Merge "libutils_binder: isolate headers" into main 2023-10-25 23:13:59 +00:00
Treehugger Robot
76a9eb4374 Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev 2023-10-25 16:56:56 +00:00
Yi-Yo Chiang
a93795deae Merge "remount: If checkpoint is in progress, wait for it to complete" into main 2023-10-25 06:22:12 +00:00
Steven Moreland
c738370273 libutils_binder: isolate headers
This isolated all libutils_binder headers from libutils
except for RefBase use of CallStack.h. This header can
be disabled with a macro option easily.

Bug: N/A
Test: N/A
Change-Id: I83af091fc17b5418ab9e4d7fc41fb43792ec547d
2023-10-24 23:45:01 +00:00