Commit Graph

35927 Commits

Author SHA1 Message Date
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
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
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
Christopher Ferris 60521c7d52 Speed up map creation.
- Rewrite the Maps::Parse to use open, and a buffer on the stack.
- Rewrite the line parser away from sscanf. The current way sscanf
  is used does not catch many malformed lines. In addition, this
  new version improves performance by 50% over sscanf on sailfish.
- Add a lot of unit tests for the parser to make sure there are
  no problems. In addition, add a special line that was not rejected
  with the previous version of the code.
- Add new accessor to get the map at a particular index.
- Add a backtrace benchmark for map creation for both new and old.

This cl results in ~5% speedup and makes the new unwinder map creation
about the same for 64 bit. It's still a bit slower, but not by much.
On 32 bit, we are still about 5% slower than the old creation method,
though.

Bug: 23762183

Test: libunwindstack unit tests pass. Ran the new benchmarks.
Change-Id: Id4431e539f400984e6fad62153fdf4152d518322
2017-08-23 15:43:39 -07: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
Max Bires 4214d132b3 Add a feature to show which bugs are tracking which se denials
The feature references a new file created by the selinux make system
that is stored on device under /system/etc/selinux/ which contains a
scontext, tcontext, tclass, and the bug they map to. logd will
reference this map every time an selinux denial comes through to see if
it's a known denial with a bug attached and then add the bug number to
the denial that's logged.

go/selinux-bug-metadata

Bug: 34997782
Test: any denial -> bug map listed in the referenced file is correcty
displayed in the selinux denials that are logged

Change-Id: I75bab59917591ed700471a0b4922b5f02f86bee9
2017-08-23 15:05:36 -07: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 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
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
Felipe Leme 589523b7c3 Merge "Don't preserve file attributes when pulling bugreport file..." am: 8570d1db70 am: 009c2ddadc
am: 6d6ff64360

Change-Id: I4cec50a7ec2c76f355e1f1821564308d88ef5e2a
2017-08-22 23:10:58 +00:00
Felipe Leme 6d6ff64360 Merge "Don't preserve file attributes when pulling bugreport file..." am: 8570d1db70
am: 009c2ddadc

Change-Id: I3e283d7dfa29b42902c7470ca3489593ef7f7e25
2017-08-22 23:03:58 +00:00
Felipe Leme 009c2ddadc Merge "Don't preserve file attributes when pulling bugreport file..."
am: 8570d1db70

Change-Id: I5ef7737f08462af3b572d4995ee59dfe0ec2d51b
2017-08-22 22:47:55 +00:00
Treehugger Robot 8570d1db70 Merge "Don't preserve file attributes when pulling bugreport file..." 2017-08-22 22:41:26 +00:00
Wei Wang 4cea121872 init: add log to time spent in waiting for file
Bug: 64925999
Test: boot and take log
Change-Id: I7d37906708b5a4a195fb1ba1113641656d419e62
2017-08-22 14:09:11 -07:00
Josh Gao d879c171a0 Merge changes I2270cc0a,I55e5dc5a am: 2066e0585e am: 46244a6497
am: 40b849f88a

Change-Id: Iee1c51f4b0d78f47afc5f2c1c057f6cf9110dba8
2017-08-21 23:53:22 +00:00
Josh Gao 40b849f88a Merge changes I2270cc0a,I55e5dc5a am: 2066e0585e
am: 46244a6497

Change-Id: Iaf21dda5cc0bba2d46d092c7e53892388ec4cc28
2017-08-21 23:47:51 +00:00
Josh Gao 46244a6497 Merge changes I2270cc0a,I55e5dc5a
am: 2066e0585e

Change-Id: I72f3a3272bcce4f0e4f24050e5035810be040ec9
2017-08-21 23:41:53 +00:00
Treehugger Robot 2066e0585e Merge changes I2270cc0a,I55e5dc5a
* changes:
  adb: add track-devices-l service.
  adb: allow selection of a specific transport.
2017-08-21 23:34:30 +00:00
Josh Gao b0c1802615 adb: add track-devices-l service.
Add a way to get the full `devices -l` output on a continuous basis.

