Commit graph

42245 commits

Author SHA1 Message Date
Josh Gao
6c1b42ccd0 adb: fix test_device.FileOperationsTest.test_push_empty
Test: python test_device.py
Change-Id: Iaa5006e39c3d61374de11c05bcaffb4f30b7512e
2018-08-08 17:40:15 -07:00
Josh Gao
b3610734f8 adb: switch test_adb.py over to double quotes.
Test: ./test_adb.py
Change-Id: I3a568361d54f32cc895cea439de0f2c38aee5e2d
2018-08-08 17:40:15 -07:00
Josh Gao
676f375d9b adb: make test_adb.py work on windows.
Switch from os.pipe to socket.socketpair for the fake adbd termination
termination signaller, that we can select on it on windows.

Test: test_adb.py on windows (2 failures on windows)
Change-Id: I37df06e465ec8be28cfb18a5c21ef30125195004
2018-08-08 17:40:15 -07:00
Josh Gao
9b6522b357 adb: switch test_adb.py to python3.
Currently, test_adb.py doesn't work on Windows, because we're selecting
on a pipe, which doesn't work on Windows. Python 3.5 adds socketpair
support to Windows, so switch over to Python 3 to make it so we can use
that.

Test: python3 test_adb.py
Change-Id: I0fbd1bca0b28324658831d5ef8ee08aefe2b0596
2018-08-08 17:40:15 -07:00
Treehugger Robot
7b1d163cb8 Merge "Add adb integration test to general-tests" 2018-08-09 00:05:51 +00:00
Treehugger Robot
70306b9271 Merge "fastbootd: Implement the getvar command." 2018-08-08 22:37:00 +00:00
Florian Mayer
ec004eb1b3 Merge "Allow to get raw register data on all platforms." 2018-08-08 21:37:46 +00:00
Treehugger Robot
f41897a66e Merge "adb: clean up handle_host_request." 2018-08-08 20:36:44 +00:00
Mathieu Chartier
fe891a88a9 Merge "Move to using ClassAccessor" 2018-08-08 20:05:13 +00:00
Julien Desprez
75fea7ec3b Add adb integration test to general-tests
In order to run them continuously, add them to general-test
zip.

Test: make general-tests
Bug: 112104122
Change-Id: I7a1143ac638626069ed78ddd450063e9489e22e8
2018-08-08 12:08:50 -07:00
Hridya Valsaraju
31d2c26409 fastbootd: Implement the getvar command.
This implements basic "fastboot getvar" support, including commands supported
by IBootControl.

Bug: 78793464
Test: fastboot getvar <fastboot variable>

Change-Id: Iee1a7b3f43dea46f80dcdf73c45034e2ffe4727d
2018-08-08 11:41:53 -07:00
Mathieu Chartier
c2277fc216 Move to using ClassAccessor
In preparation for removal of ClassDataItemAccessor.

Bug: 79758018
Test: make
Test: test/run-test --host 137
Test: out/host/linux-x86/nativetest/libunwindstack_test/libunwindstack_test

Change-Id: I61a20fe7200a0d669b84573d3853b55877922602
2018-08-08 11:04:15 -07:00
Treehugger Robot
1e0e1b44bd Merge "lmkd: Skip memory.stat usage when per-app memcgs are not used" 2018-08-08 16:44:22 +00:00
Florian Mayer
932247e900 Allow to get raw register data on all platforms.
No new test failures introduced.

atest libunwindstack_test on aosp_walleye-userdebug:

Without patch:
Total: 800, Passed: 781, Failed: 19
With patch:
Total: 800, Passed: 781, Failed: 19

Change-Id: I8853c3e1594799761b481464b75e2904b38c4830
2018-08-08 11:19:41 +01:00
Suren Baghdasaryan
1d1c002c3d lmkd: Skip memory.stat usage when per-app memcgs are not used
Initial change to remove memory.stat usage when per-application memcgs
are disabled was partially merged into AOSP under the following id:
Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a
This change adds the missing parts.

