Commit graph

34082 commits

Author SHA1 Message Date
Sandeep Patil
4cbedee541 Revert "Revert "init: poll in first stage mount if required devices are not found""
This reverts commit d6fccea093.

Bug: 62681642
Bug: 62682821
Bug: 62864413

Change-Id: Ic9c27552acbd2ae312e44ea2cdf060dcf493bfe6
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:04:57 -07:00
Sandeep Patil
cd2ba0d184 Revert "Revert "ueventd: remove PlatformDeviceList""
This reverts commit 516ff99711.

Bug: 62864413
Bug: 62864413

Change-Id: Ie3980cd536c2c83adace063f0950128f68561105
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:04:57 -07:00
Sandeep Patil
95366e97dd fs_mgr: differentiate if fs_mgr_set_verity() was skipped or disabled
In case of non-secure builds (eng variant) fs_mgr_setup_verity() skips
verity checks regardless of fstab options. This is slightly different
than 'adb disable-verity' where it would first read the verity metadata
to check if verity is disabled.

So, this change adds a new return value of FS_MGR_SETUP_VERITY_SKIPPED
instead of piggy backing on the FS_MGR_SETUP_VERITY_DISABLED.

Bug: 62864413
Test: Boot sailfish

Change-Id: I42bf2bdce0ecb18b4c3b568e2bc96bf1590dfb35
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:04:46 -07:00
Treehugger Robot
293936e41c Merge "Decode ptrace-induced SIGTRAP si_code values." 2017-06-21 21:59:25 +00:00
TreeHugger Robot
e3ae43e897 Merge "ld-config: Add HIDL memory libs to VNDK-SP" into oc-dev-plus-aosp 2017-06-21 20:28:39 +00:00
Yueyao Zhu
8e5671f55c Merge "healthd: add battery health status values from JEITA spec" am: 5dd87c4ef6
am: 7a79592e4e

Change-Id: Ife13b29af4f44d3d6f5cc7b00435f4c6a57e0d2b
2017-06-21 19:29:25 +00:00
Yueyao Zhu
7a79592e4e Merge "healthd: add battery health status values from JEITA spec"
am: 5dd87c4ef6

Change-Id: I6fa7b04fc8f274527074f323afc586239e8d478d
2017-06-21 19:27:55 +00:00
Treehugger Robot
5dd87c4ef6 Merge "healthd: add battery health status values from JEITA spec" 2017-06-21 19:11:45 +00:00
Tom Cherry
e6699f4507 Merge "Revert "ueventd: remove PlatformDeviceList"" am: 9c5f614945
am: b0350407f0

Change-Id: I6aa99f64455604b8919284c77a9faa5d8caa332e
2017-06-21 19:00:15 +00:00
Tom Cherry
4ee2b6feee Merge "Revert "init: poll in first stage mount if required devices are not found"" am: c9a27f79ad
am: 57579dd8c9

Change-Id: I48874fd559731a9ecdf973440cfca1021790b84f
2017-06-21 18:59:53 +00:00
Tom Cherry
b0350407f0 Merge "Revert "ueventd: remove PlatformDeviceList""
am: 9c5f614945

Change-Id: Id20400ea7f34fb202219da3b998d81302edc05df
2017-06-21 18:57:43 +00:00
Tom Cherry
57579dd8c9 Merge "Revert "init: poll in first stage mount if required devices are not found""
am: c9a27f79ad

Change-Id: I2a880097fe04c6b2fb859cca0bb4729e1f655eea
2017-06-21 18:57:21 +00:00
Tom Cherry
9c5f614945 Merge "Revert "ueventd: remove PlatformDeviceList"" 2017-06-21 18:42:22 +00:00
Tom Cherry
516ff99711 Revert "ueventd: remove PlatformDeviceList"
Bug: 62864413

This reverts commit c94ce7b130.

Change-Id: I014360251e5cda89c87adfec46d8b1e5000f3a9c
2017-06-21 18:42:07 +00:00
Tom Cherry
c9a27f79ad Merge "Revert "init: poll in first stage mount if required devices are not found"" 2017-06-21 18:41:57 +00:00
Tom Cherry
d6fccea093 Revert "init: poll in first stage mount if required devices are not found"
Bug: 62864413

This reverts commit ccf0d39316.

Change-Id: I343e304db4c0e7af2402397ef468cc743a3f08a9
2017-06-21 18:40:58 +00:00
Tom Cherry
152f4f4dad Merge "Revert "ueventd: remove PlatformDeviceList"" into oc-dev
am: fef83abd89  -s ours

