Commit graph

47688 commits

Author SHA1 Message Date
Wei Wang
5f01d3af77 init: add error handling in control message
Bug: 133432022
Test: boot
Test: setprop ctl.interface_restart android.hardware.power@1.0::IPower/default success
Test: setprop ctl.interface_restart android.hardware.power@1.0::IPower/abc fail
Change-Id: I66342b2723eb01022fb4e0d98f0b6ffc2752bcac
2019-05-23 12:43:09 -07:00
Tom Cherry
cbe0876f8b Merge "init: don't import rc files during mount_all after Q" 2019-05-23 18:46:51 +00:00
Elliott Hughes
f530dbf671 Merge "Add a std::string overload to Next." 2019-05-23 17:55:27 +00:00
Treehugger Robot
5436843246 Merge "Moving /odm/build.prop to /odm/etc/buid.prop" 2019-05-23 09:16:34 +00:00
Elliott Hughes
e06a808037 Add a std::string overload to Next.
All but one existing caller actually wants a std::string.

Bug: http://b/129068177
Test: treehugger
Change-Id: I428c4453edaae74451db56e9542e4e462f08d43a
2019-05-22 19:05:44 -07:00
Wei Wang
92820c2676 Merge "Report non-empty system boot reason when bootloader reason is empty" 2019-05-23 01:14:43 +00:00
Wei Wang
ef320007a7 Report non-empty system boot reason when bootloader reason is empty
Bug: 133321647
Test: build
Change-Id: Iada572f969d100ded28639c64afbb2d7440d032a
Merged-In: Icd3ea4b69ef2ad040926e2b0e121a8f5f1c1b658
2019-05-22 14:55:49 -07:00
Jiyong Park
691e0e154a Merge "Add android::base::expected" 2019-05-22 20:40:06 +00:00
Bowgo Tsai
9fc8dcf517 Moving /odm/build.prop to /odm/etc/buid.prop
In device root directory, we have the following symlinks:
  - /odm/app -> /vendor/odm/app
  - /odm/bin -> /vendor/odm/bin
  - /odm/etc -> /vendor/odm/etc
  ...

This allows the Generic System Image (GSI) to be used on both devices:
  1) Has a physical odm partition, where those symlink will be hidden
     when /odm is used as the mount point
  2) Has no physical odm partition and fallback to /vendor/odm/.

We can't just have the symlink /odm -> /vendor/odm, because the former
devices won't have /vendor/odm directory, which leads to mount failure
when the mount point /odm is resolved to /vendor/odm.

The existing /vendor/odm/build.prop won't be loaded in the latter
devices, because there is no symlink
    - /odm/build.prop -> /vendor/odm/build.prop.

Note that init blocks reading through direct symlinks (O_NOFOLLOW) so
the above symlink won't work either. This CL moves the odm build.prop
to /odm/etc/build.prop for init to load it (symlinks in earlier
components of the path will still be followed by O_NOFOLLOW).

Bug: 132128501
Test: boot a device and checks /odm/etc/build.prop is loaded
Change-Id: I0733c277baa67c549bb45599abb70aba13fbdbcf
Merged-In: I0733c277baa67c549bb45599abb70aba13fbdbcf
2019-05-22 06:03:34 +00:00
Treehugger Robot
9ab0471734 Merge "fastbootd: reduce USB buffer size to 16K" 2019-05-22 03:45:18 +00:00
Tom Cherry
3041a5100b init: don't import rc files during mount_all after Q
Importing rc files during mount_all was at best a stop gap until
Treble's first stage mount and at worst a bad idea.  It doesn't have a
reason to exist now that first stage mount exists and is required, and
always had edge cases where init could not handle loading some aspects
of scripts after it had started processing actions.

This change removes this functionality for devices launching after Q.