Bug: 110384555
Change-Id: I1265021b1ede0e68efbf80d6430a959eaf46a69a
Merged-In: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-08-08 01:18:38 +00:00
Suren Baghdasaryan
41950dd414 Merge "lmkd: Protect against buffer overflow" 2018-08-08 00:52:18 +00:00
Tao Bao
8fa3adb8a9 Merge "Merge libsync_recovery rules into libsync." 2018-08-08 00:26:38 +00:00
Greg Kaiser
f0da9b0cc2 lmkd: Protect against buffer overflow
We're passing a 'line' whose backing buffer is PAGE_MAX in size
into memory_stat_parse_line().  We protect overflowing the smaller
LINE_MAX 'key' buffer via some C preprocessing macros to assure
we limit the size.

Test: Local build with LMKD_LOG_STATS set for this file.
Bug: 76220622
Change-Id: I9e50d4270f7099e37a9bfc7fb9b9b95cc7adb086
2018-08-07 15:42:19 -07:00
Josh Gao
4039051d6d adb: clean up handle_host_request.
Previously, we were returning the result of SendOkay/SendFail in a few
places after handling a host request, which is incorrect for two
reasons. First, the return type of SendOkay/SendFail is bool, and
handle_host_request was expected to return 0 on success. Second, we
don't care if the SendOkay fails; if we got to that point, we're done
with the request, regardless of whether we succeeded to report our
result. The result of this was a spurious failure result reported after
the initial result, which was ignored by the adb client.

Test: manually straced adb server
Test: python test_adb.py
Test: python test_device.py
Change-Id: I7d45ba527e1faccbbae5b15e7a0d1557b0a84858
2018-08-07 14:24:36 -07:00
Treehugger Robot
7d4e7d3156 Merge "Revert "Support Speck encryption."" 2018-08-07 21:11:51 +00:00
Treehugger Robot
6b0ecdab15 Merge "fastboot: Fix product-services typo" 2018-08-07 18:24:10 +00:00
Tao Bao
ba22102ce3 Merge "Make libadf, libsync_recovery recovery_available." 2018-08-07 18:05:45 +00:00
Tao Bao
f32d3df46f Merge libsync_recovery rules into libsync.
Statically linking against libsync is no longer a concern, since libsync
has supported the modern sync ABI (which is frozen upstream) after the
recent cleanup works.

Test: `m dist` with aosp_taimen-userdebug
Change-Id: Ic162bc7ff7c9dd306658d11d4b71e2d18730a2ee
2018-08-07 11:00:50 -07:00
Jerry Zhang
9b66330375 Make libadf, libsync_recovery recovery_available.
Bug: 110380063
Test: `m dist` with aosp_taimen-userdebug
Change-Id: Ie3543ff89b6b4f0de04eff0f85f8001f4b27d86a
2018-08-07 10:53:07 -07:00
Mark Salyzyn
f3c332725b Merge "bootstat: duplicate boot reason entries" 2018-08-07 17:38:50 +00:00
Greg Kaiser
954c141c48 Revert "Support Speck encryption."
This reverts commit 49c27c5cb2.

Remove the Speck encryption support. It was eventually
decided not to allow Speck in Android P, so this code
is no longer needed and wasn't used outside of testing.

Bug: 112009351
Test: Confirmed AES continues to work with FBE.
Change-Id: Ia5458143be5687fff8d541d8fa2c8ee24a369da4
2018-08-07 10:10:31 -07:00
Mark Salyzyn
274b5447fa bootstat: duplicate boot reason entries
Selected visually obvious non-compliant boot reasons to allow
for future re-use of a later formerly duplicated entry.

Test: compile
Bug: 112157996
Change-Id: I3c6b449d36f9e4b745214dd7840b1dc1258bf483
2018-08-07 09:57:32 -07:00
Xin Li
5d707816ac Merge "Merge Android Pie into master" 2018-08-07 16:51:24 +00:00
David Anderson
8cdea7ff0c fastboot: Fix product-services typo
The build system generates a partition name of "product_services" for
the product-services partition, so fastboot's image list must reflect
this.

