Commit graph

36253 commits

Author SHA1 Message Date
Mark Salyzyn
8b2136afe0 Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" am: 13cb599536 am: 37c6015d9d
am: a0641b5c13

Change-Id: Ia78340ffa961a3375dfa5f6b012f4f98bd7b01e3
2017-08-25 14:47:51 +00:00
Mark Salyzyn
a0641b5c13 Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" am: 13cb599536
am: 37c6015d9d

Change-Id: Ie884649d96ed020696a2ae6ba5bc46cf0d7ad92d
2017-08-25 14:37:44 +00:00
Mark Salyzyn
37c6015d9d Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property"
am: 13cb599536

Change-Id: Ib6c1b51668b892288db931b09b099bf5ed28fbae
2017-08-25 14:24:21 +00:00
Mark Salyzyn
13cb599536 Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" 2017-08-25 14:16:12 +00:00
Justin Yun
e2c3cb1634 vndk: add vendor/lib(64)/vndk for vendor namespace
am: 3094de9684

Change-Id: I389ceda99569f3aaebac1a8b5f04e02e146fa8f0
2017-08-25 07:35:48 +00:00
Justin Yun
3094de9684 vndk: add vendor/lib(64)/vndk for vendor namespace
When the vndk is extended by vendor, the libs in vendor/lib(64)/vndk
will override system/lib(64)/vndk libs. Vendor binaries will search
vndk libs in vendor/lib(64)/vndk prior to system/lib(64)/vndk.

Also, remove a workaround for libsdm-color.so

Bug: 65032513
Test: build and boot check for libsdm-color.so will be loaded on boot
Test: currently no libs exist on vendor/lib(64)/vndk. No test for it
Change-Id: I99ed37eb1a9e92c83533e2d92c9c06db11f01e97
2017-08-25 12:30:44 +09:00
Mark Salyzyn
73e6b49c0c Switch /data/misc/reboot/last_reboot_reason to persistent property
Switch from /data/misc/reboot/last_reboot_reason to persistent
Android property persist.sys.boot.reason for indicating why the
device is rebooted or shutdown.

persist.sys.boot.reason has a standard as outlined in b/63736262 and
the associated investigation. Made adjustments to the values so that
we did not create a problem even before we started. Compliance is
part of the tests in boot_reason_test.sh.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 64687998
Change-Id: I812c55a12faf7cb7ff92101009be058ad9958d07
2017-08-24 15:13:48 -07:00
Dimitry Ivanov
c54362127b Merge "Define current ABI string in android-base/macros.h" am: 2732a7e023 am: d98e5fc543
am: 1eafe1b47c

Change-Id: I3f78e605afb7184dbb4fcc4416e61af98d1fded1
2017-08-24 09:50:41 +00:00
Dimitry Ivanov
1eafe1b47c Merge "Define current ABI string in android-base/macros.h" am: 2732a7e023
am: d98e5fc543

Change-Id: Ic2832ccb89ad438d5af03024161d85a0d400c90f
2017-08-24 09:46:01 +00:00
Dimitry Ivanov
d98e5fc543 Merge "Define current ABI string in android-base/macros.h"
am: 2732a7e023

Change-Id: I23b96f14ce8e05a3ab36b7c32a29026f4f08ef60
2017-08-24 09:42:07 +00:00
Dimitry Ivanov
2732a7e023 Merge "Define current ABI string in android-base/macros.h" 2017-08-24 09:38:34 +00:00
Dmitry Shmidt
e9b1299f74 Merge "init: Fix -DUSER_MODE_LINUX compilation" am: 9a38df3f5f am: d1821522aa
am: 14a60d2e19

Change-Id: I67de65e24f4573166aa2e48160b33b3506e28ad1
2017-08-24 01:35:14 +00:00
Dmitry Shmidt
14a60d2e19 Merge "init: Fix -DUSER_MODE_LINUX compilation" am: 9a38df3f5f
am: d1821522aa

