Commit graph

27083 commits

Author SHA1 Message Date
Treehugger Robot
4e5e797d26 Merge "init.rc: add a new zygote-start trigger" 2017-03-08 22:18:11 +00:00
Wei Wang
a2058036ed init.rc: add a new zygote-start trigger
Bug: 35110957
Test: marlin boots
Change-Id: I12b41588371486e79938df2f7a2152cda18530d1
2017-03-08 12:39:41 -08:00
Badhri Jagan Sridharan
eab4c62e22 Merge "adb: Do not signal gaget stack unless descriptors are written" 2017-03-08 19:33:10 +00:00
Treehugger Robot
e88882e16e Merge "init.rc: remove duplicated chown entry for timed_output" 2017-03-08 18:39:49 +00:00
Mark Salyzyn
6471b85143 Merge "liblog: add LOGGER_STDERR frontend" 2017-03-08 17:03:44 +00:00
Mark Salyzyn
4d99c986d9 liblog: add LOGGER_STDERR frontend
Standalone, this logger provides no end-to-end capability.  Only
provides a writer, no reader transport.  All output goes, logcat-like,
into the stderr stream.  Output can be adjusted with environment
variables ANDROID_PRINTF_LOG and ANDROID_LOG_TAGS.

liblog_*.__android_log_bswrite_and_print___max print fails if a string
member is truncated with "Binary log entry conversion failed" and -1.
We expose the truncated content in the tests and in LOGGER_STDERR.

The purpose of this transport selection is for command-line tools,
providing a means to shunt the logs to be mixed in with the tool's
error stream.

Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: If344b6e3e67df2dc86ce317cfad8af8e857727b7
2017-03-08 07:17:31 -08:00
Treehugger Robot
e1bfafd241 Merge "liblogcat: free up log_device_t structures" 2017-03-08 15:11:28 +00:00
David Lin
489450abe3 init.rc: remove duplicated chown entry for timed_output
Test: build

Change-Id: Ib15be4188cdce270a15bd90304be0704d9e54cbf
Signed-off-by: David Lin <dtwlin@google.com>
2017-03-07 21:31:42 -08:00
Badhri Jagan Sridharan
43fd1a4ea7 adb: Do not signal gaget stack unless descriptors are written
While recovering from endpoint errors, the gadget stack was being
signalled even when desriptors were NOT being rewritten. Avoid this
as this might cause enumeration loops.

Bug: 36036550
Change-Id: Iff2b2fc8cded001ef3c77dc170dce3b96848970c
2017-03-07 19:20:54 -08:00
Mark Salyzyn
13e4735526 liblogcat: free up log_device_t structures
Was leaking log_device_t in command path.  Cleanup leak in command
path and add thorough clean up on destroy for insurance.

Start grouping related like-type variables in the context structure
for more effective layout.

Test: gTest logcat-unit-tests
Bug: 35326290
Change-Id: Ibfbddec2d0e1bce24b87b035d67726cac1395574
2017-03-07 14:23:43 -08:00
Keun-young Park
5811a434fc Merge "collect fs stat for ext4" 2017-03-07 19:30:54 +00:00
Keun-young Park
3fbf94e19a collect fs stat for ext4
- This is to collect data to understand if e2fsck -f option
  can be dropped wholly based on information from fs.
- Ideally e2fsck should not fix fs if it was clean shutdown
  or if it is not enabling quota.
- The log is added to /dev/fscklogs/log and other system components
  can collect it later.

TODO: add mechanism to distinguish old vs new fs generation tool.

bug: 32246772
Test: reboot and check saved logs under different shutdown conditions (clean, non-clean)

Change-Id: Id00fad4c5f8ebbb9f9908164a1026e415df06721
2017-03-06 19:39:58 -08:00
Chenjie Luo
6684ec8d97 Merge "Define _LOG as a weak symbol." 2017-03-07 02:08:36 +00:00
Treehugger Robot
5e148a58b8 Merge changes If9782396,If033c815
* changes:
  DO NOT MERGE ANYWHERE Qemu: make the qemu_pipe_open compatible with old apis
  DO NOT MERGE ANYWHERE Emulator: Enhance qemu_pipe.h to handle partial read and write
2017-03-07 00:59:10 +00:00
Chenjie Luo
97258aad8a Define _LOG as a weak symbol.
So _LOG could be overridden by customized logging
implementations in non-Android systems.