Test: devices boot
Change-Id: I3181289572968637b884e150d36651f453d40362
2019-05-21 17:48:33 -07:00
Treehugger Robot
e745214f34 Merge changes from topics "libmemunreachable_vendor_available", "libmemunreachable_version_script"
* changes:
  Make libmemunreachable vendor_available
  Hide most symbols in libmemunreachable
  Improve memunreachable ABI before making it vendor_available
2019-05-21 22:51:26 +00:00
Peter Collingbourne
68d3978fd1 Merge "Stop adding the bootstrap directory to rpath." 2019-05-21 22:42:50 +00:00
Elliott Hughes
547a94fd49 Merge "libziparchive: remove now-unused StartIteration overload." 2019-05-21 22:01:05 +00:00
Jiyong Park
7d89fb164b Add android::base::expected
android::base::expected is an Android implementation of the
std::expected proposal.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0323r7.html

For usage, refer to the expected.h header file and
expected_test.cpp

Bug: 132145659
Test: libbase_test

Change-Id: I65d3a1ecf8654d9858989755dfd0065c81f7b209
2019-05-22 06:39:27 +09:00
Treehugger Robot
e9db5c2120 Merge changes I3013c28d,Ic60970bc
* changes:
  bootstat: add recovery/fastboot boot reasons
  bootstat: label Mediatek boot reasons
2019-05-21 21:00:26 +00:00
Suren Baghdasaryan
891d0ece0f Merge "libprocessgroup: add flags to indicate when a controller failed to mount" 2019-05-21 20:22:49 +00:00
Hridya Valsaraju
d747dba9c0 fastbootd: reduce USB buffer size to 16K
Some USB controllers can only support transfers upto 16K.

Bug: 133208811
Test: fastboot flashall
Change-Id: Ic025bdd8e7a6cf2634fc24524fd189e0cc9efbb5
2019-05-21 13:08:52 -07:00
Mark Salyzyn
8d1be80de2 bootstat: add recovery/fastboot boot reasons
Test: none
Change-Id: I3013c28d02c9744bdfa312c179143f7db9e51596
2019-05-21 10:54:07 -07:00
Mark Salyzyn
4e7acf7075 bootstat: label Mediatek boot reasons
Comment which strings come from Mediatek devices to aid maintenance.

Test: compile
Bug: 74595769
Bug: 63736262
Change-Id: Ic60970bcbbb389e4158ee691c4c81e6514d3b870
2019-05-21 10:53:56 -07:00
Suren Baghdasaryan
fa7a05fe5f libprocessgroup: add flags to indicate when a controller failed to mount
Controllers listed in cgroups.json file might fail to mount if kernel is
not configured to support them. We need a way to indicate whether a
controller was successfully mounted and is usable to avoid logging errors
and warnings when a controller that failed to mount is being used. Add
flags bitmask to cgrouprc controller descriptor and use a bit to indicate
that controller is successfully mounted. Modify cpusets_enabled() and
schedboost_enabled() functions to use this bit and report the actual
availability of the controller.

Bug: 124080437
Test: libcutils_test with cpuset and schedtune controllers disabled
Change-Id: I770cc39fe50465146e3205aacf77dc3c56923c5d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-05-21 10:03:21 -07:00
Florian Mayer
7dc7c3a9c6 Merge "Include string.h for strcmp." 2019-05-21 11:53:46 +00:00
Treehugger Robot
b26696e2dd Merge changes I8186718c,I8d6f33e9,I56fe5e11,Ie4004c98,I531d3d60, ...
* changes:
  Enable native_bridge_support for libvndksupport
  Enable native_bridge_support for libprocessgroup
  Enable native_bridge_support for libcutils
  Enable native_bridge_support for libsystem_headers
  Enable native_bridge_support for libbacktrace_headers
  Enable native_bridge_support for libutils
