Commit graph

30023 commits

Author SHA1 Message Date
Christopher Ferris
9416703f5b Remove assert, use CHECK instead.
- Use the CHECK macro everywhere that assert was used.
- Remove the _debug version of the tests and leave the CHECK macro so
  it's always checking in the code.

Bug: 23762183

Test: Ran unit tests.
Change-Id: Ie705eedae393d0e95bb9d99f852687a11881aef1
2017-06-29 10:29:43 -07:00
Steven Moreland
fca20d8aa1 logd + liblogd to Android.bp
Test: boot, adb logcat produces output
Change-Id: I89e7f9a19e139d3f5a71040b1555d01913946b85
2017-06-29 09:29:36 -07:00
Elliott Hughes
5dc7736f60 Remove more documentation for obsolete board configuration.
Bug: N/A
Test: builds
Change-Id: I0a4ea974a81aadba1a554072ceff9f243a70be0d
2017-06-29 08:52:49 -07:00
Christopher Ferris
51b4f48280 Merge "Fix mac build." 2017-06-29 07:02:08 +00:00
Treehugger Robot
6afbd476ab Merge "Allow SLOG* to vendors" 2017-06-29 03:53:38 +00:00
Christopher Ferris
bfd6292db6 Fix mac build.
Test: Built.
Change-Id: I455381d29045dc6dddfb2b77dcde312722c06ebf
2017-06-28 20:44:48 -07:00
Jiyong Park
9ffeab85bf Allow SLOG* to vendors
Not only vendor libs, but also Android libs that are marked as
vendor_available are using SLOG*. Since both pure vendor libs and
Android libs available to vendors are using the same liblog headers for
VNDK, SLOG* needs to be visible via the headers.

Bug: 63088165
Test: BOARD_VNDK_VERSION=current m -j ATFWD-daemon
(or any other vendor modules using SLOG*)

Change-Id: Idfb74887a42d2418d3896bfdf5be3b4fc8e4c27f
2017-06-29 10:25:25 +09:00
Christopher Ferris
9302daeb1d Merge "Add .gnu_debugdata support." 2017-06-29 01:15:21 +00:00
Christopher Ferris
bae69f1892 Add .gnu_debugdata support.
Update the unwind_info tool to dump all of the sections.

Bug: 23762183

Test: Passes new unit tests.
Change-Id: I8b223bc208a1a2ef06ed333e6d96943c8f273681
2017-06-28 15:23:10 -07:00
Mark Salyzyn
69a5bd4357 fs_mgr: report errno string for __mount errors
Need to know why the mount failed.  clang_format adjustment.

Basically change LINFO to PINFO to cause the log message for the mount
report to be accompanied by a strerror(errno) message appended to the
end so that it is clear why the mount was rejected.

Test: manual
Bug: 63100799
Change-Id: Ic958299759befe5d5b11bdc95fea5d64cad86412
2017-06-28 21:52:34 +00:00
Treehugger Robot
9ed76f0acc Merge "Add (partial) support for Windows long paths" 2017-06-28 19:15:38 +00:00
Renaud Paquay
e3e7813e5f Add (partial) support for Windows long paths
* Update android::base::utf8::open/unlink to support Windows long
  paths

* Add android::base::utf8::fopen, also with support for Windows long
  paths

* Upcoming CLs will add additional APIs to support additional use cases

Test: Added tests to utf8_test
Bug: 38268753
Change-Id: If72af327f3487766f5370a2f43ee9cabd4a8a810
2017-06-28 17:12:37 +00:00
Treehugger Robot
3f4cea940d Merge "Remove documentation for obsolete board configuration." 2017-06-28 16:36:52 +00:00
Elliott Hughes
76a934a459 Remove documentation for obsolete board configuration.
Bug: N/A
Test: builds
Change-Id: I5afbf2da35a7defb12b98bb5387ab7d3eee6f15a
2017-06-28 07:50:00 -07:00
Treehugger Robot
20d9cf2ee7 Merge "fs_mgr: add libfstab for vendor" 2017-06-28 04:57:48 +00:00
Jiyong Park
e7df1f7623 fs_mgr: add libfstab for vendor
libfstab is a subset of libfs_mgr, intended for vendors to use. It
exposes APIs for reading fstab. Note this 'visible to vendor' does not
mean that the API should be stable forever. The API can be changed in
later releases of Android, ,but the newer Android must not cause
run-time error when there is an older version of this static library
being used somewhere.