Change-Id: I1450e83df62791e7acdb7dc46f07084f6232624a
2017-06-21 18:33:51 +00:00
Tom Cherry
a890341850 Revert "init: poll in first stage mount if required devices are not found"
am: 0e63e61eb5  -s ours

Change-Id: I113e5022d969da5d670f1a4767101f1fade85d7b
2017-06-21 18:31:20 +00:00
Tom Cherry
fef83abd89 Merge "Revert "ueventd: remove PlatformDeviceList"" into oc-dev 2017-06-21 18:18:24 +00:00
Tom Cherry
f520e44c4c Revert "ueventd: remove PlatformDeviceList"
Bug: 62864413

This reverts commit d43b615216.

Change-Id: If3d9060e723d6040d3f32f253b492131a56edb9f
2017-06-21 18:10:53 +00:00
Tom Cherry
0e63e61eb5 Revert "init: poll in first stage mount if required devices are not found"
Bug: 62864413

This reverts commit 5f4e8eac8a.

Change-Id: I6f35b920bb52875c8ef430d3e20b205fda5165e8
2017-06-21 18:10:47 +00:00
Narayan Kamath
b123220dd6 tombstoned: change path for traces from "anr_" to "trace_"
The only case where tombstoned creates files for java traces is
when the process is signalled "by hand" using "shell kill -3", or
by the program itself. Such traces do not correspond to an ANR, so
name those files "trace_XX".

When dumpstate / system_server want to dump java traces, they set up
a tombstoned intercept and manage the lifetime of any associated file
that themselves.

Bug: 32064548
Test: manual, debuggerd_test
Change-Id: I97006ec7c0cd35de4b9564f535e77af846cc3891
2017-06-21 18:00:09 +01:00
Elliott Hughes
336a52e00c Decode ptrace-induced SIGTRAP si_code values.
Example:

  signal 5 (SIGTRAP), code -32763 (PTRACE_EVENT_STOP), fault addr 0x274e00005fb3

I'm tempted to say that %d isn't the best choice for si_code, but as long as
we're fully decoding all the values, I don't think it matters.

Bug: http://b/62856172
Test: manual debuggerd run
Change-Id: Ieeca690828e1e12f4162bbadece53f4aa7b9537a
2017-06-21 08:45:33 -07:00
Elliott Hughes
428ebfa528 Merge "Shave a stack frame off asserts." am: 199c27734f
am: d10d64b244

Change-Id: I7b4d4f3497bdf95b651bfa8037a594c0faee50c4
2017-06-21 15:18:07 +00:00
Elliott Hughes
d10d64b244 Merge "Shave a stack frame off asserts."
am: 199c27734f

Change-Id: I4f67fa72d783c5fcdfa0c36291d06ba1edc8955c
2017-06-21 15:15:47 +00:00
Elliott Hughes
199c27734f Merge "Shave a stack frame off asserts." 2017-06-21 15:09:55 +00:00
Logan Chien
7b66b21773 ld-config: Add HIDL memory libs to VNDK-SP
This commit adds libhidlmemory.so and android.hidl.memory@1.0.so to the
exported libs of the `vndk` linker namespace (aka. VNDK-SP).  This is
necessary because some vendors' GLES implementation uses
libhidlmemory.so.  Check http://b/35107583#comment15 for the context.

Bug: 35107583
Test: sailfish boots

Merged-In: Idb5ba4ed4a89795e0e6105d55a84e7f6bbffff51
Change-Id: I1556b7499bd981af995f000519b7a314c70567d1
2017-06-21 20:15:36 +08:00
Logan Chien
ea2719f9f1 ld-config: Add HIDL memory libs to VNDK-SP
This commit adds libhidlmemory.so and android.hidl.memory@1.0.so to the
exported libs of the `vndk` linker namespace (aka. VNDK-SP).  This is
necessary because some vendors' GLES implementation uses
libhidlmemory.so.  Check http://b/35107583#comment15 for the context.

Bug: 35107583
Test: sailfish boots

Merged-In: Idb5ba4ed4a89795e0e6105d55a84e7f6bbffff51
Merged-In: I1556b7499bd981af995f000519b7a314c70567d1
Change-Id: I5af7c954d432a2e8de6c6b744cedbada836bbd98
2017-06-21 20:10:56 +08:00
Tom Cherry
eb877e3829 init: poll in first stage mount if required devices are not found
am: 5f4e8eac8a  -s ours