2019-05-21 09:01:00 +00:00
Peter Collingbourne
3e48b66578 Merge "Link the "runtime" namespace to more namespaces." 2019-05-21 02:29:46 +00:00
Treehugger Robot
b545055f6d Merge "Get max-download-size from device during fastbootd for flashall/update" 2019-05-20 22:50:10 +00:00
Colin Cross
05719708d0 Make libmemunreachable vendor_available
Allow vendor processes to use libmemunreachable.

Bug: 132302484
Test: m checkbuild
Change-Id: I9ed1543bd3fb20208785a160251e912a0c7e334d
2019-05-20 15:18:08 -07:00
Colin Cross
086e33f4bb Hide most symbols in libmemunreachable
In preparation for making libmemunreachble vendor_available, hide
everything but the public ABI using a version script.  The unit
tests now have to compile statically against libmemunreachable,
so split out the tests that run against the public API into a
separate test.

Bug: 132302484
Test: atest memunreachable_test memunreachable_unit_test
Change-Id: Ie9dec073fdeee342776566abedd50f7498476eca
2019-05-20 15:18:03 -07:00
Colin Cross
025ed8aacd Improve memunreachable ABI before making it vendor_available
vendor_available: true means that some prebuilts will end up with
references to classes defined in memunreachable.h.  Add version
numbers and reserved fields to the classes and default initialize
everything to zero.

Bug: 132302484
Test: memunreachable_unit_test
Change-Id: Ic183fcc766acd2c4c7dc62efafcc2c75a636e407
2019-05-20 12:57:48 -07:00
Treehugger Robot
cd9b18f215 Merge "Check DTB image size for boot image header version 2 and above" 2019-05-20 17:40:44 +00:00
Hridya Valsaraju
83d856e4c5 Get max-download-size from device during fastbootd for flashall/update
Currently, during a 'fastboot flashall/fastboot update', the 'getvar
max-download-size' command is issued once to the device when it is in
bootloader mode and the same value is used even after the device boots
into fastbootd. If the max-download-size returned by bootloader is
greater than the max-download-size in fastbootd, this could break flash
as large images are broken down into chunks before downloading by using
the max-download-size variable. This will cause fastbootd to return
an error since it checks whether the buffer being downloaded has a size
greater than the max-download-size limit.

Test: fastboot flashall
Bug: 536870912

Change-Id: Ife7c1ec0583d80d4a31ecf01f1fc14a8365afe0d
2019-05-20 09:37:22 -07:00
vichang
de725e6e75 Merge "Allow linking to libicuuc.so and libicui18n.so from executable in /data" 2019-05-20 09:49:21 +00:00
Jiyong Park
724cbb080d Merge "Fix nullpointer dereference in libnativeloader" 2019-05-18 02:20:57 +00:00
Hridya Valsaraju
96fd8874ef Check DTB image size for boot image header version 2 and above
DTB in boot image is mandatory for boot image header version 2
and above. mkbootimg.py must check the size of the DTB image passed
to it and throw an error if the image is empty.

Test: build with no DTB files in BOARD_PREBUILT_DTBIMAGE_DIR
Bug: 133006443
Change-Id: I478fcdb8e77957848a93027e695fcb238c544d62
2019-05-17 16:49:56 -07:00
Florian Mayer
5795d0b1a8 Include string.h for strcmp.
Change-Id: I57a6505446e63567b0be8496cf1f0d9326e930f7
2019-05-17 19:49:26 +01:00
Jiyong Park
d970ccb56e Fix nullpointer dereference in libnativeloader
The `char* path` argument of OpenNativeLibrary() can be nullptr. We are
constructing std::string from the path, which is a bug. Fixing it by
using char* without converting it to std::string.

Test: run-gtests.sh
JniCompilerTest.CompileAndRunIntMethodThroughStubNormalCompiler
is successful.

Change-Id: I91249da7c1a72a2dff9bc77e477b465e0c7ee056
2019-05-17 18:51:44 +09:00
Peter Collingbourne
f6ce7d0de0 Stop adding the bootstrap directory to rpath.
This is no longer necessary now that the bootstrap linker does this
automatically.