Bug: 62990533
Test: BOARD_VNDK_VERSION=current m -j libfstab.vendor
Change-Id: I371174fa1f6b4de6d6dd437b84ce4ed1e8740672
Merged-In: If8fc73e4ae4c2f8281c41a12f1c18079aab8baa2
2017-06-28 11:24:25 +09:00
Guang Zhu
b5b4136ac4 Merge "Revert "init: Terminate gracefully when CAP_SYS_BOOT is absent"" 2017-06-28 02:15:43 +00:00
Guang Zhu
c22f93856f Revert "init: Terminate gracefully when CAP_SYS_BOOT is absent"
Bug: 63080844

This reverts commit 683ebc8059.

Change-Id: I6074ff09300fd30bfc66881ded1c4f868a845a91
2017-06-28 02:10:33 +00:00
Treehugger Robot
7f81b2af61 Merge changes I5c6bf2a5,I20a337bb
* changes:
  debuggerd: diagnostics for dumps that are guaranteed to fail.
  libprocinfo: add support for parsing process state.
2017-06-27 23:54:36 +00:00
Treehugger Robot
fbb482f499 Merge "init: Terminate gracefully when CAP_SYS_BOOT is absent" 2017-06-27 22:55:48 +00:00
Treehugger Robot
046160959c Merge "Indicate that a packet was truncated." 2017-06-27 22:50:48 +00:00
Josh Gao
0915f23d5f debuggerd: diagnostics for dumps that are guaranteed to fail.
Print diagnostics when the user requests a dump that is guaranteed to
fail, such as trying to dump a process you can't send a signal to.

Bug: http://b/63008395
Change-Id: I5c6bf2a5751f858e0534990b8d2ab6932eb9f11d
Test: manually tested
2017-06-27 15:06:57 -07:00
Josh Gao
9cb2e2eb8c libprocinfo: add support for parsing process state.
Bug: http://b/63008395
Test: libprocinfo_test32
Change-Id: I20a337bb5075bcdb325d2b48e174b0b5ef896261
2017-06-27 15:06:27 -07:00
Treehugger Robot
a4f086ab20 Merge changes Ibe1feb39,I05be83e4,If1422e4d
* changes:
  init.rc: setup console-ramoops-0
  healthd: check console-ramoops-0
  fs_mgr: check console-ramoops-0
2017-06-27 21:46:30 +00:00
Elliott Hughes
3e8d923276 Merge "Allow configuration of the number of tombstones." 2017-06-27 20:57:08 +00:00
Luis Hector Chavez
683ebc8059 init: Terminate gracefully when CAP_SYS_BOOT is absent
This change makes it possible for Android running in a container to
terminate cleanly instead of calling abort() when requested to shut
down.

Bug: 62388055
Test: setprop sys.powerctl reboot makes init terminate nicely

Change-Id: I31c7b475d89d7cbd665e135d9b8951dfd4bca80d
2017-06-27 13:51:46 -07:00
Dan Albert
9893f93950 Indicate that a packet was truncated.
Test: make checkbuild, check adb log
Bug: None
Change-Id: I0006ed284697f01966fdd79ca0b05dbc6d2eecf0
2017-06-27 13:26:14 -07:00
Mark Salyzyn
4eb0ba058c init.rc: setup console-ramoops-0
On later kernels /sys/fs/pstore/console-ramoops becomes
/sys/fs/pstore/console-ramoops-0

Test: none
Bug: 63058217
Change-Id: Ibe1feb39ef9081b1ab2316510674bf181bdc7b0c
2017-06-27 09:32:38 -07:00
Mark Salyzyn
26f1dd764c healthd: check console-ramoops-0
On later kernels /sys/fs/pstore/console-ramoops becomes
/sys/fs/pstore/console-ramoops-0

Test: none
Bug: 63058217
Change-Id: I05be83e40dfc1730ed62b74a146123cdb8573ca6
2017-06-27 09:28:57 -07:00
Mark Salyzyn
cab56c0ba5 fs_mgr: check console-ramoops-0
On later kernels /sys/fs/pstore/console-ramoops becomes
/sys/fs/pstore/console-ramoops-0

