Commit graph

56941 commits

Author SHA1 Message Date
Josh Gao
2165717875 adb: fix use of wrong union variant.
Also, prepare to add more compression flags.

Bug: https://issuetracker.google.com/150827486
Test: none
Change-Id: I5044e5d5944aff5c18241fd7439baa48e2e09980
2020-04-02 17:11:07 -07:00
Josh Gao
4da40a9a5b adb: fix front_size, front_data.
Bug: https://issuetracker.google.com/150827486
Test: adb_test
Change-Id: I3d2c73a20a703d793efb56e592cf33149815f89b
2020-04-02 17:11:07 -07:00
Josh Gao
49ba558aa8 adb: add interfaces for Encoder/Decoder.
More groundwork to support more compression algorithms.

Bug: https://issuetracker.google.com/150827486
Test: python3 -m unittest test_device.FileOperationsTest{Uncompressed,Brotli}
Change-Id: I638493083b83e3f6c6854b631471e9d6b50bd79f
2020-04-02 17:11:07 -07:00
Josh Gao
73d44bb6c2 Merge changes I90e10c74,I038d1df4,I4299bd96
* changes:
  adbd: delete unused variable.
  adb: move things around to prepare to add LZ4.
  adb: fix misindentation in Android.bp
2020-04-01 22:38:38 +00:00
Josh Gao
e485bdf06e adbd: delete unused variable.
Bug: https://issuetracker.google.com/150827486
Test: m adb com.android.adbd.apex
Change-Id: I90e10c74d695659c702dea4173cb33ac5ca1a102
2020-04-01 13:09:31 -07:00
Josh Gao
6e697f2f8c adb: move things around to prepare to add LZ4.
Bug: https://issuetracker.google.com/150827486
Test: m adb com.android.adbd.apex
Change-Id: I038d1df4f179ddb23102016d781c9bd90da5a546
2020-04-01 13:09:29 -07:00
Josh Gao
31d42aa73c adb: fix misindentation in Android.bp
Bug: https://issuetracker.google.com/150827486
Test: none
Change-Id: I4299bd962963a58ef5f075405b99b1d1e4c1febc
2020-04-01 13:09:16 -07:00
Tom Cherry
d54a4bf9a3 Merge "init: don't sync() before shutting down services" 2020-04-01 15:40:44 +00:00
Nikita Ioffe
884b570100 Merge "Make init.userspace_reboot.is_supported a rw property" 2020-04-01 13:14:21 +00:00
Tom Cherry
10615eb397 init: don't sync() before shutting down services
Devices in the lab are hitting an issue where they're getting stuck
likely in the sync() call in DoReboot() before we start the reboot
monitor thread and before we shut down services.

It's possible that concurrent writing to RW file systems is causing
this sync() call to take essentially forever.  To protect against
this, we need to remove this sync().  Note that we will still call
sync() after shutting down services.

Note that the service shutdown code has a timeout and there is a
reboot monitor thread that will shutdown the device if more than 30
seconds pass above that timeout.  This change increases that timeout
to 300 seconds to give the final sync() calls explicitly more time to
finish.

Bug: 150863651
Test: reboot functions normally
Test: put an infinite loop in DoReboot and the the reboot monitor thread
      triggers and shuts down the device appropriately
Change-Id: I6fd7d3a25d3225081388e39a14c9fdab21b592ba
2020-03-31 18:59:23 -07:00
Tom Cherry
e55818cd83 Merge "init: only print backtraces on subsequent reboots with a value" 2020-04-01 00:53:10 +00:00
Peter Collingbourne
bc1a6191f1 Merge "Fix off-by-one in ReadBuildIDFromMemory." 2020-03-31 23:08:12 +00:00
Tianjie Xu
fcf2d8b89b Merge "Support parsing of data descriptor" 2020-03-31 21:52:52 +00:00
Tom Cherry
8890d42939 Merge "fastbootd: sync() after flashing partitions or updating super" 2020-03-31 21:52:39 +00:00
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
Tianjie
0ec0eaa214 Support parsing of data descriptor
The size fields in the data descriptor can be either 4 bytes or 8 bytes.
This depends on if the size are read from the zip64 extended field in
the local file header. This cl adds support to parse these cases.

Also fix a misconception in that the uncompressed and compressed size
doesn't need to exist together in the zip64 fields of the central
directory. But they still need to co-exist in the fields of the local
file header.

Bug: 150900468
Test: unit tests pass, python tests pass
Change-Id: Ia54f9bf56c85ff456ead90a136f7fddc5be5220c
2020-03-31 12:01:12 -07:00
Tom Cherry
e4a6ed8534 fastbootd: sync() after flashing partitions or updating super
There is a chance that devices are failing to reboot in the lab due to
sync() taking explicitly long during reboot.  Let's add the sync()'s
here to ensure they get accounted for in the flashing process.

A side benefit is it's likely safer to sync immediately after
flashing than to hope init does it during reboot.

Bug: 150863651
Test: flash local devices successfully
Change-Id: I4c4b0114f3cde8af4b8b2cb283ec21f869ef9f6f
2020-03-31 10:54:58 -07:00
Peter Collingbourne
a7b4c5d25a Fix off-by-one in ReadBuildIDFromMemory.
This was sometimes causing build ids to be truncated, probably because
of memory corruption in std::string. A similar off-by-one was fixed in
ReadBuildID in aosp/939619.

Bug: 129873279
Change-Id: I401fe7f991dbd135f5b4836381b48ea3c6a2243f
2020-03-31 10:29:38 -07:00
Yurii Zubrytskyi
f8dc296dfd Merge "adb: fix apex installation." 2020-03-31 16:56:07 +00:00
Jaegeuk Kim
a76ee8b929 Merge "rootdir: init.rc: use default dirty writeout policy" 2020-03-31 15:57:22 +00: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
3c1803cab5 adb: fix apex installation.
Incremental doesn't support apex installation, but we were exiting
instead of returning -1 to fall back to regular installation.

Bug: http://b/151900478
Test: manual
Change-Id: Id27009250090a65fbb45bb65fc39c1799bf1f861
2020-03-31 02:08:14 +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
Jaegeuk Kim
58ff5075ac rootdir: init.rc: use default dirty writeout policy
This patch removed the old writeout policy tune which was never touched since
2009. In the meantime, most of Android devices are equipped with over 4GB DRAM
and very fast flash storages like UFS, which becomes more like desktop or
servers in 2009. So, it'd be worth to go back to use the default kernel configs.

Bug: 129751503
Change-Id: Idb58f5b01bbc4afd270cffba5b8912ea3565819f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-03-31 01:49:13 +00: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
Nikita Ioffe
663cd35030 Make init.userspace_reboot.is_supported a rw property
General recommendation is to avoid read-only properties, and instead control
"read-onlines" by only allowing init/vendor_init to set the property.

Since ro.init.userspace_reboot.is_supported was added in this release, and
nobody outside of the platform is querying it directly, it should be fine to
simply rename it.

Test: adb shell getprop init.userspace_reboot.is_supported
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152803929
Change-Id: I7552d5ccc6e9b750a6081947eef8fcb027be13e1
2020-03-30 23:40:45 +01: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