Commit graph

47771 commits

Author SHA1 Message Date
Bo Hu
f17902b392 Merge "fs_mgr: Don't report 'Skip mounting partitions'" 2019-06-07 13:07:54 +00:00
Treehugger Robot
bb1b83e325 Merge "Add expected<void,E>" 2019-06-07 07:17:47 +00:00
Haibo Huang
a850fb2d1e Merge "Fix format string for new google benchmark" 2019-06-07 04:31:15 +00:00
Haibo Huang
9d47360c7e Fix format string for new google benchmark
Exempt-From-Owner-Approval: Fix build..
Test: build
Change-Id: I5b7dc76a6e8a9ee42cb9200b95db3ef5f335692a
2019-06-07 04:31:00 +00:00
Treehugger Robot
b78de85272 Merge "Update TODOs for ICU library links." 2019-06-07 02:12:04 +00:00
Treehugger Robot
2ba59c5b81 Merge "Move result.h from init to libbase" 2019-06-06 23:27:29 +00:00
Jiyong Park
b2a85c4333 Add expected<void,E>
Result<void> could be used instead of Result<Success>.

Bug: 132145659
Test: libbase_test
Change-Id: I7f079a94d06c5ecb8b0303ced981f0995253dc40
2019-06-07 08:10:32 +09:00
Martin Stjernholm
0d28abc5b1 Update TODOs for ICU library links.
Test: Presubmit boot test
Bug: 120786417
Bug: 134659294
Change-Id: I362e0e67c5adfd510dda12bed52629af92bfcc3d
2019-06-06 14:11:04 +01:00
Jiyong Park
8fd64c8af1 Move result.h from init to libbase
The Result, Error, ErrnoError are quite generic. Moving them from init
to libbase so that they can be used from other places.

Bug: 132145659
Test: libbase_test
Change-Id: Id774a587f74380fadd7a0fc88c0aa892c3d9a489
2019-06-06 08:58:55 +09:00
Treehugger Robot
44cabca1ef Merge "base: fix out of date documentation with PropertySet()" 2019-06-05 21:24:23 +00:00
Tao Bao
8eea2cae86 Merge "adb: Allow adb rescue getprop." 2019-06-05 20:43:55 +00:00
Mark Salyzyn
291b5caa46 Merge "fs_mgr: overlayfs: test: spelling mistake" 2019-06-05 20:29:53 +00:00
bohu
42b28b09b0 fs_mgr: Don't report 'Skip mounting partitions'
when the skip mount partition is not in the fstab

BUG: 133854834
Change-Id: I51de91f34525560c008fbe8648fa2cd6f56dcf8e
2019-06-05 18:24:50 +00:00
Mark Salyzyn
bc79fea7a1 fs_mgr: overlayfs: test: spelling mistake
Test: adb-remount-test.sh
Bug: 132070014
Change-Id: I7bc68c15f53f94d1c14e2da91157ade362bc72f8
2019-06-05 11:12:05 -07:00
Tom Cherry
ef2469e547 base: fix out of date documentation with PropertySet()
As of Android-P, __system_property_set() is synchronous and only will
return '0' if the property was successfully set.

Test: n/a
Change-Id: Icbc0a6d8be1ae683565f378c534ea8e5c5f25357
2019-06-05 10:31:33 -07:00
Christopher Ferris
659f61e0f2 Merge "Display offsets for dex frames." 2019-06-04 22:28:56 +00:00
Tao Bao
599eee1f37 adb: Allow adb rescue getprop.
Which will dump all the allowed properties, similar to `adb shell
getprop`.

Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Id668224098006d71ee192c8c2bea5d791d2423c1
2019-06-04 14:59:58 -07:00
Josh Gao
2683d0a2ca Merge changes I2d005e17,If2eec162,Icfd642e6
* changes:
  adb: daemon: Assign valid fd to usb_handle ep0 file descriptor
  adbd: respond to device-to-host control transfers.
  adbd: read, print, and ignore USB control transfers.
