Commit graph

13799 commits

Author SHA1 Message Date
Tom Cherry
cb716f976b init: Queue Triggers instead of Actions
When init queues a trigger, it actually enqueues all of the Actions
that match with that given trigger.  This works currently because
all init scripts are loaded and therefore all Actions are available
before init starts queueing any triggers.

To support loading init scripts after init has started queueing
triggers, this change enqueues Trigger objects instead of their
matching Actions.  Each Trigger object then matches its associated
Actions during its execution.

Additionally, this makes a few cosmetic clean ups related to triggers.

Bug: 23186545
Change-Id: I5d177458e6df1c4b32b1072cf77e87ef952c87e4
2015-08-21 10:14:43 -07:00
Tom Cherry
20391b1de5 bundle init.rc contents with its service
Bug: 23186545
Change-Id: I52616b8ab1165fdef716f9b8f958665f2308c12e
2015-08-21 10:14:43 -07:00
Daniel Erat
9a995b2c8f Merge "Use __ANDROID__ instead of __BRILLO__." 2015-08-19 23:47:47 +00:00
Daniel Erat
69200d9191 Use __ANDROID__ instead of __BRILLO__.
__ANDROID__ is defined automatically by the toolchain.

Bug: 23358460
Change-Id: Ib122bfc86a7af6ab6b0b1fcc29dc671e44049524
2015-08-19 17:38:45 -06:00
Steve Fung
d45556895c Merge "crash_reporter: Enable core dumps" 2015-08-19 22:32:38 +00:00
Bertrand Simonnet
0172dea6ee Merge "metrics: Add init script for metrics_daemon." 2015-08-19 22:21:26 +00:00
Yusuke Sato
e656be3313 Merge "Add |opts| argument to android_fork_execvp_ext" 2015-08-19 20:23:43 +00:00
Bertrand SIMONNET
73eaa46559 metrics: Add init script for metrics_daemon.
This init script creates the metrics data directory (/data/misc/metrics)
and starts the daemon.

BUG: 22953527

Change-Id: I21cd36f38a7a3550bc755cef5699e9a6ac3dfb94
2015-08-19 11:32:41 -07:00
Yusuke Sato
d81c3c6c45 Add |opts| argument to android_fork_execvp_ext
to allow the caller to send data to the child's stdin.

Bug: 21725996
Change-Id: I818f5cf61045286c8d64a91b6d50f05740329be1
2015-08-19 11:00:37 -07:00
Steve Fung
ab2ac7d114 crash_reporter: Enable core dumps
Fix various path/directory locations to their Android equivalents
to enable collection of core dumps and generation of mini dumps
to work correctly.  Also add the init script to initialize
crash_reporter.

Bug: 22874832
Change-Id: Iffb1529e5259c5da5ba7f6977b2787e738f68a78
2015-08-18 23:38:27 -07:00
Elliott Hughes
a169f3b401 Merge "adb: win32: fix unittest exit code parsing" 2015-08-19 03:37:23 +00:00
Elliott Hughes
d0cae5b9fe Merge "Remove a HAVE_MS_C_RUNTIME I missed." 2015-08-19 01:26:26 +00:00
Elliott Hughes
27507d8ba1 Remove a HAVE_MS_C_RUNTIME I missed.
Change-Id: I063c6c802b8967d812d4f4a0972f00b0a88704af
2015-08-18 18:03:04 -07:00
Sergio Giro
1d44be87ff Merge "libutils: fix overflow in String8::allocFromUTF8" 2015-08-18 17:04:07 +00:00
Sergio Giro
4eeacbeec0 libutils: fix overflow in String8::allocFromUTF8
Patch contributed in:
https://code.google.com/p/android/issues/detail?id=182908

Bug: 23290056
Change-Id: Ide0e9a8acc4e95a9104bab3ae803aa3a40098222
2015-08-18 14:44:54 +01:00
Yusuke Sato
4d09db9d1a Merge "perfboot.py: Add --end-tag option" 2015-08-18 05:44:04 +00:00
Yusuke Sato
3966ebb74d perfboot.py: Add --end-tag option
The current behavior, which is to use tags[-1] for end_tag, is good
enough in most cases, but sometime it makes more sense to use a
different one as end_tag.

