Commit Graph

29773 Commits

Author SHA1 Message Date
Christopher Ferris a61c3db243 Merge "Small test fixes."
am: 9a4f572a95

Change-Id: I53c3ab731be17e603e455890e6ae5fb15d033c79
2017-05-06 06:34:21 +00:00
Christopher Ferris 9a4f572a95 Merge "Small test fixes." 2017-05-06 06:30:41 +00:00
Elliott Hughes 77ca73f8a7 Merge "Give slightly less useless versions to adb and fastboot."
am: ddfd5056a2

Change-Id: Ia41e72ae4c21b060b9a104a10f4628d24195d915
2017-05-06 05:29:47 +00:00
Elliott Hughes ddfd5056a2 Merge "Give slightly less useless versions to adb and fastboot." 2017-05-06 05:24:49 +00:00
Yi Kong 26f71e6a5a Merge "Remove unused lambda captures"
am: 5b8a92af5d

Change-Id: I3630eb3c17ac328c63a8675eb83893edcd196fb8
2017-05-06 01:18:31 +00:00
Treehugger Robot 5b8a92af5d Merge "Remove unused lambda captures" 2017-05-06 01:12:57 +00:00
Elliott Hughes dcbd2a1501 Merge "Fix macOS build."
am: 71feb7b321

Change-Id: I2d5929947753795593088f3e18f20dc6c071e1a0
2017-05-06 01:11:58 +00:00
Treehugger Robot 71feb7b321 Merge "Fix macOS build." 2017-05-06 01:07:46 +00:00
Christopher Ferris 47e02f429d Small test fixes.
Bug: 31919199

Test: Ran the unit tests.
Change-Id: I62bdb007f9cfa57e3faaa05993fd6e23ce32b82f
2017-05-05 17:09:49 -07:00
Elliott Hughes 2708a953d2 Give slightly less useless versions to adb and fastboot.
This will let us see (a) whether the user has a legit build or something they
built themselves and (b) what Android release it corresponds to.

This isn't as useful as showing what Platform Tools release we correspond to,
but I'm planning on doing that as a separate line.

