Commit graph

56919 commits

Author SHA1 Message Date
Tom Cherry
9174a9bff8 init: only print backtraces on subsequent reboots with a value
Userspace reboot resets sys.powerctl to an empty string once it
starts, which was inadvertently triggering the backtrace of the main
init thread.

Test: no more unexpected backtraces
Change-Id: I35d6f1b37aa31a46ae9266647f41a709f28b6099
2020-03-31 14:36:03 -07:00
Josh Gao
db22f23dd3 Merge "Statically link libadbd into minadbd." 2020-03-31 08:25:27 +00:00
Josh Gao
d6211a2dde Merge "adb: temporarily kill adb_benchmark." 2020-03-31 03:40:47 +00:00
Josh Gao
3735614b28 Statically link libadbd into minadbd.
Bug: http://b/150317254
Test: booted aosp_walleye-eng into recovery
Change-Id: Ie479ae2fbaf1006228a531dab26c7d535ed403db
2020-03-30 18:51:15 -07:00
Josh Gao
fd193bd291 Merge "Move adbd's legacy USB implementation to fastboot." 2020-03-31 00:24:20 +00:00
Josh Gao
c6cb89ea80 adb: temporarily kill adb_benchmark.
Temporarily delete adb_benchmark, since it seems difficult to make this
sensibly work with a single target that's used for both libadb and
libadbd benchmarking.

Bug: http://b/150317254
Test: treehugger
Change-Id: Ibf81fdff4f2b7304b586ce9a7955b4bc2c11484e
2020-03-30 16:43:06 -07:00
Josh Gao
0871824de6 Move adbd's legacy USB implementation to fastboot.
This code path is effectively dead in adbd, and fastboot's dependency on
libadbd makes it hard to refactor adbd's dependencies.

Bug: http://b/150317254
Test: built and flashed aosp_walleye-eng
Change-Id: I5118136d32fdcbbd011559ed0a4a71e1dc7bf064
2020-03-30 16:43:06 -07:00
Peter Collingbourne
cd63cae6b2 Merge "Read fault address on arm64 using proposed kernel API." 2020-03-30 21:40:58 +00:00
Peter Collingbourne
5677803cb7 Merge "Create a debugger_process_info data structure with the process info pointers." 2020-03-30 21:36:41 +00:00
Tianjie Xu
b480dc4f3f Merge "Fix integrity check when parsing zip64 eocd" 2020-03-30 20:33:45 +00:00
Peter Collingbourne
e2b76c5b00 Merge "Move crash_dump into the runtime APEX." 2020-03-30 19:03:41 +00:00
Tom Cherry
3de710f84f Merge changes I3b20be28,I7118025c
* changes:
  Revert "init: disable oneshot_on test"
  init: require root for oneshot_on test
2020-03-30 18:03:00 +00:00
Treehugger Robot
6f6beb3cc0 Merge "Move PC-only unwind frame generation to libunwindstack." 2020-03-30 17:49:35 +00:00
Tom Cherry
91537d30de Revert "init: disable oneshot_on test"
This reverts commit d30c51157e.

This test wasn't flaky, it was failing when not run as root, but that
has been fixed.

Bug: 152630580
Bug: 152637928
Test: this test is okay now
Change-Id: I3b20be2839dae90ffc6a8eeea68f36e532060af1
2020-03-30 09:37:05 -07:00
Tom Cherry
14f4afd2f2 init: require root for oneshot_on test
Bug: 152630580
Bug: 152637928
Bug: 152662041
Bug: 152662652
Test: this test is skipped when run as non-root
Change-Id: I7118025cc20081a200000bf484a08c9ed0b0d3ec
2020-03-30 09:12:31 -07:00
Treehugger Robot
4e18727421 Merge "libdm: Link libraries statically for VTS." 2020-03-30 01:46:54 +00:00
Tianjie
173aba03f7 Fix integrity check when parsing zip64 eocd
The old check has some missing cases and may lead to read OOB.

Bug: 152433916
Test: unit tests pass
Change-Id: I3e8705b9c2db081228c5f9bd191c133668376ff2
2020-03-28 21:31:56 -07:00
Treehugger Robot
56188cc1c2 Merge "init: disable oneshot_on test" 2020-03-28 19:49:26 +00:00
Songchun Fan
26a8ed983c Merge "[adb] use zip iteration with functor" 2020-03-28 03:03:07 +00:00
Peter Collingbourne
f03af8844a Read fault address on arm64 using proposed kernel API.
On aarch64, the top 8 bits of the address (i.e. the tag bits) of
the fault address in si_addr are always clear. This isn't ideal for
MTE which will require these bits in order to correctly diagnose
tag mismatches.