Test: none
Bug: 63058217
Change-Id: If1422e4df09b68c44f16608b1d191aeb6378c66b
2017-06-27 09:10:16 -07:00
Treehugger Robot
449bfd7a93 Merge "libcutils: fs_config: fix "system/<partition>/" aliasing" 2017-06-26 22:43:37 +00:00
Treehugger Robot
b22067677e Merge "Revert "adb: turn on libusb by default."" 2017-06-26 21:33:34 +00:00
Ben Fennema
acd7b7b0c0 libcutils: fs_config: fix "system/<partition>/" aliasing
Pull prefix checking into fs_config_cmp and make prefix_cmp be a
glorified partial ? strncmp() : strcmp()

Results before:
[ RUN      ] fs_config.system_alias

[ ERROR ] system/core/libcutils/tests/fs_config.cpp:143:: vendor/lib/hw didn't match system/vendor/lib

[ ERROR ] system/core/libcutils/tests/fs_config.cpp:143:: system/vendor/bin/wifi didn't match vendor/bin/wifi

[ ERROR ] system/core/libcutils/tests/fs_config.cpp:143:: system/odm/bin/wifi didn't match odm/bin/wifi

[ ERROR ] system/core/libcutils/tests/fs_config.cpp:143:: system/oem/bin/wifi didn't match oem/bin/wifi
system/core/libcutils/tests/fs_config.cpp:247: Failure
Value of: check_fs_config_cmp(fs_config_cmp_tests)
  Actual: true
Expected: false
[  FAILED  ] fs_config.system_alias (6 ms)

Results after:
[ RUN      ] fs_config.system_alias
[       OK ] fs_config.system_alias (0 ms)

