Commit graph

28696 commits

Author SHA1 Message Date
Bowgo Tsai
5f3e037e60 Merge "Add a PREUPLOAD.cfg file to run git-clang-format on every commit"
am: 59aea45254

Change-Id: Ibfb57f2d8f273c513e7f7fdef97676683a1c6ca9
2017-03-09 05:33:54 +00:00
Treehugger Robot
59aea45254 Merge "Add a PREUPLOAD.cfg file to run git-clang-format on every commit" 2017-03-09 05:30:19 +00:00
Alex Klyubin
f9ac2fa7b2 Merge "Use precompiled sepolicy when available"
am: dda9cbb350

Change-Id: I801189104c263b21d2252d957af25149cfbef648
2017-03-08 23:13:01 +00:00
Treehugger Robot
dda9cbb350 Merge "Use precompiled sepolicy when available" 2017-03-08 23:09:08 +00:00
Wei Wang
0d9416ba2e Merge "init.rc: add a new zygote-start trigger"
am: 4e5e797d26

Change-Id: Ic8e028c55fcca904c49814d1a3849ff8088f6458
2017-03-08 22:23:26 +00:00
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
Alex Klyubin
2d19aeb13a Use precompiled sepolicy when available
NOTE: This change affects only devices which use SELinux kernel policy
split over system and vendor directories/partitions.

Prior to this change, init compiled sepolicy from *.cil files on every
boot, thus slowing boot down by about 400 ms. This change enables init
to skip the step compilation and thus avoid spending the 400 ms. The
skipping occurs only if the device's vendor partition includes an
acceptable precompiled policy file. If no acceptable policy is found,
the compilation step takes place same as before.

Because such devices support updating system and vendor partitions
independently of each other, the vendor partition's precompiled policy
is only used if it was compiled against the system partition's policy.
The exact mechanism is that both partitions include a file containing
the SHA-256 digest of the system partition's policy
(plat_sepolicy.cil) and the precompiled policy is considered usable
only if the two digests are identical.

Test: Device with monolithic policy boots up just fine
Test: Device with split policy and with matching precompiled policy
      boots up just fine and getprop ro.boottime.init.selinux returns
      a number below 100 ms. No "Compiling SELinux policy" message in
      dmesg.
Test: Device with split policy and with non-matching precompiled
      policy boots up just fine and getpropr ro.boottime.init.selinux
      returns a number above 400 ms. There is a "Compiling SELinux
      policy" message in dmesg. The non-matching policy was obtained
      by adding an allow rule to system/sepolicy, building a new
      system image using make systemimage and then flashing it onto
      the device.
Bug: 31363362
Change-Id: Ic2e81a83051689b5cd5ef1299ba6aaa1b1df1bdc
2017-03-08 12:25:25 -08:00
Badhri Jagan Sridharan
a37bc179de Merge "adb: Do not signal gaget stack unless descriptors are written"
am: eab4c62e22

Change-Id: Ia04e413a6f3a0e3fcb1e8e52aa822accb808f1fb
2017-03-08 19:39:43 +00:00
Badhri Jagan Sridharan
eab4c62e22 Merge "adb: Do not signal gaget stack unless descriptors are written" 2017-03-08 19:33:10 +00:00
David Lin
9c23fcbcd9 Merge "init.rc: remove duplicated chown entry for timed_output"
am: e88882e16e

Change-Id: I2ba4ad3c1dd4ce0b4fd5f16d16b986d70b73985d
2017-03-08 18:44:39 +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
af4e750023 Merge "liblog: add LOGGER_STDERR frontend"
am: 6471b85143

Change-Id: I5098977938e0daae2300ba00d4ac786d51ccf580
2017-03-08 17:08:02 +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
Mark Salyzyn
3f09ed635b Merge "liblogcat: free up log_device_t structures"
am: e1bfafd241

