Commit graph

52771 commits

Author SHA1 Message Date
Josh Gao
2c356bb91e adb: replace reboot service with exec of /system/bin/reboot.
Test: adb reboot
Test: adb reboot fastboot
Change-Id: Ia4146dde7ef3ae00a782dbe68aff166d63eabdb9
2019-10-23 14:33:36 -07:00
Josh Gao
f61f41494e Move enable-verity/disable-verity out of adb to a helper binary.
Test: adb enable-verity
Test: adb disable-verity
Test: adb shell enable-verity
Test: adb shell disable-verity
Test: fs_mgr/tests/adb-remount-test.sh
Change-Id: I0f21a6678b332cc9166d912aa38952d50d924566
2019-10-23 14:33:36 -07:00
Josh Gao
7b7ee191dc Use adbd_system_binaries to track adbd's dependencies.
required doesn't propagate from apexes, so we need a separate phony
target to track adbd's dependenecies.

Test: m
Change-Id: I4c97047dbd1c2f9b394d864aed229798f09fc9b1
2019-10-23 14:33:36 -07:00
Josh Gao
baea773324 Merge changes from topic "apex_remount"
* changes:
  adbd: replace remount_service with an exec of /system/bin/remount.
  Move remount to PRODUCT_PACKAGES_DEBUG.
2019-10-17 19:14:26 +00:00
Treehugger Robot
d8a72367e5 Merge "Utility class for COW size calculation" 2019-10-17 13:55:44 +00:00
Tom Cherry
5f8790f8ab Merge "liblog: remove checks for __GNUC__" 2019-10-17 13:42:40 +00:00
Treehugger Robot
047a7d21d9 Merge "Revert "Use com.android.vndk.current variant for vndk list"" 2019-10-17 11:50:47 +00:00
Tom Cherry
362e289c78 liblog: remove checks for __GNUC__
We already assume this in many other parts of the build.

Test: build
Change-Id: Ie685e83963eac942d0d176bb2394b5d3a5b86cac
2019-10-16 17:14:39 -07:00
Yifan Hong
b4383e144e Merge "liblp: MetadataBuilder::NewForUpdate takes always_keep_source_slot arg" 2019-10-17 00:10:32 +00:00
Jooyung Han
08f2376d70 Revert "Use com.android.vndk.current variant for vndk list"
This reverts commit 82f94d61cb.

Reason for revert: some targets are broken

Bug: 142773030
Change-Id: Ida59c52af3d2fd694855fcee60b5bb0d99c85f8d
2019-10-16 23:47:32 +00:00
Josh Gao
8d1d87e460 adbd: replace remount_service with an exec of /system/bin/remount.
Test: fs_mgr/tests/adb-remount-test.sh
Test: treehugger
Change-Id: Idd581c3927fd8a8bbdf70e90e8f928b7e98e032a
2019-10-16 16:29:10 -07:00
Treehugger Robot
2fd9d735ea Merge "adbd: allow port configuration on host." 2019-10-16 23:22:44 +00:00
Tom Cherry
405e67b651 Merge "logd: always report the UID of a log message" 2019-10-16 17:51:19 +00:00
Christopher Ferris
f223e1e3c1 Merge "Add document of changes between Android versions." 2019-10-16 15:27:53 +00:00
Tom Cherry
64458c79cd logd: always report the UID of a log message
logd currently only reports the UID of a log message for 'privileged'
readers (those with a uid or gid of root, system, or log).  However,
UIDs are not particularly sensitive.  Much more importantly,
non-privileged readers can only see less messages from their own UID,
so this restriction is essentially a no-op, as those readers will
already know their own uid.

Test: liblog and logd unit tests
Change-Id: I9da7d15eb840ba3200128391e70d618eec79f988
2019-10-16 13:59:26 +00:00
Tom Cherry
443b5dfea7 Merge "liblog: remove client side permissions checking" 2019-10-16 13:57:41 +00:00
Tom Cherry
fa88eeb95e Merge "liblog: remove unneeded checks and includes from headers" 2019-10-16 13:51:42 +00:00
Tom Cherry
756fffac0b Merge "liblog: enable more tests" 2019-10-16 13:47:21 +00:00
Treehugger Robot
9b9854a80a Merge "Use ReadFileToString() in GetHash()" 2019-10-16 10:45:27 +00:00
Treehugger Robot
ed2d29ea13 Merge "sched_policy: add get_cpuset/sched_policy_profile_name" 2019-10-16 02:44:22 +00:00
Christopher Ferris
07bef8ff7b Add document of changes between Android versions.
This document does not list every change in the unwinder between
Android versions. Instead it attempts to only include information
that someone building an app targeting a specific version of Android
might need to know to make sure their app can unwind properly.
It also tries to describe the way that stacktraces might be displayed
differently between Android versions.