Bug: 62204623
Test: gTest libcutils-unit-test --gtest_filter=fs_config.*
Change-Id: I8282827002816e86ea3014fed29eabf43b837815
Signed-off-by: Ben Fennema <fennema@google.com>
2017-06-26 14:13:52 -07:00
Elliott Hughes
35bb6d2a89 Allow configuration of the number of tombstones.
Bug: http://b/62810514
Test: altered the property, got more tombstones
Change-Id: Iba8089915fa715658d2dfecb076c6a61321243bd
2017-06-26 14:00:00 -07:00
Tom Cherry
b4dd881ffd ueventd: remove character device symlinks (/dev/usb/*)
While refactoring ueventd, I was looking for code the character device
symlinks (/dev/usb/*) that ueventd creates, such that I could test it
on a real device.  I found none in our tree, and history showing Xoom,
which was last supported years ago, was the last user.  If this code
is in fact obsolete, let's remove it.

Test: boot bullhead
Test: init unit tests

Change-Id: I601f7165eb06d36b31b6dcf69ee9e0a449d81a96
2017-06-26 13:58:57 -07:00
Josh Gao
969110ca4a Revert "adb: turn on libusb by default."
This reverts commit f2f0b31850.

libusb seems to be causing flakiness on some machines. Disable it for
now.

Bug: http://b/62962248
Test: python test_device.py (with DeviceOfflineTest commented out)
Change-Id: Ia9de78ab772c22574cf5ca7facb78f22af6d7a71
2017-06-26 13:17:58 -07:00
Treehugger Robot
c70bf5836c Merge "AVB: allow no metadata in the generic system.img for project Treble" 2017-06-24 01:28:25 +00:00
Bowgo Tsai
60f19a0792 AVB: allow no metadata in the generic system.img for project Treble
The generic system.img released from project Treble can't contain any verity
metadata (e.g., vboot 1.0, AVB, or any other implementation) because it's
*generic*. To make any device can boot with it, `avbctl disable-verification`
is introduced to set a new flag AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED
in the top-level vbmeta to disable the entire AVB verification process. This
should be done prior to flash the generic system.img. See the following link
for details:

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

This CL checks whether AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED is
set in the top-level vbmeta. When set, skip verifying the vbmeta structs
against androidboot.vbmeta.{hash_alg, size, digest} because it will be
absent in kernel cmdline. Also, only top-level vbmeta struct is read then
returned by libavb in this case.

Note that another flag AVB_VBMETA_IMAGE_FLAGS_HASHTREE_DISABLED, usually
set by `adb disable-verity`, is used to signal fs_mgr to skip setting up
dm-verity, but libavb still verifies all vbmeta structs. fs_mgr will
also verify all vbmeta structs against androidboot.vbmeta.{hash_alg,
size, digest} from kernel cmdline as well.

Also rename SetUpAvb() to SetUpAvbHashtree() to better fit its usage.
This function will return kDisabled when any of the above two flags is set.

Finally, regardless of which flag is set or not set, we still only allow two
return values from avb_slot_verify():

   - AVB_SLOT_VERIFY_RESULT_OK: it's still possible to get this value
     when any of these flags are set in build time. e.g.,
     BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS=--flags 2

   - AVB_SLOT_VERIFY_RESULT_ERROR_VERIFICATION: in most cases we should
     get this value, because the flags are likely set at run time.

Bug: 62523303
Test: boot device with 'avbctl disable-verification'.
Test: boot device with 'avbctl enable-verification'.
Test: boot device with 'adb disable-verity'.
Test: boot device with 'adb enable-verity'.

Test: build image with BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS=--flags 2, then boot device.
      repeat the above steps to boot device again.

Change-Id: Ie8436f3e0e82c78490208f3b85eac5238a9fdfdb
2017-06-24 09:20:15 +08:00
Tom Cherry
040212706b Merge "init: create android::init:: namespace" 2017-06-23 23:07:23 +00:00
Treehugger Robot
45b4fe454a Merge "libsysutils: Fix vold vulnerability in FrameworkListener" 2017-06-23 20:31:49 +00:00
Tom Cherry
81f5d3ebef init: create android::init:: namespace
With some small fixups along the way

Test: Boot bullhead
Test: init unit tests
Change-Id: I7beaa473cfa9397f845f810557d1631b4a462d6a
2017-06-23 13:21:20 -07:00
Christopher Ferris
62a17c6c4a Merge "Add section parsing and function name handling." 2017-06-23 20:18:35 +00:00
Tom Cherry
84c2eebbdd Merge "init: cleanup some string usage" 2017-06-23 19:40:24 +00:00
Christopher Ferris
8098b1c378 Add section parsing and function name handling.
Add the code to parse the Elf section headers.

Add the plumbing through of all the symbol handling code.

Add tests for all of this new functionality.

Bug: 23762183

Test: Pass new unit tests.
Change-Id: Ie2d90cbb3d7653c53251dbcf34d9e5d241278377
2017-06-23 10:51:28 -07:00
Narayan Kamath
111f351762 Merge "tombstoned: Improve message on java trace completion." 2017-06-23 08:12:51 +00:00
Treehugger Robot
b2bf7a5330 Merge "Debuggerd: Extend crash_dump timeout to 5 seconds" 2017-06-23 05:31:14 +00:00
Treehugger Robot
0c65c5c856 Merge "Debuggerd: Fix debuggerd_test" 2017-06-23 05:14:38 +00:00
Andreas Gampe
b02851a984 Debuggerd: Extend crash_dump timeout to 5 seconds
Some processes have lots of threads and minidebug-info. Unwinding
these can take more than the original two seconds.

Bug: 62828735
Test: m
Test: debuggerd_test
Test: adb shell kill -s 6 `pid system_server`
Change-Id: I0041bd01753135ef9d86783a3c6a5cbca1c5bbad
2017-06-22 20:19:11 -07:00
Andreas Gampe
26cbafb892 Debuggerd: Fix debuggerd_test
Follow-up to commit 695713e931f0436aca56be9c0dacf2a5dd4e56e7 in
bionic. Change expectations of the abort callstack.

Test: mmma system/core/debuggerd
Test: adb shell /data/nativetest/debuggerd_test/debuggerd_test32
Test: adb shell /data/nativetest64/debuggerd_test/debuggerd_test64
Change-Id: I350a29ee1713a7ebdd50f2b9bdc2078c671e22c7
2017-06-22 20:19:11 -07:00
Jaesung Chung
1dcee84294 Merge "crash_dump: lower THREAD_COUNT in debuggerd_client.race for low-speed devices" 2017-06-23 01:59:28 +00:00