Commit graph

24398 commits

Author SHA1 Message Date
Nick Kralevich
6b694a76f5 ion.c: add O_CLOEXEC to /dev/ion open
Test: device boots and no obvious problems.
Change-Id: I0845b79de49b77878adaf6cd14cc506f7586cccb
2016-11-29 15:20:33 -08:00
Treehugger Robot
9bfd9f558b Merge "system/core: replace EVENT_TAG_MAP_FILE with NULL" 2016-11-29 19:37:48 +00:00
Treehugger Robot
5b21deb786 Merge changes I1d03564f,I883e4e6c
* changes:
  adb: be more permissive in test_push_error_reporting.
  adb: make sure that file mode macros match linux.
2016-11-29 18:13:07 +00:00
Treehugger Robot
a10bd47d60 Merge "Revert "init: Reworked how we wait for COLDBOOT_DONE"" 2016-11-29 18:05:51 +00:00
Elliott Hughes
a452660d92 Revert "init: Reworked how we wait for COLDBOOT_DONE"
This reverts commit d36115ef2f.

Change-Id: I599b0eeebf9c062852323f2a4a986b18dd85288a
2016-11-29 16:34:56 +00:00
Billy Lau
57c31d0f17 Merge "init: Reworked how we wait for COLDBOOT_DONE" 2016-11-29 16:31:12 +00:00
Treehugger Robot
16017b3fbb Merge "toolbox: exit when failed to allocate buffer for ioctl" 2016-11-23 01:40:04 +00:00
Treehugger Robot
1b2e6abf3b Merge "change /data/bugreports to /bugreports" 2016-11-23 00:06:30 +00:00
Ting-Yuan Huang
1c2f612c18 toolbox: exit when failed to allocate buffer for ioctl
This is a "shouldn't happen" case.

Test: make WITH_TIDY=1 mmma system/core/toolbox
Change-Id: I51e44e17837b03d6df6f8c4c3e1aeab8253e094d
2016-11-22 15:33:34 -08:00
Billy Lau
d36115ef2f init: Reworked how we wait for COLDBOOT_DONE
Bug: 31800756

Instead of strictly timing out after 1s waiting for COLDBOOT_DONE,
we wait for a considerably longer period of time, which would also
allow slower non-production heavily instrumented debug builds to
boot up.

Upon successful wait, we measure the time taken and record the
value into a system property: ro.cold_boot.duration.

If timeout is still reached, we log an error message and abandon
boot process, rebooting into recovery mode instead.

Change-Id: Ic1df80546d8721b0e8c998ff294d5c5102de4e98
2016-11-22 21:25:02 +00:00
Jin Qian
72662414f6 Merge "fs_mgr: change MF_MAX_COMP_STREAMS define to match internal master" 2016-11-22 18:42:39 +00:00
Nick Kralevich
c4084c6694 change /data/bugreports to /bugreports
It's 5 characters shorter, has no runtime costs, can be stored on a
read-only partition, and avoids problems like b/27262109 and b/27204904.
It allows makes some security hardening easier.

Bug: 27262109
Bug: 27204904
Bug: 32799236
Test: verified new symlink created and old one not present
Change-Id: Ief362e13569ad9c868a7f0f9c4dbd6a328c96c6b
2016-11-22 08:57:25 -08:00
Treehugger Robot
636c851f8d Merge "liblog: add private android_log_write_list_buffer()" 2016-11-22 15:53:32 +00:00
Treehugger Robot
418558f8af Merge "liblog: move android_log_event_context class to log/log_event_list.h" 2016-11-22 15:51:38 +00:00
Josh Gao
79ce3fe7db adb: be more permissive in test_push_error_reporting.
Be agnostic to whether /system is writable when testing push error
reporting.

Test: python test_device.py
Change-Id: I1d03564fa35442c20e2c96a7f5b56d39868efc52
2016-11-21 18:39:21 -08:00
Josh Gao
05a3abfef3 adb: make sure that file mode macros match linux.
We use <sys/stat.h> mode macros on the host to parse modes sent over
from the device, so they had better match. Add static_asserts to ensure
this.