Change-Id: Ic34bcb0be554736edd6c293820ab1fc9ff79bf34
2017-08-24 01:29:29 +00:00
Dmitry Shmidt
d1821522aa Merge "init: Fix -DUSER_MODE_LINUX compilation"
am: 9a38df3f5f

Change-Id: I26d86100bb8f76325b46ba2c2d066e856d910396
2017-08-24 01:23:01 +00:00
Treehugger Robot
9a38df3f5f Merge "init: Fix -DUSER_MODE_LINUX compilation" 2017-08-24 01:14:36 +00:00
Elliott Hughes
22d9a9a249 Merge "Fix adb tcpip tests." am: d865b655d5 am: 37f256423b
am: 7096d47858

Change-Id: I090e1011627ce618623b132e2624cc1008d2ea1f
2017-08-24 00:59:13 +00:00
Elliott Hughes
7096d47858 Merge "Fix adb tcpip tests." am: d865b655d5
am: 37f256423b

Change-Id: I6f212225b8fe88235d4803b1129b66f5d650d1e4
2017-08-24 00:55:12 +00:00
Elliott Hughes
37f256423b Merge "Fix adb tcpip tests."
am: d865b655d5

Change-Id: I1b9938c36b59db8ce991928349ba6ee9c8459de1
2017-08-24 00:52:03 +00:00
Treehugger Robot
d865b655d5 Merge "Fix adb tcpip tests." 2017-08-24 00:45:59 +00:00
Jin Qian
a5339dbdc0 Merge "fastboot: bail out if failed to generate fs image" into oc-mr1-dev
am: feee3cce8a

Change-Id: Ifb099fab5c1c82c824e18cc52dfa4c7d3057fa9b
2017-08-24 00:11:46 +00:00
Justin Yun
60a6fc62d1 Merge "Mark the modules as VNDK-SP in Android.bp" am: bc9924ed40 am: 028664fcd3
am: 5982a46c40  -s ours

Change-Id: Ic58f8cf0f8718106416105ada7068dc3de050dc5
2017-08-23 23:33:02 +00:00
Justin Yun
5982a46c40 Merge "Mark the modules as VNDK-SP in Android.bp" am: bc9924ed40
am: 028664fcd3

Change-Id: I818d55b42e19078bc8b232fe2c319db397ef1e7a
2017-08-23 23:29:25 +00:00
TreeHugger Robot
feee3cce8a Merge "fastboot: bail out if failed to generate fs image" into oc-mr1-dev 2017-08-23 23:28:14 +00:00
Justin Yun
028664fcd3 Merge "Mark the modules as VNDK-SP in Android.bp"
am: bc9924ed40

Change-Id: I5f4802a063a1184ab1d246b3e81211923ab83853
2017-08-23 23:23:26 +00:00
Treehugger Robot
bc9924ed40 Merge "Mark the modules as VNDK-SP in Android.bp" 2017-08-23 23:11:31 +00:00
Tom Cherry
c3e9c2adca Merge changes I316c13e3,I4d99744d,Id9614b72,I7c98a0b7 am: a78b5b300b am: e0db940e52
am: ab6b6e2c3c

Change-Id: I8a3894121ff73bea73192f918252dd3db3bcbf53
2017-08-23 22:55:43 +00:00
Jin Qian
4e5e742e6e Merge "fastboot: bail out if failed to generate fs image" am: 6aab4e2ca5 am: 80aec12072
am: 3f89e4ac06

Change-Id: I18271a0679aa2b03a22b6b11507e46ffb6ef4d85
2017-08-23 22:49:33 +00:00
Elliott Hughes
e163298ef2 Fix adb tcpip tests.
The test was assuming we still output the full help for every syntax error.
While I'm here, make the diagnostics suck less.

Bug: N/A
Test: ran tests
Change-Id: Idc28616f20c66391f32046cf4216f122998a84bd
2017-08-23 15:43:34 -07:00
Tom Cherry
ab6b6e2c3c Merge changes I316c13e3,I4d99744d,Id9614b72,I7c98a0b7 am: a78b5b300b
am: e0db940e52