2019-06-04 19:22:08 +00:00
Josh Gao
a891ffddd3 Merge "adbd: provide MS OS descriptors for WinUSB." 2019-06-04 19:22:00 +00:00
Christopher Ferris
a4bdb984f9 Display offsets for dex frames.
When adding a dex frame, no offset is ever printed even if the dex data
is coming from a non-zero offset map. Fixed so an offset is printed
in this case.

Previous the line looked like this:

  #17 pc 0000000000500d7a  /product/app/GoogleCamera/GoogleCamera.apk (com.google.android.libraries.camera.async.AndroidPriorityThread.run+10)

Now looks like:

  #17 pc 0000000000500d7a  /product/app/GoogleCamera/GoogleCamera.apk (offset 0x11d0000) (com.google.android.libraries.camera.async.AndroidPriorityThread.run+10)

Add new unit test for this case.

Bug: 134420076

Test: Wrote new unit test, and verified a non-zero offset for dex file
Test: data results in a frame with a non-zero offset.
Change-Id: I58c134fda4fad5456ca0f1723192667a1ca5d509
2019-06-04 12:07:05 -07:00
Treehugger Robot
41f690ba2a Merge "Fix leak of mapped zip central directories" 2019-06-04 12:36:52 +00:00
Treehugger Robot
f74ff74475 Merge "fastboot: windows: Minor printf format fixes" 2019-06-04 00:20:24 +00:00
Treehugger Robot
d877a96656 Merge "Allow adb to handle single paramter with install-multi-package flag" 2019-06-03 22:49:48 +00:00
Mark Salyzyn
b5db741383 Merge "fs_mgr: overlayfs: test: triage data missing after failure flash scratch" 2019-06-03 21:22:28 +00:00
Greg Kaiser
8acf8c2da7 fastboot: windows: Minor printf format fixes
We recently changed 'xfer' to a size_t, so update the DBG format
accordingly.  We also fix a long standing issue with format for
the unsigned 'read'.

Test: TreeHugger
Change-Id: I3dc5f26a033fea64119016802bc9cdb54bbb7b52
2019-06-03 14:12:42 -07:00
Mark Salyzyn
4d702e8dea fs_mgr: overlayfs: test: triage data missing after failure flash scratch
After flashing empty image to scratch device, the device did not
return after 3 minutes.  It also did not collect any triage data
reporting only:

[  FAILED  ] did not reboot after flash

Add triage data, increase timeout to 4 minutes.

Test: adb-remount-test.sh
Bug: 132070014
Change-Id: Ic607abb5b2575d630bf6c27817a38a90820d24e1
2019-06-03 12:53:07 -07:00
Treehugger Robot
0c615194f4 Merge "fs_mgr: overlayfs: pre-emptive filesystem setup" 2019-06-03 14:18:45 +00:00
Treehugger Robot
90ca86ba22 Merge "Close /dev/fuse FD before calling onClosed" 2019-06-03 11:26:25 +00:00
Mark Salyzyn
e0c581fec3 fs_mgr: overlayfs: pre-emptive filesystem setup
If we just disabled verity, take the step to setup the backing
storage for overlayfs.

Test: adb-remount-test.sh
Bug: 130131892
Change-Id: Ic56569eaf363e4417a0ce5df11ee5480a07b8b03
2019-05-31 11:23:01 -07:00
Anton Hansson
03e31332a3 Close /dev/fuse FD before calling onClosed
This works around a deadlock when a bridge that is about to be closed
is reused for a new call to openFile. The call to open() ends up holding
the vold lock, waiting for appfuse to respond. The appfuse event loop
calls onClosed(), which ends up calling vold.unmountAppFuse(), which
cannot get the lock.

Closing this file descriptor causes any current calls to open() on its
mount path to fail with either ECONNABORTED or ENOTCONN, allowing the
event loop to make progress, call onClosed() and unmount the path.

