Commit graph

47898 commits

Author SHA1 Message Date
Tom Cherry
d38aafd20b ueventd: add more logging when firmware loading fails
Bug: 130131892
Test: boots
Change-Id: I82ce0f72341bb44590177cedaa2e3a7990456c1d
2019-05-23 16:27:33 -07:00
Treehugger Robot
9252d31361 Merge "init: add error handling in control message" 2019-05-23 23:08:51 +00:00
Mark Salyzyn
65d8b9be99 recovery: report compliant reboot reason (Part Deux)
shutdown and reboot should have a corresponding sub-reason.

Updating:
    "reboot,userrequested,fastboot"
    "reboot,userrequested,recovery"
    "reboot,userrequested,recovery,ui"
    "shutdown,userrequested,fastboot"
    "shutdown,userrequested,recovery"
    "reboot,unknown#" (Can't happen, debug)

Test: none
Bug: 133326470
Change-Id: Icf1ab0d462ec2de2272914a36994a095998d6186
2019-05-23 13:53:03 -07:00
Mark Salyzyn
b42af0eb5b Merge changes I784bea3a,Id3b2dfdc
* changes:
  adb-remount-test: report lsusb for broken connection
  adb-remount-test: stderr cleanup
2019-05-23 20:03:49 +00:00
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
Tom Cherry
9949ec5f56 init: replace Result<> with expected<>
Android-base has an implementation of the future std::expected<>.
This provides the same baseline functionality as Result<>, so use it
instead of our own version.

Bug: 132145659
Test: boot, init unit tests
Change-Id: I11e61bcb5719b262a6420483ed51a762826a9e23
2019-05-22 15:23:01 -07:00
Josh Gao
db64696b7c adbd: provide MS OS descriptors for WinUSB.
Add Microsoft OS Descriptors so that on Windows, we get automatically
registered with the WinUSB driver instead of requiring a different INF
to be used with device with a different vendor ID.

Bug: http://b/68993980
Test: manually changed the vendor ID on a blueline and connected it to a Windows VM
Change-Id: Id78bae270df9805573a90a86019267b53a3c8252
2019-05-22 14:58:13 -07: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
Mark Salyzyn
37921491a5 adb-remount-test: try to fixup device after reboot (recovery)
If device records a boot failure, the device could enter recovery
mode.  If so, try another reboot to see if the device will heal.

Test: adb-remount-test.sh
Bug: 132070014
Change-Id: I4bee37e11f6344ab1ce176233d7d4e50df132cd7
2019-05-22 14:48:06 -07:00
Mark Salyzyn
30afd8b90b adb-remount-test: try to fixup device after reboot (fastboot)
If bootloader records a boot failure for a slot, the device can
enter fastboot mode.  If so, set the expected slot and reboot.

Test: adb-remount-test.sh
Bug: 132070014
Change-Id: I801dcec7fd94ff084e54f585370d3c704a0de265
2019-05-22 14:47:58 -07:00
Mark Salyzyn
fb31593542 adb-remount-test: report lsusb for broken connection
Get more details about the usb connection when it times out.

Test: adb-remount-test.sh
Bug: 132070014
Change-Id: I784bea3a2cefcef423b576854abb795add47d123
2019-05-22 14:47:50 -07:00
Mark Salyzyn
1e5ab4811a adb-remount-test: stderr cleanup
Push stderr redirection to outer blocks if possible.

Test: adb-remount-test.sh
Bug: 132070014
Change-Id: Id3b2dfdcf0d778053e10fdb26eb0b1d99b455a46
2019-05-22 14:47:41 -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