Change-Id: Ie794a45bdedf9d207231708606d0798b953b66b4
2017-06-21 04:22:44 +00:00
Tom Cherry
f615d49b6d ueventd: remove PlatformDeviceList
am: d43b615216  -s ours

Change-Id: I8b349dea6dd16583c8f6042ffe5d338b853db66f
2017-06-21 02:18:34 +00:00
Yueyao Zhu
9bbfbf7ffe healthd: add battery health status values from JEITA spec
Some vendors implement JEITA battery health spec.

Bug: 35780570
Test: build and boot
Change-Id: I532cd0fbdbcae0a32879de7d7930f3ccb8605ffd
2017-06-20 18:08:51 -07:00
Elliott Hughes
07db226264 Merge "Give a clear error message if we can't start the server." am: b6d3f28287
am: 1496863091

Change-Id: Ib069ba411e74e6d8c22799a37dc16642b728fb06
2017-06-21 01:02:52 +00:00
Elliott Hughes
1496863091 Merge "Give a clear error message if we can't start the server."
am: b6d3f28287

Change-Id: I47ffda6e9ee89aad714c53fb8647c3d8bf0eab20
2017-06-21 00:58:22 +00:00
Treehugger Robot
b6d3f28287 Merge "Give a clear error message if we can't start the server." 2017-06-21 00:48:30 +00:00
Elliott Hughes
56731b4e2f Shave a stack frame off asserts.
We can't implement MEM_LOG_ALWAYS_FATAL_IF any more, but it wasn't really
useful anyway.

Bug: N/A
Test: ran `crasher assert` and `crasher64 assert`
Change-Id: I4ae2d82fdfdd58cf8ef1dfb6c401cef4ba9d3e88
2017-06-20 17:31:29 -07:00
Martijn Coenen
f8280ffeac Merge "Remove libmemunreachable from the VNDK." am: e264c7bf4f
am: a8abd88010

Change-Id: I8d6afb9bcfdf46f4c046eb2441ba5ed747ec0e53
2017-06-21 00:14:50 +00:00
Martijn Coenen
a8abd88010 Merge "Remove libmemunreachable from the VNDK."
am: e264c7bf4f

Change-Id: Id7d372c52b5ada7e05b8ed1353c6dae0c97dfa1b
2017-06-21 00:10:22 +00:00
Martijn Coenen
e264c7bf4f Merge "Remove libmemunreachable from the VNDK." 2017-06-20 23:58:15 +00:00
Tom Cherry
e34a158b1a Merge "init: poll in first stage mount if required devices are not found" am: 20e9312344
am: 492a595091

Change-Id: I9123faa9377e8bb058d146e744106ea6e0522951
2017-06-20 21:36:31 +00:00
Tom Cherry
d989cf8f57 Merge "ueventd: remove PlatformDeviceList" am: 137ee511bd
am: 1632742602

Change-Id: I0e3ba605b26c525364371c984c6b3ebecb5f7f82
2017-06-20 21:36:04 +00:00
Tom Cherry
492a595091 Merge "init: poll in first stage mount if required devices are not found"
am: 20e9312344

Change-Id: I3055e999ff976662da18818756fc6ed07b09f360
2017-06-20 21:32:04 +00:00
Tom Cherry
1632742602 Merge "ueventd: remove PlatformDeviceList"
am: 137ee511bd

Change-Id: I3f49da6815cc0044e200565043b1ce0adbf39d26
2017-06-20 21:31:40 +00:00
Tom Cherry
5f4e8eac8a init: poll in first stage mount if required devices are not found
First stage mount in init currently attempts to regenerate uevents for
specific devices to create the corresponding dev nodes.  However, this
is racy as first stage mount happens early in the boot process and
it's possible that some of these devices have not yet been created by
the kernel.

To fix this issue, init will poll on the uevent socket for up to 10
seconds waiting for the kernel to create the required device.  It will
return false and panic if this 10 second timeout passes.

Note that the same uevent socket is used in the uevent regeneration
and the polling code, so there is no race if the device is created
after the uevent regeneration and before polling starts; the first
poll will pick up the device.