Test: NA
Change-Id: I4029053f763f3471f7ddb5da9b1de2d325ead455
2019-10-15 18:33:11 -07:00
Tom Cherry
1e59dcc203 liblog: remove client side permissions checking
There's no point in client side security checks in this library.  If a
process has access to these files, then they'll be able to do any of
these operations themselves.

Test: liblog unit tests
Change-Id: I75d4e1509eb8ff0ac4579f820a8968f4f5ad4e06
2019-10-15 16:06:06 -07:00
Tom Cherry
3ab3135bba liblog: enable more tests
Enable more of the disabled tests.  These should not be flaky and have
value.

The dual_reader test is rewritten in the style of RunLogTests() as
well.

Test: 100 iterations of these tests on CF without failure
Change-Id: I15de9e21b066aa22635cc0bd71b51e2648198823
2019-10-15 11:15:53 -07:00
Alessio Balsini
0355d22d64 Use ReadFileToString() in GetHash()
On some devices the previous implementation of GetHash() was failing at
reading files, returning "Bad file descriptor" error.
Using ReadFileToString() that seems to have fixed the issue.

Test: libsnapshot_test
Change-Id: Ie3598d8bad5b3db1cf816c120e6922a066aa2743
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-15 18:55:10 +01:00
Tom Cherry
f5bad500f3 Merge "liblog: remove obsolete comment" 2019-10-15 14:48:05 +00:00
Tom Cherry
7f79bc53cb Merge "liblog: use RunLogTests() for more tests" 2019-10-15 14:43:23 +00:00
Treehugger Robot
af15eff03b Merge "Don't preload libneuralnetworks.so" 2019-10-15 12:35:47 +00:00
Alessio Balsini
a6e3d497ae Utility class for COW size calculation
The Linux kernel's dm-snapshot relies on a COW device to keep trace of
all the modified sectors.
The COW device has a precise structure, which allows to compute its
space requirement in advance, as a function of:
- sector size;
- chunk size;
- list of modifications applied to the snapshot device.

Create a class that implements the COW device space occupancy given this
information.

Bug: 140835698
Test: libsnapshot_test
Change-Id: I50e3815741ee689d14fc3611532ff9d3b3e0e879
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-15 13:06:48 +01:00
Jooyung Han
9e52397825 Merge "Use com.android.vndk.current variant for vndk list" 2019-10-15 09:21:19 +00:00
Treehugger Robot
e34d239023 Merge changes I1cae6530,I7ffaa260
* changes:
  Publish chunk size in utility.h
  Remove magic numbers from test and use storage literals
2019-10-15 04:55:19 +00:00
Wei Wang
ee2f260223 sched_policy: add get_cpuset/sched_policy_profile_name
Expose API to return name of task profile for cpuset/sched policy so
that libprocessgroup clients using SetTaskProfiles directly don't have
to maintain the mapping. This reduces the risk of inconsistency and saves
memory.

Bug: 139521784
Test: atest libcutils_test:SchedPolicy
Change-Id: I414312a038613913fb6a827bdcefceb3dec21264
2019-10-14 20:03:06 -07:00
Yifan Hong
6bc5b47ac6 liblp: MetadataBuilder::NewForUpdate takes always_keep_source_slot arg
When applying a downgrade package on a Virtual A/B device
(to a non-Virtual A/B build), source slot partitions must
be kept in the metadata.

Test: liblp_test
Bug: 138258570
Change-Id: I87afe68bcfa768bdc015f5966b593758b856c741
2019-10-14 19:32:17 -07:00
Tom Cherry
c734eae375 liblog: remove unneeded checks and includes from headers
Test: build
Change-Id: Ifa3cffe60120fcc30a37239ceb2db46202a03471
2019-10-14 16:11:12 -07:00
Tom Cherry
4e58c84854 liblog: remove obsolete comment
The log_time struct satisfies all of the requirements for an
implicitly created copy constructor to be present, so not defining one
here does not have any real effect.

We don't want to delete the copy constructor for the rationale given
either; modern C++ favors passing small types by value instead of by
reference as the compiler has more opportunity for optimization in
that case.  That's especially true here, where the size of this struct
is the size of a pointer on 64 bit systems.

Test: the copy constructor exists for log_time
Change-Id: Id314ca7729f4b1ca02adb6c7f0ae759b22be2a5c
2019-10-14 13:23:29 -07:00
Tom Cherry
c6a427205d liblog: use RunLogTests() for more tests
Continuing the speed up / clean up from the last change.

Enable a subtest that was previously disabled as well.  It passes 100s
of cycles now on CF.

Test: liblog-unit-tests
Change-Id: Ifff6f400c3736a1a857a3fdaf22d7ef1794abf9b
2019-10-14 13:11:26 -07:00
Alessio Balsini
9e95202e4d Publish chunk size in utility.h
The chunk size of the snapshot should be kept consistent among different
files.
Move it to libsnapshot/utility.h to improve its visibility.