Bug: 78793464
Test: fastboot flash product_services works with fastbootd
Change-Id: I348f970c9584fd3dd4369e8cded66b6e39eee2b2
2018-08-07 09:29:11 -07:00
Tom Cherry
574533a657 Merge "split first stage init into a separate executable" 2018-08-07 16:08:55 +00:00
Josh Gao
50973d1865 Merge changes from topic "fdsan_debuggerd"
* changes:
  adb: actually enable fdsan.
  adb: move AdbCloser to its rightful place.
  libdebuggerd: extract and print the fdsan table.
  crash_dump: pass the address of the fdsan table.
2018-08-07 10:02:16 +00:00
Orion Hodson
919ee8ab1c Merge "Revert "Prepare to fail in RefBase destructor if count is untouched"" 2018-08-07 08:27:29 +00:00
Hans Boehm
b9d0753d2b Revert "Prepare to fail in RefBase destructor if count is untouched"
This reverts commit 9d3146af22.

Reason for revert: It appears that weak symbols don't work as expected on MacOS, breaking the MacOS aapt build.

Change-Id: Ica0955106485a7bf2e2c3f09ff7910e230eb4139
2018-08-07 05:35:12 +00:00
Josh Gao
297d9bf8ea adb: actually enable fdsan.
adb was using a custom unique_fd closer that didn't have an
implementation for fdsan, which meant that none of our FDs were
actually tracked. Guard this behind ifdefs so that we only use this
on Windows, and delete our implementation of Pipe in favor of the one
in libbase while we're at it. libbase's implementation always sets
O_CLOEXEC, so fix up the instance of Pipe that doesn't expect that.

Test: mma
Test: adb start-server
Test: debuggerd `pidof adbd`
Change-Id: Ic29d641a2f93fb42384b00c51775048c8bcbe152
2018-08-06 18:50:10 -07:00
Josh Gao
9d100f1043 adb: move AdbCloser to its rightful place.
Test: mma
Change-Id: Ie74c49e8abf72f594a35d04b2b0d99b96f58f8d0
2018-08-06 18:50:10 -07:00
Josh Gao
ce841d91fb libdebuggerd: extract and print the fdsan table.
This commit only prints the raw value of the owner tag, pretty-printing
will come in a follow-up commit.

Test: debuggerd `pidof adbd`
Test: static_crasher fdsan_file + manual inspection of tombstone
Change-Id: Idb7375a12e410d5b51e6fcb6885d4beb20bccd0e
2018-08-06 18:50:10 -07:00
Josh Gao
9da1f51c10 crash_dump: pass the address of the fdsan table.
Pass the address of the fdsan table down to crash_dump so that we can
dump the fdsan table along with the open file descriptor list.

Test: debuggerd_test
Test: manually ran an old static_crasher
Change-Id: Icbac5487109f2db1e1061c4d46de11b016b299e3
2018-08-06 18:50:10 -07:00
Treehugger Robot
4f878cf6cb Merge "fs_mgr: Do not mount empty partitions." 2018-08-07 00:52:34 +00:00
Treehugger Robot
a70e2b2ed7 Merge "liblp: Allow flashing to readonly logical partitions." 2018-08-07 00:28:48 +00:00
Xin Li
fb973d34ac Merge Android Pie into master
Bug: 112104996
Change-Id: Ib0e5b2801a931b469b753806b1fbe2fabb0c1de5
2018-08-06 17:26:31 -07:00
Treehugger Robot
c4630ef445 Merge "Allow existance of partition to be checked before flashall or update" 2018-08-07 00:20:46 +00:00
Treehugger Robot
c30a75a007 Merge "Add fastbootd." 2018-08-07 00:08:18 +00:00
David Anderson
6868cb9f5e fs_mgr: Do not mount empty partitions.
If a logical partition is resized to 0 bytes, it will have no extents.
This is not allowed by device-mapper, but is useful for effectively
compacting partitions with "fastboot flashall". If all logical
partitions are resized to 0, then resized to their intended size, then
we will allocate extents more efficiently.