Change-Id: I93377527aae460aec9d02f13c868d7998d182693
2017-03-08 15:15:57 +00:00
Treehugger Robot
e1bfafd241 Merge "liblogcat: free up log_device_t structures" 2017-03-08 15:11:28 +00:00
Bowgo Tsai
1aeb8d2107 Add a PREUPLOAD.cfg file to run git-clang-format on every commit
The style file .clang-format is copied from adb/.clang-format.
Each sub folders still can have different style by adding their own
.clang-format because git-clang-format uses the style file located
in one of the parent directories of the *source file*.

Also see the following link for previous discussions:

  https://android-review.googlesource.com/#/c/340106

Bug: 36046320
Test: repo upload, checks pre-submit fails when the uploading commit
      doesn't meet the style

Change-Id: I94369af197da1ccce581bbd861c8737f6a197429
2017-03-08 16:51:26 +08: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
f3fcb883b2 Merge "collect fs stat for ext4"
am: 5811a434fc

Change-Id: I7dafd4b35ac3efcf59bb940fb582694144056f2b
2017-03-07 19:32:40 +00: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
00c9fcdca9 Merge "Define _LOG as a weak symbol."
am: 6684ec8d97

Change-Id: Ibb3804ff53490abd2743ce8ba33c6833ac2a71ab
2017-03-07 02:52:53 +00:00
bohu
8e0c8c0dec Merge changes If9782396,If033c815
am: 5e148a58b8

Change-Id: I71a3305151dd8c9115f4922f13aea0fa90b82941
2017-03-07 02:52:33 +00:00
bohu
3f76473030 DO NOT MERGE ANYWHERE Qemu: make the qemu_pipe_open compatible with old apis
am: f7d64fd8e1  -s ours

Change-Id: Ieb68057b7563c9a14a3046b27324303b325095a8
2017-03-07 02:52:30 +00:00
Chenjie Luo
6684ec8d97 Merge "Define _LOG as a weak symbol." 2017-03-07 02:08:36 +00:00
Josh Gao
c0a62dda08 Merge changes Ib69a206f,If57cc175
am: 56e89ade33

Change-Id: Id6d1428be5519ab3ad4694cc4dea9ea96ff62d2e
2017-03-07 01:55:11 +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
675e05c48a Merge "Clarify that Condition::wait() can spuriously wake up"
am: 514e0aa2e2

Change-Id: I5b0ac24b95b86ac4bd5674407e84202fb0aa230b
2017-03-06 19:39:47 +00:00
Keun-young Park
e6a86f0bbb Merge "add ro.boottime.init.mount_all.* for measuring mount time"
am: 0c93ab67c6

Change-Id: Ib00eb7a66d317885f791cf80969ae75931309232
2017-03-06 19:36:49 +00: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
Alex Klyubin
590cf28434 Merge "Log stderr of secilc"
am: 8b4e7fe486

Change-Id: Ifb78f10609d36e4f20a45745f77e075d439ed861
2017-03-06 19:09:46 +00:00
Bowgo Tsai
63b22a3eb1 Merge "fs_mgr: allow disable dm-verity when the device is unlocked without metadata"
am: 17c84b2cca

Change-Id: I4e0e5ed112cb8d8abd0ee666e1c4d903713c9bbd
2017-03-06 19:06:48 +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
Mark Salyzyn
68741efbe3 Merge "liblogcat: introduce getopt_long_r"
am: 58381648b1

Change-Id: I3a3994f8f5d5f52b47239bd9aebb849a14eb3c8c
2017-03-06 18:26:20 +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
f7f0b53aec Merge "liblog: logprint, error return and truncated data"
am: 07169227e1

Change-Id: I2adb74fe54dfb6a4a6cc4b3f1a2898d7e0650560
2017-03-06 16:36:38 +00: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
Ralph Nathan
062a372ca7 Merge "Convert libbinderwrapper_test_support to be a static library"
am: f5dea8b393

Change-Id: I4288e975812fa753393faf8e82831eeab10957fd
2017-03-04 07:08:48 +00:00