Change-Id: Id1e2523bf9a1d4719fdbd98c764ee4ae60ce2052
2017-08-23 22:35:43 +00:00
Jin Qian
3f89e4ac06 Merge "fastboot: bail out if failed to generate fs image" am: 6aab4e2ca5
am: 80aec12072

Change-Id: I85027ce44bf57c646d4e358f2a33170c5d6a31d9
2017-08-23 22:35:01 +00:00
Tom Cherry
e0db940e52 Merge changes I316c13e3,I4d99744d,Id9614b72,I7c98a0b7
am: a78b5b300b

Change-Id: I0e4221611fb34489b2ecdd713933a2e4ba4e5055
2017-08-23 22:24:09 +00:00
Jin Qian
80aec12072 Merge "fastboot: bail out if failed to generate fs image"
am: 6aab4e2ca5

Change-Id: I5d3b010ccbc4e9acf1731f1fc5ff50449b65a6a3
2017-08-23 22:23:25 +00:00
Tom Cherry
a78b5b300b Merge changes I316c13e3,I4d99744d,Id9614b72,I7c98a0b7
* changes:
  init: enable error reporting of builtin functions
  init: log Service failures via Result<T>
  init: pass errors from one Result<T> to another better
  init: cleanup environment handling
2017-08-23 22:07:30 +00:00
Treehugger Robot
6aab4e2ca5 Merge "fastboot: bail out if failed to generate fs image" 2017-08-23 22:01:53 +00:00
Dmitry Shmidt
c3bc509096 init: Fix -DUSER_MODE_LINUX compilation
Bug: 64985489
Test: Manual

Change-Id: Ib37d2b9affe500b66b9243fb24a7dee23b7730f2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-08-23 14:57:07 -07:00
Jin Qian
f0ecf57e56 fastboot: bail out if failed to generate fs image
we don't want to continue fastboot process if failed to
generate fs image. Print an error message and exit early.

Bug: 64915319
Change-Id: I5506d2a7a5063c188685633d6c3890239f9d658e
2017-08-23 13:58:47 -07:00
Jin Qian
1e0df16e20 fastboot: bail out if failed to generate fs image
we don't want to continue fastboot process if failed to
generate fs image. Print an error message and exit early.

Bug: 64915319
Change-Id: I5506d2a7a5063c188685633d6c3890239f9d658e
2017-08-23 13:43:15 -07:00
dimitry
b6ba817de4 Define current ABI string in android-base/macros.h
Test: make
Change-Id: I8200d7b3232edba43a583c5ff1e1b0f78c768f69
2017-08-23 20:46:38 +02:00
Tom Cherry
68f2a46145 init: enable error reporting of builtin functions
Enable error reporting when builtin functions fail.  These errors are
now reported with full context including the source file and line
number, e.g.

init: Command 'write /sys/module/subsystem_restart/parameters/enable_debug ${persist.sys.ssr.enable_debug}' action=early-boot (/init.bullhead.rc:84) took 0ms and failed: cannot expand '${persist.sys.ssr.enable_debug}'

There are two small caveats:
1) There are nearly 200 reports of builtins failure due to "No such
   file or directory".  Many of these are due to legacy paths included
   in rootdir/init.rc.  Until they are cleaned up, reporting of these
   failures is disabled.
2) Similarly, symlink is often used to create backwards compatible
   symlinks.  By their very nature, these calls are expected to fail
   on newer systems that do already use the new path.  Due to this,
   failures of symlink due to EEXIST are not reported.

Bug: 38038887
Test: boot bullhead, only see true errors reported from builtins.
Change-Id: I316c13e3adc992cacc6d79ffee987adc8738fca0
2017-08-23 11:05:37 -07:00
Tom Cherry
76af7e6a0c init: log Service failures via Result<T>
Log Service failures via Result<T> such that their context can be
captured when interacting with services through builtin functions.