A proposed kernel patch [1] exposes the full fault address including
the tag bits as part of the ucontext. Change debuggerd to read this
fault address if available.

[1] https://patchwork.kernel.org/patch/11435077/

Bug: 135772972
Change-Id: Ia05be574113860f4e9ecc36a310c4b740e0c4afb
2020-03-27 20:00:06 -07:00
Songchun Fan
0f11895157 [adb] use zip iteration with functor
Test: manual
BUG: 151676293
Change-Id: I738811bb5ff3ecc86ae49aa64df29427fb4ec69a
2020-03-27 18:38:50 -07:00
Treehugger Robot
551130fc2b Merge "Revert "Revert "Delay initial accept() until server initialized""" 2020-03-28 01:27:38 +00:00
Treehugger Robot
02875acf84 Merge "[adb] Use incremental installation by default" 2020-03-28 00:47:26 +00:00
David Anderson
9d7eaf48bc Merge "fastbootd: Unmount /cache before flashing." 2020-03-27 23:48:13 +00:00
Treehugger Robot
e578fd579e Merge "init: even better logging around subsequent sys.powerctl messages" 2020-03-27 23:30:25 +00:00
Yifan Hong
4e78aa8f12 Merge changes from topic "fdr_merge"
* changes:
  libsnapshot: Allow forward merge on FDR
  libsnapshot: Place forward merge indicator for wipe
  libsnapshot: Add allow-forward-merge indicator.
  libsnapshot: Fix DataWipeAfterRollback test
2020-03-27 23:05:15 +00:00
Treehugger Robot
e10591fc62 Merge "init: do not handle control messages after shutdown" 2020-03-27 22:55:30 +00:00
Treehugger Robot
cf14ea2c7f Merge "init: fix StopSendingMessages()" 2020-03-27 22:36:51 +00:00
Tom Cherry
080fa98815 init: even better logging around subsequent sys.powerctl messages
Bug: 150863651
Test: add delays during critical parts of shutdown and see the
      expected debug information
Change-Id: Ida586903fd3eefc32ca9ee34ea2db037896ed9f4
2020-03-27 14:39:16 -07:00
Tom Cherry
22d6348845 init: do not handle control messages after shutdown
We already stop queue'ing new control messages, but we forgot to stop
handling those control messages that are already queued.  This CL
fixes that.

Bug: 150863651
Test: CF reboots appropriately
Change-Id: Ifea07a30b868de23eb735db10d8bae410e1b98bb
2020-03-27 14:08:20 -07:00
Tom Cherry
68855276a1 init: fix StopSendingMessages()
A typo made this function a no-op.

Bug: 150863651
Test: CF responds to messages appropriately
Change-Id: Iaae0264fae3f2b899ceb5ba0364a4773df1f7ca3
2020-03-27 13:57:53 -07:00
Daniel Colascione
c2612cd775 Revert "Revert "Delay initial accept() until server initialized""
This reverts commit b71b5af783.

Test: actually build device and host adb this time
Change-Id: I9f9375aa83c9d023a1e26d2f95676b734e12f926
2020-03-27 20:51:19 +00:00
Tom Cherry
d30c51157e init: disable oneshot_on test
Apparently relying on bootanim to restart or not is too flaky.

Bug: 152630580
Bug: 152637928
Test: this test no longer runs
Change-Id: If61b31bad276560a9f0db9811724bbc9efc51d28
2020-03-27 13:37:50 -07:00
Yurii Zubrytskyi
4532ea881a [adb] Use incremental installation by default
This CL turns on the incremental installation for all
"adb install ..." commands where no explicit mode has been set.
To disable this, set the ADB_INSTALL_DEFAULT_INCREMENTAL
environment variable to 0/n/no/false. Unset to enable back

+ improve the install command argument parsing a bit: allow
  --wait for all installation modes, --incr is enough for
  an incremental install (and --no-incr to disable it)

Bug: 150183149
Test: adb install with different apks and command line switches
Change-Id: I1a237f34b70d920146746ab16104e28ef555a5fd
2020-03-27 12:30:29 -07:00
Tom Cherry
44a6d9a527 Merge "init: use an eventfd instead of socketpair to wake the main loop" 2020-03-27 17:10:55 +00:00
Tom Cherry
40463336a8 init: use an eventfd instead of socketpair to wake the main loop
eventfd is a more suitable mechanism.