For example, when optimizing APK scanning code in package manager,
using 'boot_progress_pms_scan_end' as end_tag would give us quicker
benchmark iterations as well as more relevant numbers possibly with
a smaller standard deviation.

Change-Id: Ic6371c936b36d1d87e9742502fd8958682a3b7d5
2015-08-17 22:07:34 -07:00
Nick Kralevich
6d81403797 Merge "libutils: fix signed/unsigned comparison warnings" 2015-08-18 04:00:00 +00:00
Nick Kralevich
3e6c451908 libutils: fix signed/unsigned comparison warnings
Change-Id: Ib283c85a404a20688c5357fa513e5d07c2f42803
2015-08-17 20:54:15 -07:00
Elliott Hughes
28595721b1 Merge "Replace HAVE_MS_C_RUNTIME with _WIN32 in system/core." 2015-08-17 20:50:50 +00:00
Elliott Hughes
cd4ef7581d Replace HAVE_MS_C_RUNTIME with _WIN32 in system/core.
Change-Id: I202c3185d177c85d02ee5d9f7e5bf3422c1422db
2015-08-17 12:38:58 -07:00
Spencer Low
b7e79af048 adb: win32: fix unittest exit code parsing
adb on Windows uses \r\n line-endings, so take that into account when
parsing output for the exit code.

Change-Id: I6a3d7c5ca455b0f0f7dae174866857e0aeee9926
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-16 16:38:47 -07:00
Evgenii Stepanov
428f626d1b Merge "Read global ASAN_OPTIONS from a file." 2015-08-16 18:42:38 +00:00
Nick Kralevich
084c00b804 Merge "init: add LOCAL_SANITIZE := integer" 2015-08-16 15:37:35 +00:00
Nick Kralevich
f90b653667 init: add LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: If73e6b382f2ee645fec406805739f9684ddbb5f0
2015-08-15 15:24:23 +00:00
Elliott Hughes
94a845d970 Merge "Lose ionice and renice to toybox." 2015-08-14 23:29:09 +00:00
Elliott Hughes
17ddfcb282 Lose ionice and renice to toybox.
Change-Id: I77264e70aeff5a2320ce178c8e7176b67b898bd9
2015-08-14 15:35:33 -07:00
David Pursell
b53b521e37 Merge "Add adb features." 2015-08-14 16:03:43 +00:00
David Pursell
f4bda75389 Merge "Add feature list to connection banner." 2015-08-14 16:01:50 +00:00
Dan Albert
90d4b739ab Add adb features.
Shows the features supported by the active adb server.

Change-Id: I4a58a2ca082823c43f7a49e2c62ff80df6426756
2015-08-14 08:25:23 -07:00
Dan Albert
1792c23cb8 Add feature list to connection banner.
This allows us to test for features explicitly rather than relying on
the protocol version number, allowing us to fall back gracefully if a
feature is not supported.

This will be needed for the upcoming shell upgrades for stdout/stderr
separation and exit code reporting.

Change-Id: Ibb1d8ad2611f7209901ee76d51346b453e9c5873
2015-08-14 08:24:37 -07:00
Elliott Hughes
15c6de7530 Merge "Start iterating USB pipe endpoints from 1." 2015-08-14 03:10:56 +00:00
Elliott Hughes
782daf892d Merge "Fix the Mac libbase build." 2015-08-14 03:10:34 +00:00
Elliott Hughes
2e5ae0044a Fix the Mac libbase build.
Change-Id: I34224fa66850915ef47c88ef4c79efbc53f3f38e
2015-08-13 20:09:29 -07:00
Elliott Hughes
2d4f852da4 Start iterating USB pipe endpoints from 1.
Bug: http://b/22829602
Change-Id: I5051880730ba8fadae5d78f1d19b5d527610d4a5
2015-08-13 16:00:12 -07:00
Siva Velusamy
4d40c03b0b Merge "adb: On Mac, clear both host and device endpoints at startup" 2015-08-13 21:51:34 +00:00
Siva Velusamy
d8b48a6281 adb: On Mac, clear both host and device endpoints at startup
This CL clears both the host and device endpoints right at the
beginning when the bulk endpoints are identified. This is in general
a "good idea", but more specifically for us, it fixes the issue
that sometimes when adb quits, it clears the endpoint on the host,
but not on the device which resulted in a subsequent invocation of
adb was seeing a stall.