Note that the failed call to open() will result in a retry, which
will create a new appfuse bridge. This is not ideal but not a new
problem -- the common case here is that that each call to
openProxyFileDescriptor creates a new bridge. This should ideally
be improved.

Bug: 132344997
Test: flick through info of photos with location info attached
Change-Id: I878e5cf86f18c5233f8505f52eb9db076bd72d01
Merged-In: I878e5cf86f18c5233f8505f52eb9db076bd72d01
2019-05-31 17:06:52 +01:00
Treehugger Robot
fac0bb7a92 Merge "fastboot: windows: fix Read function" 2019-05-31 15:45:21 +00:00
Fernando Lugo
b7eac2d084 fastboot: windows: fix Read function
Read function exits before reading all requested bytes. Fix that by
looping until the len requested is completed.

This will fix the issue execting get_staged command for a staged image
bigger than 1MB

Test: fastboot get_staged file.txt
Change-Id: Ic70ab48f3a8c8d78c225db638892501d4dc20b13
Signed-off-by: Fernando Lugo <flugo@google.com>
2019-05-30 17:47:49 -07:00
Treehugger Robot
3cb66ad34f Merge "init: Refactor service.h/cpp" 2019-05-31 00:32:34 +00:00
Vic Yang
e01ca4da2d init: Refactor service.h/cpp
Factors out utility functions into service_utils.h/cpp, so that they
can be reused by the upcoming native zygote.

Bug: 133443795
Test: Build and boot cuttlefish.
Change-Id: I0531b6f17561119c8cc33dd9ba375b351747fcfe
2019-05-30 14:24:03 -07:00
Tom Cherry
c76078e4b6 Merge "init: Refactor selinux.h/cpp" 2019-05-30 15:30:49 +00:00
Mark Salyzyn
370aac75ea Merge changes I55d0e1a8,I4d9a8776
* changes:
  adb-remount-test: do not brick devices that support overlayfs but do not use it
  adb-remount-test: provide additional mount details
2019-05-30 00:19:55 +00:00
Treehugger Robot
842cac88e4 Merge "fs_mgr: remount reboot if overlayfs got setup" 2019-05-30 00:07:48 +00:00
Mark Salyzyn
d9b60303a0 fs_mgr: remount reboot if overlayfs got setup
Cosmetic fix.

If overlayfs gets setup by the remount command, ask user to reboot
since the device is not 100% in a state to run, and is merely only
in a state to take push and sync operations.

overlayfs is only truly ready for developing and running if the
overly mounts had occurred in first stage init, this happens when
the device is rebooted.

We did not completely remove overlapping dead ext4 dedupe code in a
previous change, complete the process.

Simplification for adb remount, the message:

    Now reboot your device for settings to take effect

will only occur on the pass that causes the overlays to be populated,
in the same boot session. If subsequent, and ineffectual in any case,
remount command occurs again, it will not request a reboot.

Test: adb-remount-test.sh
Bug: 130131892
Change-Id: I7c4f408546687c49249883e2641b9bc63f68afd0
2019-05-29 16:44:52 -07:00
Treehugger Robot
719790f560 Merge "Minor fixes on android::base::expected" 2019-05-29 23:36:51 +00:00
Treehugger Robot
f777694081 Merge "Fix non-aio USB read issue for fastbootd" 2019-05-29 23:12:42 +00:00
chihhao.chen
8c544b6fd8 Fix non-aio USB read issue for fastbootd
non-aio USB read function was stuck in a loop waiting for more data
because data length parameter is always set 64 for fastbootd commands.
It should be a normal case to get less data than expected
since lengths of these commands are usually less than 64.
Add logic to check this and one more parameter to distinguish
fastbootd from general adbd case.

Bug: 133189029
Test: try various fastbootd commands
Change-Id: I6690324840d78f3f1e04235040301520329976db
Merged-In: I6690324840d78f3f1e04235040301520329976db
2019-05-29 23:10:50 +00:00
Vic Yang
92c236e41b init: Refactor selinux.h/cpp
This change factors out functions that handle selabels from
selinux.h/cpp into selabel.h/cpp.  This allows util.cpp to be used by
the upcoming native zygote without a bunch of define flags that are
required for selinux.cpp.