Change-Id: Ifd8177cc9cf5f2dc2a18c467ddb0147f8182fc4c
2019-05-16 19:36:27 -07:00
Treehugger Robot
6efb8e7754 Merge "Trusty Keymaster@4.0" 2019-05-17 01:36:18 +00:00
Matthew Maurer
b321b410ff Trusty Keymaster@4.0
Adds support for proxying V4.0 commands to Trusty and makes 4.0 the
default when including trusty-base.mk.

Bug: 128851722
Test: Keymaster VTS 4.0 + Trusty
Change-Id: I2e2220963996fcb88d6953ee1a58af1b947b857d
2019-05-16 14:19:50 -07:00
Tom Cherry
8a3630e327 Merge "init: always initialize device-mapper" 2019-05-16 15:09:16 +00:00
Treehugger Robot
68b378f980 Merge "class_start_post_data also starts disabled services." 2019-05-16 15:08:30 +00:00
Treehugger Robot
205f1435e8 Merge changes Idb6ef31d,Ifb87ebae
* changes:
  Add README file for libnativeloader
  Fix style around header inclusion
2019-05-16 14:36:45 +00:00
dimitry
15f8ce36e2 Enable native_bridge_support for libvndksupport
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libvndksupport
a dependency of libutils greylisted library (available for apps
targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I8186718c5efee25261a9946ffb52df5f675bec26
2019-05-16 14:20:31 +02:00
dimitry
49c1f6efea Enable native_bridge_support for libprocessgroup
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libprocessgroup modules
needed by libutils greylisted library (available for apps targeting
Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I8d6f33e95e9f7424f5fa12f6fbabafa1d6c37413
2019-05-16 14:19:09 +02:00
dimitry
051d5cba80 Enable native_bridge_support for libcutils
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libcutils which is a
greylisted library (available for apps targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I56fe5e11a884d22714cfc4afb78bec0a352d6370
2019-05-16 14:17:00 +02:00
dimitry
11ea33776f Enable native_bridge_support for libsystem_headers
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libsystem_headers
a dependency of libutils greylisted library (available for apps
targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: Ie4004c981075b22d08e4cca8cb35a7df5e157d46
2019-05-16 14:13:38 +02:00
dimitry
49ab87bba4 Enable native_bridge_support for libbacktrace_headers
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libbacktrace_headers
a dependency of libutils greylisted library (available for apps
targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I531d3d60937c5f7a95daead29dfc5913bd663321
2019-05-16 14:07:43 +02:00
dimitry
454ba7ec88 Enable native_bridge_support for libutils
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libutils which is a
greylisted library (available for apps targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I58667558d2a673fc0d882cf623b7a1b6f6f305ec
2019-05-16 13:48:17 +02:00
Treehugger Robot
24529f4409 Merge "Hide non-bridged/bridged namespaces behind NativeLoaderNamespace class" 2019-05-16 11:25:33 +00:00
Martijn Coenen
acc45aa0a1 class_start_post_data also starts disabled services.
This keyword was introduced to support restarting services on devices
using APEX and FDE. The current implementation is not a restart, but
rather a 'reset' followed by a 'start', because the real /data must be
mounted in-between those two actions. But we effectively want this to be
a restart, which means that we also want to start 'disabled' services
that were running at the time we called 'class_reset_post_data'.

To implement this, keep track of whether a service was running when its
class was reset at post-data, and start all those services.

Bug: 132592548
Test: manual testing on FDE Taimen
Change-Id: I1e81e2c8e0ab2782150073d74e50e4cd734af7b9
Merged-In: I1e81e2c8e0ab2782150073d74e50e4cd734af7b9
2019-05-16 09:30:35 +02:00
Evgenii Stepanov
6e06bcce9c Merge "Initialize all fields of struct iocb." 2019-05-16 06:36:11 +00:00