Bug: 62681642
Bug: 62682821
Test: Boot bullhead
Test: Boot sailfish
Test: Boot hikey + hotplug/unplug sdcard
Merged-In: I4a6ff043eb7115b729ca4954ebc6c9e000132993
Change-Id: I4a6ff043eb7115b729ca4954ebc6c9e000132993
2017-06-20 21:29:51 +00:00
Tom Cherry
20e9312344 Merge "init: poll in first stage mount if required devices are not found" 2017-06-20 21:24:23 +00:00
Tom Cherry
ccf0d39316 init: poll in first stage mount if required devices are not found
First stage mount in init currently attempts to regenerate uevents for
specific devices to create the corresponding dev nodes.  However, this
is racy as first stage mount happens early in the boot process and
it's possible that some of these devices have not yet been created by
the kernel.

To fix this issue, init will poll on the uevent socket for up to 10
seconds waiting for the kernel to create the required device.  It will
return false and panic if this 10 second timeout passes.

Note that the same uevent socket is used in the uevent regeneration
and the polling code, so there is no race if the device is created
after the uevent regeneration and before polling starts; the first
poll will pick up the device.

Bug: 62681642
Bug: 62682821
Test: Boot bullhead
Test: Boot sailfish
Test: Boot hikey + hotplug/unplug sdcard
Change-Id: I4a6ff043eb7115b729ca4954ebc6c9e000132993
2017-06-20 21:23:42 +00:00
Tom Cherry
137ee511bd Merge "ueventd: remove PlatformDeviceList" 2017-06-20 21:23:17 +00:00
Tom Cherry
d43b615216 ueventd: remove PlatformDeviceList
In order to create symlinks for USB and block devices, the path for
their parent platform device must be known.

Previously, ueventd would save each platform device that it encounters
to a list and query this list when creating the symlinks.  That,
however, is racy because the uevent socket does not differentiate
uevents from device_init() and uevents sent by the kernel when
probing a device first the first time.  The below scenario is the
faulty case:

1) Kernel probes parent platform device for a block device
2) ueventd calls device_init() and starts processing uevents
3) Kernel probes block device and sends its uevents
4) ueventd picks up the block device uevent during its uevent processing,
   without yet regenerating the platform device uevent, causing improper
   symlinks to be created.

This change stops storing the platform devices in a list, and instead
traverses up the directory structure for each USB or block device
until it reaches a platform device, defined as one whose subsystem is
the platform bus.  This fixes the race and simplifies the ueventd
code.

Bug: 62436493
Bug: 62681642
Test: Boot bullhead
Test: Boot sailfish
Test: Boot hikey + hotplug/unplug sdcard
Merged-In: I21636355d8e434f30e0cba568598a6cf139e67f9
Change-Id: I21636355d8e434f30e0cba568598a6cf139e67f9
2017-06-20 21:22:00 +00:00
Elliott Hughes
6eadee8607 Give a clear error message if we can't start the server.
Bug: http://b/35218713
Test: adb kill-server ; export HOME=/ ; adb devices
Change-Id: I53cc30213be0eab84e42b09c7b501362d6e44b05
2017-06-20 14:21:41 -07:00
Tom Cherry
c94ce7b130 ueventd: remove PlatformDeviceList
In order to create symlinks for USB and block devices, the path for
their parent platform device must be known.

Previously, ueventd would save each platform device that it encounters
to a list and query this list when creating the symlinks.  That,
however, is racy because the uevent socket does not differentiate
uevents from RegenerateUevents() and uevents sent by the kernel when
probing a device first the first time.  The below scenario is the
faulty  case:

1) Kernel probes parent platform device for a block device
2) ueventd calls RegenerateUevents() and starts processing uevents
3) Kernel probes block device and sends its uevents
4) ueventd picks up the block device uevent during its uevent processing,
   without yet regenerating the platform device uevent, causing improper
   symlinks to be created.

This change stops storing the platform devices in a list, and instead
traverses up the directory structure for each USB or block device
until it reaches a platform device, defined as one whose subsystem is
the platform bus.  This fixes the race and simplifies the ueventd
code.

Bug: 62436493
Bug: 62681642
Test: Boot bullhead
Test: Boot sailfish
Test: Init unit tests
Test: Boot hikey + hotplug/unplug sdcard
Change-Id: I21636355d8e434f30e0cba568598a6cf139e67f9
2017-06-20 21:21:14 +00:00
Christopher Ferris
0da25d6feb Merge "Fix some memory leaks, potential errors." am: 9d239ec6a5
am: 60d677147e

Change-Id: I184799dd198d6469326f0c07dfb15a5323e9af69
2017-06-20 18:44:22 +00:00