Bug: https://code.google.com/p/android/issues/detail?id=182151

Change-Id: I331fa6805c40d1f50c153c010ceecd2f6a4045eb
2015-08-13 14:32:50 -07:00
Elliott Hughes
45288223d0 Merge "libbase: logging fixes" 2015-08-13 21:10:37 +00:00
Spencer Low
bdab59a861 libbase: logging fixes
Win32:

- getprogname(): call basename() which is available in mingw's crt.
  Don't potentially go recursive with DCHECK_GT().

- Use Win32 critical section instead of mutex.

Other:

- Change log_characters check to compile-time.

- Fix code that gets the basename of __FILE__. The previous code was not
  setting _file, so it didn't work.

- Save and restore errno for LOG calls. Inspired by similar Chromium code.

Change-Id: Ie7bb700918be726fa81d60177d1894d2daeff296
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-13 14:08:31 -07:00
Nick Kralevich
1efef4c49d Merge "Revert "init: add LOCAL_SANITIZE := integer"" 2015-08-13 18:15:11 +00:00
Nick Kralevich
c307b5b7f8 Revert "init: add LOCAL_SANITIZE := integer"
flounder isn't booting

This reverts commit aea73db1e3.

Bug: 23166814
Change-Id: I36c811d1ca30e2366066142d9282bb713dae315f
2015-08-13 18:10:50 +00:00
Elliott Hughes
57532b2a06 Merge "adb: improve network error info" 2015-08-13 17:49:21 +00:00
Elliott Hughes
8836031b27 Merge "adb: win32: fix shutdown deadlock" 2015-08-13 17:02:16 +00:00
Elliott Hughes
9537ca803f Merge "adb: start-server and kill-server error output" 2015-08-13 16:35:36 +00:00
Spencer Low
f18fc0879b adb: start-server and kill-server error output
- handle_host_request
  - When the host:kill command comes in, shutdown the socket before
    calling exit(). If we don't do this, the client will output error info
    even though everything is working ok.

- adb_connect()
  - If we can't parse the version string, explain this in error output
    and don't goto error which would try to close an fd we already closed.
  - If host:kill doesn't work, output error info. Don't try to close
    already closed fd.

- adb_main()
  - If writing the ACK somehow has an error, output error info (I doubt
    this will ever get hit).

- adb_commandline()
  - Fix typo about max port number.
  - Make 'adb kill-server' and 'adb start-server' output any detailed
    error info.

Change-Id: Id1a309cc1bf516f7f49bd332b34d30f148b406da
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-12 20:14:55 -07:00
Spencer Low
87e97ee305 adb: win32: fix shutdown deadlock
adb can hang at shutdown due to a deadlock relating to WSACleanup().
This works around the issue by not calling WSACleanup() which shouldn't
be done anyway since threads aren't done using Winsock at shutdown.

A quick way to reproduce the original problem is to run many instances
of adb, many of which will call exit() soon:

  for /l %i in (1,1,20) do @start adb nodaemon server

You may have to boost the 20 to 200, or set ADB_TRACE=1 or use Windows
10 instead of Windows 7, to affect the timing, but eventually there
should be hung adb processes with that repro.

A more complete fix to prevent problems like this from occuring in the
future, would be to additionally do the following:

- Investigate all static destructors that are called when exit() is
  called.

- If they don't do anything important, switch all calls to exit() to
  instead call _exit() and then ban exit() from being called.

Change-Id: Id1be3bf0053809a45f2eca4461e4c35b5ef9388d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-12 18:19:16 -07:00
Riley Andrews
b81c410abe Merge "Added file permissions for binder tracing" 2015-08-12 23:28:08 +00:00
Scott Bauer
cd1d99e268 Added file permissions for binder tracing 2015-08-12 16:20:51 -07:00
Riley Andrews
a3a193ffd9 Merge "Added shell permisisons for memreclaim tracing" 2015-08-12 23:13:38 +00:00
David Pursell
6fefa36cf2 Merge "adb: Fix PTY logic for non-interactive shells." 2015-08-12 22:16:20 +00:00