Bug: 150863651
Test: boot CF, ctl.start services, reboot CF
Change-Id: Ie5c3b0c048afdd7afa4bfc4cba26bec3225925e5
2020-03-27 08:08:52 -07:00
Treehugger Robot
6b42d6d859 Merge "adb: Avoid extra string construction" 2020-03-27 15:00:05 +00:00
Greg Kaiser
030f1effdf adb: Avoid extra string construction
Test: TreeHugger
Change-Id: Ie03062a17b98866f1bc419a7e509461cf4e6bb80
2020-03-27 06:10:11 -07:00
Yurii Zubrytskyi
a1f41fc6f1 Merge "[adb] generic "cast_handle_to_int" function" 2020-03-27 07:03:22 +00:00
Treehugger Robot
f225aa3f24 Merge "adb: fix bugreport status line." 2020-03-27 06:14:16 +00:00
Yurii Zubrytskyi
e3e64b8f54 [adb] generic "cast_handle_to_int" function
Now one can use it without platform #ifdefs

Bug: 150183149
Test: compiles
Change-Id: I6280dcdd2faaff33014f11237d9d04231ac16b82
2020-03-26 22:25:46 -07:00
Josh Gao
82f715b7b5 adb: fix bugreport status line.
The status line char* was getting converted to bool and used as the
compression argument, and the actual status line was defaulting to
nullptr. This didn't actually really change anything, since we only use
the name during transfer, and not for the final message at the end, so
the output is slightly uglier for 50 milliseconds.

This also had the side effect of turning on compression for the
already-compressed bugreport zip, which costs a bit of throughput with
brotli.

Bug: https://issuetracker.google.com/150827486
Test: adb bugreport foo.zip
Change-Id: I74bed9c09442c655a956eb1e8318c0123632ef4c
2020-03-26 21:10:31 -07:00
Treehugger Robot
919678bcbe Merge "libsnapshot: Fix intermittent test failure due to missing null check." 2020-03-27 00:24:19 +00:00
Yifan Hong
973b8c10d1 libsnapshot: Allow forward merge on FDR
If forward merge indicator exists at unverified state during FDR,
we are allowed to initiate merge and finish it before wiping userdata.

Test: downgrades
Test: update with data wipe
Test: vts_libsnapshot_test
Bug: 152094219
Change-Id: I151f1af4aca446cc52e669c5c3ea2b2e55acb468
2020-03-26 15:01:13 -07:00
Yifan Hong
6b0251232a libsnapshot: Place forward merge indicator for wipe
If the device applies a package with FDR, place forward merge indicator
so that on FDR, the snapshots aren't abandoned, and we forward merge
the update.

Test: apply downgrade
Test: apply update with data wipe
Test: vts_libsnapshot_test
Bug: 152094219
Change-Id: Id32aeca380db797cd777321837f146333ae6b33c
2020-03-26 15:01:13 -07:00
Treehugger Robot
d9fb5c895b Merge "init: add missing TEMP_FAILURE_RETRY" 2020-03-26 21:59:30 +00:00
David Anderson
533b2b6296 libsnapshot: Fix intermittent test failure due to missing null check.
Bug: 152547190
Test: vts_snapshot_test
Change-Id: If7adc4fba61325e52d6268531ce0a15b00c0a380
2020-03-26 14:56:11 -07:00
Yifan Hong
f9e1e16377 libsnapshot: Add allow-forward-merge indicator.
The indicator signals that on factory data reset, initiating
merge is allowed.

Test: vts_libsnapshot_test
Test: apply downgrade update
Test: apply update with FDR
Bug: 152094219
Change-Id: Ieecddd198136571dd652ca62c27fe65a12b7b15f
2020-03-26 14:56:11 -07:00
Yifan Hong
a4f9b07490 libsnapshot: Fix DataWipeAfterRollback test
Test: run it
Bug: 152094219
Change-Id: I06852d7a0514481cbeed3ef66192ba49a24cb54b
2020-03-26 14:56:11 -07:00
Tom Cherry
975bfe1146 init: add missing TEMP_FAILURE_RETRY
Bug: 150863651
Test: boot
Merged-In: I09e86e08a716c2c2933e090d57818a9aad6486f8
Change-Id: I09e86e08a716c2c2933e090d57818a9aad6486f8
2020-03-26 20:50:35 +00:00