(Also, fix the cases where they don't.)

Test: mma -j48, compiled the static_asserts on darwin manually
Change-Id: I883e4e6c7489ea64d3c02d26790ac8293366d989
2016-11-21 18:39:21 -08:00
Mark Salyzyn
1179eb8048 system/core: replace EVENT_TAG_MAP_FILE with NULL
NULL represents system default.  In the future, NULL could represent
static and dynamic tags, which can come from multiple files based on
implementation details in the liblog library.

Test: gTest logd-unit-tests & liblog-unit-tests
Bug: 31456426
Change-Id: I0e3d296de81ca299ae63d7b83781639ee67ec298
2016-11-21 11:13:02 -08:00
Mark Salyzyn
2ca4f49476 liblog: add private android_log_write_list_buffer()
Allows us to compose an event message for our own in-memory purposes.
Will be used to compose an event message in logd and directly write
it to just the pmsg buffer.  Provide an internal enhanced C++ wrapper
for event handling.

Test: gTest liblog-unit-tests --gtest_filter=liblog.android_log_write_list_buffer
Bug: 31456426
Change-Id: I98246898ba580f9e506baba8af2fd1b26a2a8aae
2016-11-21 09:46:39 -08:00
Mark Salyzyn
472245d962 liblog: move android_log_event_context class to log/log_event_list.h
rename class from android_log_event_context to android_log_event_list

Test: gTest logcat-unit-tests
Bug: 31992412
Bug: 31456426
Change-Id: Ib61cbca7d453837d64959c56b0e11f8c5edbfbdd
2016-11-21 09:46:34 -08:00
Treehugger Robot
b6552f376c Merge "Revert "Revert "init: create /dev/urandom, /dev/random in first stage.""" 2016-11-19 00:48:14 +00:00
Jin Qian
0067e03251 fs_mgr: change MF_MAX_COMP_STREAMS define to match internal master
Change-Id: I53a8c6158b4dd1bf5e14ef0a842b7f43ca8bae31
2016-11-18 16:38:40 -08:00
Treehugger Robot
a9ea1e4d99 Merge "Add support for max_comp_streams option for zram" 2016-11-18 23:09:44 +00:00
Evgenii Stepanov
102daa30a3 Revert "Revert "init: create /dev/urandom, /dev/random in first stage.""
This reverts commit 4c8a76e250.

Test: booted angler-userdebug

Change-Id: I2257a44b7cf624065e5653754062a117f3e44c98
2016-11-18 15:09:18 -08:00
Peter Enderborg
4d217f02d3 Add support for max_comp_streams option for zram
With this option the fstab can include a parameter for zram
the enables more streams for kernels that does not have
dynamic stream task handling.

Test: Made sure max_comp_streams is set according to fstab.
Change-Id: I22e158a075a8a86b4e80d3b13989896929c0d223
2016-11-18 21:19:25 +00:00
Mark Salyzyn
16300f192b Merge "logd: add EXIT command" 2016-11-18 16:06:08 +00:00
Treehugger Robot
453db013b0 Merge "adb: fix progress percentage when pulling symlinks." 2016-11-18 02:13:19 +00:00
Josh Gao
da1f279509 adb: fix progress percentage when pulling symlinks.
The adb protocol currently only supports lstat with no way of finding
the target of a symlink, so pulling a symlink that points to a file
looks like pulling a file with length equal to the length of path to
the symlink's target. Pulling a file that's sufficiently large can
overflow the int used to calculate percentage, and result in a bogus
completion percentage being displayed.

Bug: http://b/29277448
Test: adb pull /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
Change-Id: I42d180550ac2aa9e4705676ccbb20f5db789fb8d
2016-11-17 16:17:07 -08:00
Mark Salyzyn
c8749d5108 logd: add EXIT command
Debugging aid. Allows us to run:

$ cat -n '<STUFF>\0EXIT\0' | nc -U /dev/socket/logd

and the pipeline will exit once done. Without the EXIT command
we will have to <CTRL+C> out to terminate the pipeline. This is
necessary since Android's netcat command does not support the -q
feature, and having the EXIT command is faster and cleaner anyways.

Test: manual as noted above.
Bug: 31456426
Change-Id: I65333358188db85e2eb1bb6a14deed1565826ac4
2016-11-17 14:42:33 -08:00
Treehugger Robot
3bde05d928 Merge "Remove dead code." 2016-11-17 20:29:10 +00:00
Wei Wang
9bf10ff61e Merge "init: move empty string check to InitTriggers" 2016-11-17 19:21:47 +00:00
Elliott Hughes
284f07bd9d Remove dead code.
At this point, we can't write to oom_score_adj anyway.

Bug: https://code.google.com/p/android/issues/detail?id=227721
Test: boots, adb shell still works
Change-Id: I07e6ad32765f6582f316973547a3a3d552808287
2016-11-17 10:32:16 -08:00
Treehugger Robot
5fbd1cfd34 Merge "Add flags to restorecon_recursive to traverse filesystems" 2016-11-17 17:39:53 +00:00
Mark Salyzyn
ed0a48c617 Merge "libcutils: sdk(mac) build error (part deux)" 2016-11-17 16:36:21 +00:00
Mark Salyzyn
0958b18da0 libcutils: sdk(mac) build error (part deux)
Test: Build
Bug: 32450474
Change-Id: I92cca30217715779a9db6a60e2e4831a20cec3d4
2016-11-17 08:33:26 -08:00
Mark Salyzyn
231d1ac640 Merge "libcutils: sdk(mac) build error" 2016-11-17 16:09:33 +00:00
Mark Salyzyn
6b652160d1 libcutils: sdk(mac) build error
Surprise surprise, MAC sdk build has F_GETFD & not TEMP_FAILURE_RETRY.
Revert code to original form with the three alternatives for all OSii.

Test: Build
Bug: 32450474
Change-Id: Ia7361d8107675a620968d8395c5e2351ad364d29
2016-11-17 08:05:16 -08:00
Treehugger Robot
c097c79b77 Merge "logcat: add hidden --debug flag and cleanup" 2016-11-17 15:23:05 +00:00
Mark Salyzyn
8c41e791ed Merge "libcutils: move cutils/files.h to cutils/android_get_control_file.h" 2016-11-17 15:22:14 +00:00
Wei Wang
93df4e18a2 init: move empty string check to InitTriggers
Test: mma
Bug: 32838381
Change-Id: I69203734ef7d3640da75f3e3cbe9254bf468d916
2016-11-16 22:24:43 -08:00
Treehugger Robot
5368723cf3 Merge "Remove FuseBridgeLoop class." 2016-11-17 04:22:27 +00:00
Wei Wang
2369b1eb80 Merge changes from topic 'slow_log'
* changes:
  init: fix undefined behavior in ExecuteCommand
  Revert "Revert "init: warn slow action""
2016-11-17 03:46:44 +00:00
Treehugger Robot
d8d7fc6717 Merge "Stops the loop when all files are closed." 2016-11-17 02:49:05 +00:00
Daichi Hirono
691739b334 Remove FuseBridgeLoop class.
Bug: 32779923
Test: libappfuse_test
Change-Id: I29a76701d141ae061ec1fe32993d27460a0c694a
2016-11-17 09:49:51 +09:00
Daichi Hirono
30e6808895 Stops the loop when all files are closed.
The CL changes FuseBridgeLoop so that it exits when all files opened on
the AppFuse mount point are closed. Note that the client code will
unmount the FUSE mount point after the loop exits.

Bug: 32260320
Test: libappfuse_test
Change-Id: I4965fbb48de8a280c6306e70757a07376b1956a7
2016-11-17 09:10:53 +09:00
Mark Salyzyn
52bd37e633 libcutils: move cutils/files.h to cutils/android_get_control_file.h
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
2016-11-16 15:56:56 -08:00
Mark Salyzyn
538bc12c08 logcat: add hidden --debug flag and cleanup
Allow us to debug corrupted log messages. Fix liblog to propagate
errors correctly and repair a gtest that failed.

Test: liblog-unit-tests --gtest_filter=liblog.__android_log_bswrite_and_print___max
      logcat -b events --debug -t 50
Bug: 32903864
Change-Id: Ib4eb9f466777cd23b8b54728d36354590d07869a
2016-11-16 15:46:42 -08:00
Wei Wang
d67a4abc64 init: fix undefined behavior in ExecuteCommand
ExecuteCommand may change command_ vector which leads undefined behavior
This bug is found when adding logs in ExecuteCommand printing our Command class fields

Bug: 32838381
Test: on emulator
Change-Id: I96468bd2192ca80013871a3a6ac4132149363fff
2016-11-16 15:46:19 -08:00
Paul Lawrence
a8d8434c42 Add flags to restorecon_recursive to traverse filesystems
Use to solve the problem of tracefs conditionally being mounted
under debugfs and needing restorecon'd without boot performance
penalty.

Also move skip-ce to a flag for consistency.

Test: Check that trace_mount has correct attributes after boot
Bug: 32849675
Change-Id: Ib6731f502b6afc393ea5ada96fa95b339f14da49
2016-11-16 22:27:45 +00:00
Treehugger Robot
e631e470e0 Merge "adb: add sysdeps/chrono.h for chrono literals on Win32." 2016-11-16 22:21:41 +00:00
Treehugger Robot
cfd12251bd Merge "Only restorecon CE storage after unlocked." 2016-11-16 22:04:50 +00:00