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
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
In order to run them continuously, add them to general-test
zip.
Test: make general-tests
Bug: 112104122
Change-Id: I7a1143ac638626069ed78ddd450063e9489e22e8
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
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
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>
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
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
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
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
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
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
* 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.
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
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
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
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
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
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
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
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
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