Bug: 133443795
Test: Build and boot cuttlefish.
Change-Id: Ie238a96c6407c6698a605dd8803c1727abfaae7b
2019-05-29 15:09:39 -07:00
Tom Cherry
e20f357f4f Merge changes I16ea9e32,Ib53b5d3e
* changes:
  init: make fatal reboot target configurable
  init: dump stack when aborting
2019-05-29 21:40:12 +00:00
Tom Cherry
75e13baf32 init: make fatal reboot target configurable
Currently, if init encounters a fatal issues it reboots to fastboot
but this may be not desirable in all cases, especially the case of
critical services crashing.  Therefore this change adds the ability
for vendors to customize the reboot target via the
androidboot.init_fatal_reboot_target= kernel command line.

This applies to all LOG(FATAL) messages as well as fatal signals in
userdebug/eng builds, except for signals before logging is enabled in
first stage init.

Bug: 121006328
Test: device reboots to configurable target with LOG(FATAL)
Test: device reboots to configurable target after a segfault in the
      various stages of init
Test: device reboots to fastboot without a configured target
Change-Id: I16ea9e32e2fee08dece3d33b697d7a08191d607b
2019-05-29 09:14:17 -07:00
Jiyong Park
68f5fb2971 Merge "Don't use apexd when TARGET_FLATTEN_APEX == true" 2019-05-29 16:12:05 +00:00
Tom Cherry
59656fb377 init: dump stack when aborting
Dump init stacks when aborting either due to LOG(FATAL) or in
userdebug/eng builds due to signals, including signals from
sanitizers.

Doesn't work for static first stage init yet, b/133450393 tracks
that.

Also, ensure that LOG(FATAL) in child processes calls abort() in all
stages of init, not just 2nd stage init.

Bug: 131747478
Test: abort init in various ways and see stacks
Test: hang or crash in backtrace handler and see child reboot
Change-Id: Ib53b5d3e7e814244203f875de016ada9900dfce8
2019-05-29 08:58:29 -07:00
Mark Salyzyn
b1d78402f9 Merge changes I89826fc2,Ica0c14da,Icfbb799f,I233bbc7b,I30569a7c, ...
* changes:
  adb-remount-test: check devt and inode
  adb-remount-test: add an avc check
  adb-remount-test: parameterize fastboot_wait & adb_wait, increase timeout
  adb-remount-test: report wait duration
  adb-remount-test: check vendor image signature before using
  adb-remount-test: report usb user on unexpected connection
  adb-remount-test: wait-for-screen
2019-05-29 14:25:15 +00:00
Mohammad Samiul Islam
b581ce93bb Allow adb to handle single paramter with install-multi-package flag
Bug: 130164367
Test: $adb install-multi-package dummy.apk
      It installs successfully.

Change-Id: I5775813d10b7a8d865518ce5480a401e8f41e876
2019-05-29 15:00:00 +01:00
Hemant Kumar
1cbe5edbc3 adb: daemon: Assign valid fd to usb_handle ep0 file descriptor
Bug: http://b/129283234
Test: treehugger
Change-Id: I2d005e17ccb45af95351c074cc53f6cfc53b5fdd
2019-05-28 17:53:24 -07:00
Josh Gao
43a0a9a5bf adbd: respond to device-to-host control transfers.
Failing to write to the endpoint results in subsequent reads on ep0 to
fail with EL2HLT, so do an empty write to fulfill the transfer.

Bug: http://b/131867920
Test: manually tested with modified auto client
Change-Id: If2eec162ca4b31a9974c7bd5802be51cee9e2708
Merged-In: If2eec162ca4b31a9974c7bd5802be51cee9e2708
(cherry-picked from internal commit af086e9a95)
2019-05-28 17:52:11 -07:00