Bug: N/A
Test: adb --version ; fastboot --version
Change-Id: Idca489295e3c6f8571146f95822c08808e36b382
2017-05-05 16:29:19 -07:00
Elliott Hughes 4acb36020b Fix macOS build.
system/core/adb/client/usb_libusb.cpp:162:20: error: unused function 'get_device_serial_path' [-Werror,-Wunused-function]
  static std::string get_device_serial_path(libusb_device* device) {
                     ^

Bug: N/A
Test: no choice but to submit and see...
Change-Id: I0026d3273891588c27df5ccd71c41ad9907b038d
2017-05-05 16:26:30 -07:00
Greg Hackmann 4f152a5f50 Merge changes If7b13672,I96135a8c
am: 484acce026

Change-Id: Ibca5e28523666185c2760dd3918fea674ac44a13
2017-05-05 21:47:53 +00:00
Treehugger Robot 484acce026 Merge changes If7b13672,I96135a8c
* changes:
  AshmemTest: expand ProtTest cases
  AshmemTest: test lseek() and read() on ashmem fds
2017-05-05 21:43:38 +00:00
Elliott Hughes 94202c2b9d Merge "Improve udev failure diagnostics."
am: 5ad9ba12df

Change-Id: I6ef9050b822c63ab79fd93bfb86ef96837727904
2017-05-05 21:37:14 +00:00
Elliott Hughes 5ad9ba12df Merge "Improve udev failure diagnostics." 2017-05-05 21:33:56 +00:00
Yi Kong ae797ec305 Remove unused lambda captures
Test: build
Bug: 37752547
Change-Id: Id318f412ad81b6e7de3ad644cba4405bb04f2729
2017-05-05 14:09:10 -07:00
Greg Hackmann 4a9531d326 AshmemTest: expand ProtTest cases
ashmem buffers start with PROT_EXEC | PROT_READ | PROT_WRITE and can
have bits individually removed (but not added) through the
ASHMEM_SET_PROT_MASK ioctl.  Test that removing prot bits more than once
works, and that the kernel blocks adding prot bits.

Also test that the complementary ASHMEM_GET_PROT_MASK ioctl returns the
expected prot mask.

Test:  /data/nativetest64/libcutils_test/libcutils_test64 \
       --gtest_filter=AshmemTest.* (on hikey)
Test:  /data/nativetest/libcutils_test/libcutils_test32 \
       --gtest_filter=AshmemTest.* (on hikey)

Change-Id: If7b13672547ec4cf6dfd1886197f40f12b2f1c85
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-05-05 20:04:12 +00:00
Greg Hackmann be11d570ec AshmemTest: test lseek() and read() on ashmem fds
ashmem has in-kernel handlers for lseek() and read(), but they aren't
currently being tested.

Add tests for various seeks on a buffer containing holes.  If we land
inside data, then check that we read() the expected data at that offset.

Test:  /data/nativetest64/libcutils_test/libcutils_test64 \
       --gtest_filter=AshmemTest.* (on hikey)
Test:  /data/nativetest/libcutils_test/libcutils_test32 \
       --gtest_filter=AshmemTest.* (on hikey)

Bug: 37254818
Change-Id: I96135a8cea2ce99932e3bc97b5254c95ef6b264a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-05-05 19:58:09 +00:00
Elliott Hughes cd35664cdc Improve udev failure diagnostics.
A couple of folks had trouble understanding the existing message.

Before:

  8XV7N15917000596	no permissions (udev requires plugdev group membership); see [http://developer.android.com/tools/device.html]

After:

  8XV7N15917000596	no permissions (user buttmunch is not in the plugdev group); see [http://developer.android.com/tools/device.html]

This also fixes a libusb regression where we wouldn't show anything for
devices where we don't have permissions.

Bug: http://b/37707122
Test: ran "adb devices" as user buttmunch
Change-Id: I2fcd735ff4178145432b532a6e4dc8c93b2743fd
2017-05-05 12:50:16 -07:00
Christopher Ferris 497029004a Merge "Use async safe logging in signal handlers."
am: fd8fab19df

Change-Id: I66b41a0d3035439f85acc52e98348de0bba56576
2017-05-05 17:56:59 +00:00
Christopher Ferris fd8fab19df Merge "Use async safe logging in signal handlers." 2017-05-05 17:49:04 +00:00
Thierry Strudel 140d1f51a1 Merge "fs_mgr_avb: allow verification error when the device is unlocked"
am: 7245ab6a11

Change-Id: Ibdc7cd211aa89ba36735dec25cf8cd3d11fa4da0
2017-05-05 16:45:52 +00:00
Thierry Strudel 7245ab6a11 Merge "fs_mgr_avb: allow verification error when the device is unlocked" 2017-05-05 16:37:26 +00:00
Bowgo Tsai 1140954877 fs_mgr_avb: allow verification error when the device is unlocked
Current AVB flow in fs_mgr doesn't allow verification error even if the
device is unlocked. This makes first stage mount fail when the device
is flashed with a different-sized boot.img because there is verification
error (HASH_MISMATCH) for the boot partition.

Fix this by allowing verification error only when the device is
unlocked. Whether to enable dm-verity for HASHTREE partitions is still
controlled by the HASHTREE_DISABLED flag in the top-level vbmeta.

Bug: 37985430
Test: First stage mount /vendor with AVB on a device.
      Check dm-verity is enabled on /vendor.
Test: Unlock device, flash a different-sized boot.img. Boot device and check
      dm-verity is still enabled on /vendor.
Test: First stage mount /vendor with AVB on a device with HASHTREE_DISABLED
      is set on the top-level vbmeta, check dm-verity is not enable on /vendor.

Change-Id: I709431bc1c37e4f86133d171cee8e90621cdb857
2017-05-05 22:36:40 +08:00
Steven Moreland 1561e34bf4 Merge "trusty/storage/* to Android.bp"
am: 1dcd257a21

Change-Id: Ia4397b245c0f34e67f3c3d46193af6bf3331c29c
2017-05-05 03:44:02 +00:00
Keun-young Park 2f3718c472 Merge "use passed blk dev name for quota / super block check"
am: 7b706c5b9e

Change-Id: I24a1f92821c0bd204eb25f0aaa4e46a962565291
2017-05-05 03:40:32 +00:00
Treehugger Robot 1dcd257a21 Merge "trusty/storage/* to Android.bp" 2017-05-05 03:36:06 +00:00
Treehugger Robot 7b706c5b9e Merge "use passed blk dev name for quota / super block check" 2017-05-05 03:33:16 +00:00
Keun-young Park 9519688411 use passed blk dev name for quota / super block check
- It was using blk dev name from fstab and quota / super block check was always
  failing for FDE

bug: 37913441
Test: reboot and confirm quota
Change-Id: I8a9e890ef2787f2959e6a0225c6b21d35602f19e
2017-05-04 18:31:06 -07:00
Christopher Ferris f30a810bce Use async safe logging in signal handlers.
Test: Boot on bullhead.
Test: Ran the libbacktrace tests on bullhead.
Test: Added a temporary log message in the signal handler, and ran the
Test: backtrace tests.
Change-Id: I0a6888c9f311af2c8cc7fbb4929315911bd2bb3c
2017-05-04 17:15:17 -07:00
Elliott Hughes e03caa00ef Merge "Clean up the partition name mapping in fastboot."
am: bdbcdf3a16

Change-Id: I424b6bd4141df78471fc2b51a02df96ece70059e
2017-05-05 00:08:48 +00:00
Elliott Hughes bdbcdf3a16 Merge "Clean up the partition name mapping in fastboot." 2017-05-05 00:04:45 +00:00
Josh Gao 2ca23fa508 Merge changes from topic 'adb_thread_safety'
am: 9083ff1c24

Change-Id: I55e4d18648d3ceb915840ee5d25b2e8146a0bef6
2017-05-04 23:52:50 +00:00
Josh Gao 9083ff1c24 Merge changes from topic 'adb_thread_safety'
* changes:
  adb: wait for devices to come up instead of sleeping for 3s.
  adb: initialize mDNS asynchronously.
  adb: add fdevent_run_on_main_thread.
2017-05-04 23:47:32 +00:00
Elliott Hughes 5f865e5943 Merge "This code has moved to toybox proper."
am: c5dbd7134d

Change-Id: I653790cc381755645decbdfb2c57be0e61628b6e
2017-05-04 23:27:55 +00:00
Treehugger Robot c5dbd7134d Merge "This code has moved to toybox proper." 2017-05-04 23:21:36 +00:00
Josh Gao b80ef5e6fd Merge "adb: make darwin build with thread safety analysis."
am: 971e6585a6

Change-Id: I504a569348bcdbb3933cf8b5b1a793868feed035
2017-05-04 23:13:15 +00:00
Josh Gao 971e6585a6 Merge "adb: make darwin build with thread safety analysis." 2017-05-04 23:05:38 +00:00
Josh Gao fd713e53e8 adb: wait for devices to come up instead of sleeping for 3s.
Replace a hard-coded 3 second sleep with logic to wait until we've
scanned USB devices once and they've all come online.

Before:
    adb shell true  0.00s user 0.00s system 0% cpu 3.047 total

After:
    adb shell true  0.00s user 0.00s system 9% cpu 0.041 total

Bug: http://b/37869663
Test: `time adb shell true` after adb kill-server
Change-Id: I251d42afb885908ed9d03167287594ea16650d3f
2017-05-04 16:03:12 -07:00
Josh Gao 04a8218f09 adb: make darwin build with thread safety analysis.
Test: mma on darwin
Change-Id: I44dfc53fc381e60de83f3bc503691cdb8179ca91
2017-05-04 16:03:12 -07:00
Josh Gao 6f46e6b912 adb: initialize mDNS asynchronously.
Use fdevent_run_on_main_thread to initialize mDNS in a thread and
register an fdevent from the main thread upon success.

This reduces the startup time of `adb server` by ~3 seconds when mDNS
can't be successfully started. With an already running adb server,
`time adb server nodaemon` goes from:

    adb server nodaemon  0.00s user 0.16s system 4% cpu 3.817 total

to:

    adb server nodaemon  0.00s user 0.01s system 1% cpu 0.665 total

Bug: http://b/37869663
Test: `adb server nodaemon` with an existing adb server
Change-Id: Ia5a1a2a138610f3bf6792400050ca68f95ae3734
2017-05-04 16:03:12 -07:00
Josh Gao 4c936397c1 adb: add fdevent_run_on_main_thread.
Add a function to run a function on the main thread, to allow fdevents
that depend on a blocking function to be registered.

Bug: http://b/37869663
Test: adb_test on linux
Change-Id: I84a0b372360420b7647057297b8f437e8afa874e
2017-05-04 16:03:12 -07:00
Mark Salyzyn bfead93a3a Merge "libcutils: fs_config internal table alias test"
am: 8fad110bfa

Change-Id: I53835ad38965fd315b6463605d4cee5d580da154
2017-05-04 21:12:53 +00:00
Christopher Ferris b34a9d11ec Merge "Move all logging to use the async safe logging."
am: d673da4bfb

Change-Id: I78783a8204b92404405c7bde6f4a0e7e92c72644
2017-05-04 21:12:34 +00:00
Treehugger Robot 8fad110bfa Merge "libcutils: fs_config internal table alias test" 2017-05-04 21:06:12 +00:00
Christopher Ferris d673da4bfb Merge "Move all logging to use the async safe logging." 2017-05-04 21:00:07 +00:00
William Roberts b46b61049b Merge "init: cleanup exec_service documentation"
am: 61559e491e

Change-Id: I0fa614975f5fbdf7f58be724e4cea4258eda79c3
2017-05-04 20:06:02 +00:00
Treehugger Robot 61559e491e Merge "init: cleanup exec_service documentation" 2017-05-04 19:54:17 +00:00
Mark Salyzyn 0f6a270d24 libcutils: fs_config internal table alias test
Private interface to permit testing only added to fs_config to
expose android_files and android_dirs.

Make sure that both paths to a partition are specified in fs_config
internal tables.

Test: gTest libcutils-unit-test --gtest_filter=fs_config.*
Bug: 37703469
Change-Id: Ida5fccdb786dc6d67325005d4fdd1fa1ffaef396
2017-05-04 11:41:17 -07:00
William Roberts 323d5791b4 init: cleanup exec_service documentation
The exec_service documentation was difficult to read, clarify it.

Tests:
Run grip.py to verify that the markdown still works correctly.
Run aspell to verify spelling.

Change-Id: I29bdd456f3d3ea2a91c9d4772bd09a5a195f97a9
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-05-04 11:14:23 -07:00