However, if a partition is left with a zero size (either intentionally
or not), this should not throw the device into a reboot loop due to
CreateLogicalPartitions failing. Instead we skip partitions with no
extents.

Bug: 78793464
Test: with fastbootd:
        fastboot create-partition example 4096
        fastboot resize-partition example 0
      device reboots successfully

Change-Id: I572efa949176c8c3c493ef00438d8badd4d7cf4f
2018-08-06 15:59:38 -07:00
David Anderson
4d71d85805 liblp: Allow flashing to readonly logical partitions.
By default, logical partitions with the readonly flag are created with a
readonly device. This change allows callers of CreateLogicalPartition
to create writable devices so they can still be flashed.

Bug: 78793464
Test: fastboot flash product_services works with fastbootd
Change-Id: Ia8d2761a3067e3b62815acbf0b6fb7f033072ba2
2018-08-06 15:47:26 -07:00
Tao Bao
19e545c12d Merge "adb: adbd uses shared libraries."
am: 0e947189c5

Change-Id: If6dd1b01b0ae7b71c8911045ef0570f0c226e5d9
2018-08-06 15:34:51 -07:00
Tao Bao
0e947189c5 Merge "adb: adbd uses shared libraries." 2018-08-06 21:55:28 +00:00
Tao Bao
eca59ae895 adb: adbd uses shared libraries.
This CL builds the former `libadbd` as a shared library, and moves
`adbd` to using shared libraries.

We can't switch `libadbd` from static to shared library directly, due to
the circular dependency between `libadbd` and `adbd`. In particular,
daemon_service_to_fd() can't be compiled into `libadbd`, as it needs to
be overridden by recovery/minadbd.

This CL creates a static library `libadbd_core` as the common base,
which contains everything from the former `libadbd`. Both of the two
shared library targets `libadbd` and `libadbd_services` depend on
`libadbd_core`.

The `adbd` on device (under both of normal boot and recovery) now
depends on `libadbd.so` and `libadbd_services.so`. recovery/minadbd will
depend on `libadbd.so` and `libminadbd_services.so` in future (after
fully converting recovery to Soong).

Bug: 78793464
Test: `m dist`
Test: Run adbd_test on marlin.
Test: Build and flash marlin on device. Check basic adbd functionalities
      (`adb shell` and `adb sync`) under normal boot and recovery.
Test: `adb sideload` on marlin.
Change-Id: Iacbd4db524ef94abd175cd1d27688f4faf3db024
2018-08-06 11:40:47 -07:00
Hridya Valsaraju
f1f0a9c8a5 Allow existance of partition to be checked before flashall or update
Bug: 112108453
Test: fastboot flashall with super.img and product-services.img in $OUT,
fastboot update with super.img and product-services.img in image.zip.

Change-Id: I5718b5e60c546c55af74292895b3f7fe169e4f02
2018-08-06 11:05:37 -07:00
Hans Boehm
b708511f78 Merge "Prepare to fail in RefBase destructor if count is untouched"
am: f502182ac6

Change-Id: I91ff7140a9a72c910ef01a2e13f277fa36c82b50
2018-08-06 11:01:28 -07:00
Tom Cherry
31438489c0 split first stage init into a separate executable
In the future, systems with dm-linear will require a ramdisk to set up
the mount for system.  In this world, first stage init will be a part
of this ramdisk and handle setting up dm-linear, mounting the
necessary partitions, then pivoting to the system image, which will
become the root partition.

This also enables previous devices without system-as-root, to be
unified with system-as-root devices for all aspects of boot after the
pivot_root.

Bug: 79758715
Test: boot hikey
Test: boot sailfish, boot sailfish into recovery
Change-Id: Iefa88a3ec5994e7989aa9f26f2de0351ffa5468b
2018-08-06 10:36:43 -07:00