Bug: 35919515
Test: Test on device
Change-Id: I0885c15353c0b1bf66f6f156e7f502f326b85d57
2017-03-06 15:04:32 -08:00
Treehugger Robot
56e89ade33 Merge changes Ib69a206f,If57cc175
* changes:
  tombstoned: turn off signal handlers.
  tombstoned: create tombstones with 0640 permissions.
2017-03-06 22:26:17 +00:00
Josh Gao
55f79a5953 tombstoned: turn off signal handlers.
Don't try to connect to ourselves in a signal handler (e.g. if someone
does `killall -ABRT tombstoned`).

Test: killall -ABRT tombstoned
Change-Id: Ib69a206f741acb523c9f2883d474c940b6ebfab2
2017-03-06 12:30:25 -08:00
Josh Gao
8830c95def tombstoned: create tombstones with 0640 permissions.
Make tombstones group readable to allow them to be picked up by the
dropbox service.

Bug: http://b/35979630
Test: killall -ABRT rild; dumpsys dropbox
Change-Id: If57cc17563c80d5b5c4887b0937905bffef6b231
2017-03-06 12:30:25 -08:00
Tom Cherry
514e0aa2e2 Merge "Clarify that Condition::wait() can spuriously wake up" 2017-03-06 19:26:30 +00:00
Keun-young Park
0c93ab67c6 Merge "add ro.boottime.init.mount_all.* for measuring mount time" 2017-03-06 19:25:50 +00:00
Treehugger Robot
8b4e7fe486 Merge "Log stderr of secilc" 2017-03-06 19:06:13 +00:00
Treehugger Robot
17c84b2cca Merge "fs_mgr: allow disable dm-verity when the device is unlocked without metadata" 2017-03-06 18:57:02 +00:00
Treehugger Robot
58381648b1 Merge "liblogcat: introduce getopt_long_r" 2017-03-06 18:18:48 +00:00
Mark Salyzyn
e9ade17418 liblogcat: introduce getopt_long_r
Resolve one of the threading issues by creating a private C++ified
copy of getopt_long_r that started out its life as the bionic
getopt_long, but is reentrant.  Adds a new state context for the
stderr stream called optstderr.  Utilize this new function in logcat.
Control opterr and optstderr to match liblogcat expectations.  Correct
and fortify const.

Alternative would be to lock around _all_ getopt callers.  This has
the advantage of requiring _no_ locks that could get in the way of
using liblogcat in a signal handler.  The log reader interface does
run the risk of incurring locks and heap allocations though, so there
is more work to be done for that final goal.

Test: gTest logcat-unit-tests
Bug: 35326290
Change-Id: Ibb1b374c55d357d5d7fa5ad00bfaf07ae0bc4ba5
2017-03-06 08:40:16 -08:00
Mark Salyzyn
07169227e1 Merge "liblog: logprint, error return and truncated data" 2017-03-06 16:31:35 +00:00
Bowgo Tsai
7ad3159db9 fs_mgr: allow disable dm-verity when the device is unlocked without metadata
To start Treble VTS test, a single AOSP system.img will be flashed onto
the device. The size of AOSP system.img might be different than the
system partition size on device, making locating verity metadata fail
(at the last fixed size of the partition).

This change allows disabling dm-verity on system partition when the
device is unlocked (orange device state) with invalid metadata.

BUG: 35603549

Test: Boot bullhead with a different-sized system.img, checks verity is
      not enabled via:

          "adb shell getprop | grep partition.system.verified"

Change-Id: Id89d023e82c78ff1902ab7a528431cf7f65e49ad
2017-03-06 16:04:03 +08:00
Alex Klyubin
1185050767 Log stderr of secilc
This makes init log stderr of secilc invoked to compile SELinux
policy. Having an explanation for why secilc failed is very useful for
debugging boot issues.

Test: Device with PRODUCT_FULL_TREBLE boots up just fine
Test: Modified init.cpp to reference non-existent .cil file on a device
      with PRODUCT_FULL_TREBLE and confirmed that dmesg now contains the
      error message from secilc saying that the file was not found.
Bug: 31363362

Change-Id: I6a3b3576daf0d6fd09e2c79bc43ae63850f44a00
2017-03-05 14:29:16 -08:00
Treehugger Robot
f5dea8b393 Merge "Convert libbinderwrapper_test_support to be a static library" 2017-03-04 07:03:34 +00:00
Keun-young Park
69fae7b3dc add ro.boottime.init.mount_all.* for measuring mount time
- three properties: .early, .default, .late
- for tracking critical early boot times