Test: boot bullhead
Change-Id: I4d99744d64008d4a06a404e3c9817182c6e177bc
2017-08-23 11:05:37 -07:00
Tom Cherry
130e3d7204 init: pass errors from one Result<T> to another better
Result<T> currently has two problems,
1) A failing Result<T> cannot be easily constructed from a Result<U>'s
error.
2) errno is lost when passing .error() through multiple Result<T>'s

This change fixes both problems having Result<T>::error() return a
ResultError class that contains the std::string error message and int
errno.

It additionally has ostream operators to continue to allow printing
the error string directly to an ostream and also to pass the errno
through to another Result<T> class via Error() creation.

Lastly, it provides a new constructor for Result<T> for ResultError,
such that a Result<T> can be constructed from Result<U>::error().

Test: boot bullhead, init unit tests
Change-Id: Id9614b727cdabd2f5498b0da0e598e9aff7d9ae0
2017-08-23 11:04:32 -07:00
Tom Cherry
6de21f1112 init: cleanup environment handling
Init keep its own copy of the environment that it uses for execve when
starting services.  This is unnecessary however as libc already has
functions that mutate the environment and the environment that init
uses is clean for starting services.  This change removes init's copy
of the environment and uses the libc functions instead.

This also makes small clean-up to the way the Service class stores
service specific environment variables.

Test: boot bullhead
Change-Id: I7c98a0b7aac9fa8f195ae33bd6a7515bb56faf78
2017-08-23 10:09:21 -07:00
Justin Yun
9ca92458e2 Mark the modules as VNDK-SP in Android.bp
As a VNDK-SP module, Android.bp must have 'vndk' tag as well as
'vendor_available: true'.

The 'vndk' tag for VNDK-SP formated as follows:
vndk: {
    enabled: true,
    support_system_process: true,
},

VNDK-SP modules will be installed both in system/lib(64) as normal
and in system/lib(64)/vndk-sp as a vendor variant.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I51fe0859f63ad58b7b91909e7d7d4206443228cd
Change-Id: I51fe0859f63ad58b7b91909e7d7d4206443228cd
(cherry picked from commit aeb68e86e4)
2017-08-23 17:56:13 +09:00
Hung-ying Tyan
f151c8efd2 Merge "Move trusty reference implementations to /vendor" into oc-mr1-dev
am: 9495196e20

Change-Id: I8e21eb54387caa145eac24de9a4b1ec752e7193e
2017-08-23 02:42:18 +00:00
TreeHugger Robot
9495196e20 Merge "Move trusty reference implementations to /vendor" into oc-mr1-dev 2017-08-23 02:09:07 +00:00
Wei Wang
6c827ffb4f Merge "init: add log to time spent in waiting for file" am: 7f16cad877 am: 78f06df7b1 am: 9d4dc02f95
am: 9478eaa5a0

Change-Id: I9f20e47696503da7f13a4bcd10a0f793dd273a42
2017-08-23 00:16:22 +00:00
Wei Wang
9478eaa5a0 Merge "init: add log to time spent in waiting for file" am: 7f16cad877 am: 78f06df7b1
am: 9d4dc02f95

Change-Id: Iaca5c0efc5fcd9ba9810846f3862faf610599337
2017-08-22 23:54:45 +00:00
Wei Wang
9d4dc02f95 Merge "init: add log to time spent in waiting for file" am: 7f16cad877
am: 78f06df7b1

Change-Id: I0833d0007980d65a95fb7c96c00a0e16718b7fda
2017-08-22 23:39:47 +00:00
Wei Wang
78f06df7b1 Merge "init: add log to time spent in waiting for file"
am: 7f16cad877

Change-Id: Ie9eab8e63a1f391c9cac608c6db64abcf50d19a1
2017-08-22 23:33:47 +00:00
Treehugger Robot
7f16cad877 Merge "init: add log to time spent in waiting for file" 2017-08-22 23:23:25 +00:00