Test: manual
Change-Id: I2270cc0a0d7e1384ce19631724ddf2462d963ade
2017-08-21 14:15:07 -07:00
Josh Gao b122b17555 adb: allow selection of a specific transport.
Extend device selection to allow selecting a specific transport via
monotonically increasing identifier (visible in devices -l).

This is useful when using multiple devices (like hikey960...) that
have identical bogus serial numbers like 0123456789ABCDEF.

Bug: http://b/37043226
Test: adb -t {1, 2, 9999999} {get-serialno, shell, features}
Change-Id: I55e5dc5a406a4eeee0012e39b52e8cd232e608a6
2017-08-21 14:15:06 -07:00
Josh Gao 3cf521b16e Merge "fastboot: gracefully handle failure to open a USB device on OS X." am: 11be3e54bd am: 9a1e060dc6
am: 4a84cce540

Change-Id: I1ce89755f815cf81833308279b3a69398fe25787
2017-08-21 18:54:31 +00:00
Josh Gao 4a84cce540 Merge "fastboot: gracefully handle failure to open a USB device on OS X." am: 11be3e54bd
am: 9a1e060dc6

Change-Id: I4cef93d371b3327d063a6a16eb6ae7f6a64f740d
2017-08-21 18:47:32 +00:00
Josh Gao 9a1e060dc6 Merge "fastboot: gracefully handle failure to open a USB device on OS X."
am: 11be3e54bd

Change-Id: I366df52af24947a746fee515a8d16ff728a01deb
2017-08-21 18:42:01 +00:00
Treehugger Robot 11be3e54bd Merge "fastboot: gracefully handle failure to open a USB device on OS X." 2017-08-21 18:29:22 +00:00
Andreas Huber 99ca20c708 Merge "Fix use-after-free of stack-allocated temporary string." am: 4bcccdf998 -s ours am: 7ec963f00b -s ours
am: 3cb9fc6b74  -s ours

Change-Id: I477e4e79a369707f6518a0d9793b9881c7622154
2017-08-21 17:51:59 +00:00
Andreas Huber 3cb9fc6b74 Merge "Fix use-after-free of stack-allocated temporary string." am: 4bcccdf998 -s ours
am: 7ec963f00b  -s ours

Change-Id: I7d2e0c1a96db2bd6d93463258486c25d233e6bcd
2017-08-21 17:45:28 +00:00
Andreas Huber dbd2ac1202 Fix use-after-free of stack-allocated temporary string. am: c41b838baa
am: a5efddda90

Change-Id: Ic0871bfae738d3b1854a7543843c0a9cc72c049d
2017-08-21 17:40:57 +00:00
Andreas Huber 7ec963f00b Merge "Fix use-after-free of stack-allocated temporary string."
am: 4bcccdf998  -s ours

Change-Id: I719a6b2af7dae5d5a2dffffc7309f6adfb687456
2017-08-21 17:39:58 +00:00
Andreas Huber a5efddda90 Fix use-after-free of stack-allocated temporary string.
am: c41b838baa

Change-Id: I3eac4b22b885e7991256e5a7df8f37e6b9a10cce
2017-08-21 17:33:56 +00:00
Andreas Huber 4bcccdf998 Merge "Fix use-after-free of stack-allocated temporary string." 2017-08-21 17:31:02 +00:00
Andreas Huber c41b838baa Fix use-after-free of stack-allocated temporary string.
Bug: 64848081
Test: built and successfully booted again
Merged-In: I93c899249bf2cc5ab8d880c0eaff471518e73121

Change-Id: I93c899249bf2cc5ab8d880c0eaff471518e73121
2017-08-21 09:44:56 -07:00
Andreas Huber f5e0464683 Fix use-after-free of stack-allocated temporary string.
Bug: 64848081
Test: built and successfully booted again
Merged-In: I93c899249bf2cc5ab8d880c0eaff471518e73121

Change-Id: I93c899249bf2cc5ab8d880c0eaff471518e73121
2017-08-21 09:05:13 -07:00