bug: 35949600
Test: manual, getprop after boot

Change-Id: I851891518428e6e21cb43a2a6f982ab7db281d4c
2017-03-03 18:57:09 -08:00
Ralph Nathan
823aeffbcf Convert libbinderwrapper_test_support to be a static library
Some unittests require libbinderwrapper_test_support.so and fail
because it isn't on userdebug images.

Bug: 30631078, 35804180
Test: `make dist`

(cherry picked from commit 6515f36e43082ea105115de7e34d9cd09c77220a)

Change-Id: I4d8878de8963d0cbd29d6aca4b233ba674121688
2017-03-03 17:14:04 -08:00
Elliott Hughes
4463c820a6 Merge "Small debuggerd improvements." 2017-03-04 00:20:14 +00:00
Josh Gao
817b2f3b2c Merge "adb: turn on libusb by default." 2017-03-04 00:11:10 +00:00
Alex Klyubin
8df4dded13 Merge "Track the move of split SELinux policy CIL files" 2017-03-03 21:43:24 +00:00
Mark Salyzyn
b1d150bc42 liblog: logprint, error return and truncated data
android_log_processBinaryLogBuffer and android_log_processLogBuffer
error return should have message and messageLen fields set to zero,
or to a valid-but-truncated buffer so that we can discern the
difference.  This will resolve an issue with reporting content from
an uninitialized field in liblogcat should caller add --debug flag.

To enhance the debugging capability, truncated string events because
of the logger limits are provided rather than dropping the field, but
still with an error return.

Some minor coding style issues resolved. Add required, or remove
extraneous spaces.  Use C-style comments only.

Test: gtest liblog-unit-tests
Bug: 27405083
Bug: 35326290
Change-Id: I4a7ddd7278fb1c582f921e1ba10e0765fadb791b
2017-03-03 11:10:11 -08:00
Alex Klyubin
c2a4c9ab9a Track the move of split SELinux policy CIL files
The three CIL files comprising split sepolicy are being moved from the
root directory to system and vendor directories based on whether the
file is for platform/system policy or non-platform/vendor policy.

Test: Device boots, no additional SELinux denials. This test was run
      for a device which has split policy and for a device which has
      monolithic policy.
Bug: 31363362
Change-Id: Ica49f0beae56be0f1cea7117e48bf2f6af8b848b
2017-03-03 10:35:10 -08:00
bohu
f7d64fd8e1 DO NOT MERGE ANYWHERE Qemu: make the qemu_pipe_open compatible with old apis
Commit c7b098ceb5 has changed
the qemu_pipe_open interface to require the "pipe:" prefix in
the service name.

However in APIs 24 and before, the "pipe:" prefix is not required
This causes quite some confusion and bugs since it is very common
to forget the difference when working across differnet APIs.

This CL is meant to make qemu_pipe_open work in both cases by
doing the following:
1. try the service name as is;
2. if it fails, add 'pipe:' prefix and try the service name again.

Change-Id: If9782396c03780fad1aadeb8374eb308517dc963
2017-03-02 20:46:04 -08:00
Treehugger Robot
0ab93fdf3a Merge "Include correct type of SELinux policy" 2017-03-03 03:50:49 +00:00
Elliott Hughes
12b7129406 Small debuggerd improvements.
Include the ABI in seccomp causes.

Slightly improved command-line usage information.

Fix crasher for seccomp failures.

Bug: N/A
Test: crasher
Change-Id: Ie419ecfe72ee4f5ccf49c927be18350a58a66a90
2017-03-02 19:01:20 -08:00
Keun-young Park
22cc398d76 Merge "use ro.persistent_properties.ready for persistent props ready" 2017-03-02 22:41:30 +00:00
Alex Klyubin
b51f9abf45 Include correct type of SELinux policy
This makes the build system include split SELinux policy (three CIL
files and the secilc compiler needed to compile them) if
PRODUCT_FULL_TREBLE is set to true. Otherwise, the monolitic SELinux
policy is included.

Split policy currently adds around 400 ms to boot time (measured on
marlin/sailfish and bullhead) because the policy needs to be compiled
during boot. This is the main reason why we include split policy only
on devices which require it.