Change-Id: I1cae6530a07c88f3a0091ca7d8bb2eb590a6710f
Bug: 140835698
Test: m
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-14 21:07:07 +01:00
Alessio Balsini
3f6334e623 Remove magic numbers from test and use storage literals
Use constant expressions and storage literals to simplify readability.

Change-Id: I7ffaa260a2cd77dc0e24980f115f9e8df72708e6
Bug: 140835698
Test: libsnapshot_test
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-14 21:07:02 +01:00
Tom Cherry
a5a107fb6d Merge "init: trigger shutdown directly from builtins" 2019-10-14 13:48:52 +00:00
Jooyung Han
82f94d61cb Use com.android.vndk.current variant for vndk list
New linkerconfig reads some txt files which list various kinds of
vndk libraries. For example, vndksp.libraries.txt file has the list of
VNDKSP type libraries. The exact file names are retrieved from .vendor
variants.

With VNDK APEX, .vendor variants are not installed but
.com.android.vndk.current variants are packaged into VNDK APEX.

This CL changes the variant type from .vendor to
.com.android.vndk.current so that *.libraries.txt files can list the
installed files correctly.

Bug: 141451661
Test: m && device boot
Change-Id: Ibbc27b1ae6a44cc2337a0b14918caa27107a4c8e
2019-10-13 22:03:50 +09:00
Christopher Ferris
3902531b86 Merge "Replace MOCK_METHODN with MOCK_METHOD macro." 2019-10-12 00:43:05 +00:00
Christopher Ferris
baf058bbf7 Replace MOCK_METHODN with MOCK_METHOD macro.
Test: Builds and unit tests pass.
Change-Id: I64e0034359c213f37c098d1c97be260bd955ca0f
2019-10-11 14:30:18 -07:00
Tom Cherry
212b8247ab Merge "liblog: don't sleep in the middle of tests" 2019-10-11 21:00:02 +00:00
Tom Cherry
0dbfea7b07 init: trigger shutdown directly from builtins
Especially now that property_service is a thread, there may be some
delay between when init sets sys.powerctl and when the main thread of
init receives this and triggers shutdown.  It's possible that
outstanding init commands are run during this gap and that is not
desirable.

Instead, have builtins call TriggerShutdown() directly, so we can be
sure that the next action that init runs will be to shutdown the
device.

Test: reboot works
Test: reboot into recovery due to bad /data works
Change-Id: I26fb9f4f57f46c7451b8b58187138cfedd6fd9eb
2019-10-11 13:45:42 -07:00
Treehugger Robot
536e8ded6b Merge "Only allow alphanumerical characters, '-' and '_' in event trigger names" 2019-10-11 20:11:49 +00:00
Treehugger Robot
0e9a0f9831 Merge changes I8804f7dd,I3cbca589
* changes:
  [fs_mgr] fix -Wreorder-init-list
  [debuggerd] fix -Wreorder-init-list
2019-10-11 19:52:37 +00:00
Christopher Ferris
d1cb35bdef Merge "Add method to get usage stats for a single map." 2019-10-11 18:16:01 +00:00
Tom Cherry
dbc4815dbf liblog: don't sleep in the middle of tests
A lot of liblog tests follow this pattern:
1) Write a log message
2) Sleep ~1 second
3) Use the non_blocking log reader to dump all log messages
4) Test those log messages

This causes running back to back tests to be very slow and still
allows for some amount of flakiness if the system is very loaded.

This change replaces that pattern with the following:
1) Write a log message
2) Set an alarm for 2 seconds as a test timeout
3) Read logs with the blocking reader until finding the expected log
   messages
4) Test those log messages
5) Use the non_blocking reader to dump all log messages
6) Re-test those log messages, to ensure no duplicates, etc, which
   isn't done in step 3).

Despite dumping the logs twice, the tests are orders of magnitude
faster in the good case, and should be less prone to flakes.

Test: liblog-unit-tests
Change-Id: Iedf473316576b8007746fe3560815bde1813787a
2019-10-11 10:56:11 -07:00
Nick Desaulniers
8e048440e5 [fs_mgr] fix -Wreorder-init-list
C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Change-Id: I8804f7dd5cba1035ac7a2979a47b661d722f664a
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-11 10:54:53 -07:00
Nikita Ioffe
aaab596687 Only allow alphanumerical characters, '-' and '_' in event trigger names
This should help in preventing silly typos like "on foo:"

Test: atest CtsInitTestCases
Test: builds
Bug: 135984674
Change-Id: I6e4e18970e957d25dea9f557f0d31a759fbe6150
2019-10-11 17:44:54 +01:00
Treehugger Robot
d4a1cd2cdd Merge "Fuzzer for libdm's dm-linear devices creation" 2019-10-11 15:38:23 +00:00