Test: Device boots, no additional SELinux denials. This test is
      performed on a device with PRODUCT_FULL_TREBLE set to true, and
      on a device with PRODUCT_FULL_TREBLE set to false.
Test: Device with PRODUCT_FULL_TREBLE set to true contains secilc and
      the three *.cil files, but does not contain the sepolicy file.
      Device with PRODUCT_FULL_TREBLE set to false contains sepolicy
      file but does not contain the secilc file or any *.cil files.
Bug: 31363362

Change-Id: I419aa35bad6efbc7f936bddbdc776de5633846fc
2017-03-02 13:25:17 -08:00
Josh Gao
f2f0b31850 adb: turn on libusb by default.
Bug: http://b/31321337
Test: python test_device.py
Change-Id: Idb2ff1108331bf505feeeb943b6be7bb78124618
2017-03-02 13:23:56 -08:00
Treehugger Robot
497cb085c7 Merge changes I66d4fc71,I686dce91,I31325c76
* changes:
  libadfhwc: Fix adf_hwc_close
  libadfhwc: add adf_set_active_config_hwc2 support
  libadfhwc: support hwc2 display attributes
2017-03-02 20:54:44 +00:00
Tom Cherry
f1147f7dde Clarify that Condition::wait() can spuriously wake up
Also, remove the clarification that Condition::signal() wakes exactly
one thread as in the presence of spurious wake ups, this clarification
does not provide a safe guarantee to developers.

Bug: 34592766
Test: Build
Change-Id: I34df02e44a70a18fe04ceda858d002ef129c1fd9
2017-03-02 12:36:45 -08:00
Bo Hu
8c35491151 Merge "DO NOT MERGE ANYWHERE Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe" 2017-03-02 18:03:30 +00:00
Marissa Wall
956f1f64a1 libadfhwc: Fix adf_hwc_close
The adf hwc event thread now responds to pthread_kill which
allows adf_hwc_close to succeed.

Test: Call "adb shell stop" and check if thread exits.
      This change will allow testing of libadfhwc in future patches.

Change-Id: I66d4fc71a058db42af8d42b5d6193378a8b5d972
2017-03-02 17:40:16 +00:00
Marissa Wall
b4f0041421 libadfhwc: add adf_set_active_config_hwc2 support
Add the necessary set mode support to enable HWC2's set_active_config

Test: run gtests located in frameworks/native/services/surfaceflinger/tests/hwc2
Change-Id: I686dce91a2d8fe86db13c66d22f81960c2f8e8f2
2017-03-02 17:40:09 +00:00
Marissa Wall
9dcd750d81 libadfhwc: support hwc2 display attributes
adf_getDisplayAttributes_hwc2 gets the display attributes using the updated
enums from HWC2

Test: run gtests located in frameworks/native/services/surfaceflinger/tests/hwc2
Change-Id: I31325c764ccaf65c6d970727b56327d24c7b16d8
2017-03-02 17:40:02 +00:00
bohu
f099dce4a6 DO NOT MERGE ANYWHERE Emulator: Enhance qemu_pipe.h to handle partial read and write
Partial read and write happen and it is better to try again
unless there is some hard error. This is meant to fix some
flaky behavior of emulator pipe services, hopefully.

BUG: 35207286

manually tested this on emulator image.

Change-Id: If033c815e621002313c45d1bcd9a92d2d75da4ad
2017-03-01 23:37:01 -08:00
Treehugger Robot
056eca201b Merge "Use split SELinux policy at boot, if available" 2017-03-02 01:02:15 +00:00
bohu
294d44be33 DO NOT MERGE ANYWHERE Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe
Traditionally, qemu_pipe has both the declaration and implentation of each
function in one header file--qemu_pipe.h, and it is getting incovenient to
maintain.

This CL separates the implementation of functions from the header file,
and makes qemu_pipe a static library for other modules to link to.

Note that the interface and implementation of qemu_pipe are kept unchanged,
and future CLs will enhance the implementation to make it more reliable and
more compatible with old and new API levels.

Following projects are affected by this refactoring, and they are modified
accordingly:

device/generic/goldfish
device/generic/goldfish-opengl
hardware/ril/reference-ril

Change-Id: I541ecbf0cc7eadeef9d4e37ffd9ca7bfcc5c94c0
2017-03-01 16:33:44 -08:00