Commit Graph

62801 Commits

Author SHA1 Message Date
Josh Gao 1b65ebe2e0 adb: fix `push --sync` with multiple inputs.
Previously, when push --sync was used with multiple files, we tried to
stat a remote file with pending acknowledgements still in the socket
buffer, which leads to an abort when we read ID_OKAY instead of the
response we were expecting.

This patch changes the behavior to always wait for acknowledgements if
we're pushing with --sync (or `adb sync`). This results in a ~100ms
regression during a 10 second sync of every file on the system image,
but that's not very much, so perhaps we should consider doing this
always.

Bug: http://b/166155032
Test: test_device.py
Change-Id: I7110243071ba5fbaa77dcc76f42a19d9ed2b4195
2020-09-08 18:07:47 -07:00
Nikita Ioffe 4e311d69b5 Merge "Only store result of mount_all that mounted userdata" am: edc501d674
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1420053

Change-Id: I444f74692633b2bc4f5bcf03cd036b5c52b120aa
2020-09-08 23:10:11 +00:00
Nikita Ioffe edc501d674 Merge "Only store result of mount_all that mounted userdata" 2020-09-08 22:37:52 +00:00
Nikita Ioffe 9ede7ec273 Only store result of mount_all that mounted userdata
During boot sequence there can be multiple calls to mount_all. For the
userspace reboot to correctly remount userdata, we need to store the
return code of the one that was responsible in mounting userdata.

Test: adb root
Test: adb shell setprop init.userspace_reboot.is_supported 1
Test: adb reboot userspace
Test: checked dmsg
Bug: 166353152
Change-Id: Id0ae15f3bcf65fa54e4e72b76f64716c053af7fb
2020-09-08 21:58:43 +01:00
Treehugger Robot 91f3227436 Merge "Move PropertyMap from libutils to libinput" am: 01a30c0d2b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396177

Change-Id: I02919926ccbc4127f9c9c2a2b66eb2a7334c7270
2020-09-08 16:17:05 +00:00
Treehugger Robot 01a30c0d2b Merge "Move PropertyMap from libutils to libinput" 2020-09-08 16:03:36 +00:00
Alistair Delva e751aae086 Merge "Make libsparse vendor_available" am: 5a6f49dde7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1419608

Change-Id: I83571db0c33bcf6768598ed630fe99f470483788
2020-09-08 15:35:14 +00:00
Alistair Delva 5a6f49dde7 Merge "Make libsparse vendor_available" 2020-09-08 15:15:19 +00:00
David Anderson 9bd7d9bd18 Merge "libsnapshot: Add a tool for estimating non-A/B OTA sizes with the new COW format." am: f9a436a052
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1411189

Change-Id: Iecd270c757577315cd485aad52e268ca601fb5fe
2020-09-04 19:29:15 +00:00
David Anderson f9a436a052 Merge "libsnapshot: Add a tool for estimating non-A/B OTA sizes with the new COW format." 2020-09-04 18:55:22 +00:00
David Anderson f4ebaca8a7 libsnapshot: Add a tool for estimating non-A/B OTA sizes with the new COW format.
This tool allows users to estimate the COW size for a non-A/B update.
It works by scanning the partitions of two target-files packages, and
identifying moved or copied blocks, and simulating the impact in the new
COW format.

It has two modes:

    estimate_cow_from_non_ab_ota -ota_tf <path>

Will estimate the COW size for a full OTA. For an incremental OTA, you
need two target files packages:

    estimate_cow_from_non_ab_ota -source_tf <path> -ota_tf <path>

There is an optional -compression argument which accepts either "none"
or "gz".

Bug: 161497962
Test: manual test
Change-Id: I335059cd870a464f34c5d644eefefdc76775386e
2020-09-03 19:04:34 -07:00
Treehugger Robot 9bfc688fe9 Merge "Return bytes written in CowWriter" am: b745a960f8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1419388

Change-Id: Id707e37c7cb64d05922c7db9db0d0b26685136c4
2020-09-03 22:31:45 +00:00
Treehugger Robot b745a960f8 Merge "Return bytes written in CowWriter" 2020-09-03 22:01:25 +00:00
Elliott Hughes 4c4af77b16 Merge "ashmem: ensure ashmem fds are CLOEXEC." am: a2f248724c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1419610

Change-Id: I7d6f11a48f423951b0811b3d754508542b809dcd
2020-09-03 21:23:38 +00:00
Elliott Hughes a2f248724c Merge "ashmem: ensure ashmem fds are CLOEXEC." 2020-09-03 21:06:03 +00:00
Kelvin Zhang 8e75a38edd Return bytes written in CowWriter
delta_generator in update_engine needs to know number of bytes written
to estimate cow image sizes. This change modifies CowWriter::Finalize to
return relevant information.

Test: unnitest
Change-Id: I7cf6b9124b90f089a7c5f3850c38200f82da18e6
2020-09-03 15:59:17 -04:00
Elliott Hughes 790ef05793 ashmem: ensure ashmem fds are CLOEXEC.
Fix the memfd_create(2) path and add the missing unit test.

Bug: https://issuetracker.google.com/165667331
Test: treehugger
Change-Id: Ibb5c1d0f9d7caba1df04d1f03e82e55026d9f86a
2020-09-03 10:54:20 -07:00
Alistair Delva 9e28cd32fd Make libsparse vendor_available
We are porting cuttlefish to Android, it currently uses libsparse to
desparse Android filesystems to be used directly as disk images by
crosvm. Making this library available to 'vendor' enables us to support
desparsing downloaded images on-device as well.

Bug: 167675429
Change-Id: I8ae4a916cfb0b2002dd9e462f32e8cb0e533d821
2020-09-03 08:43:46 -07:00
Siarhei Vishniakou 1329696700 Move PropertyMap from libutils to libinput
The input code is the only customer of PropertyMap. For easier
maintenance and eventual removal of it, move it to libinput.

Currently, the caller is responsible for managing the lifecycle of the
returned outMap when calling PropertyMap::load. However, the fact that
the function call allocates new memory is not obvious from the function
signature.

In a separate commit, I will refactor the function to return
Result<unique_ptr<>> to make it less errorprone.
In this commit, only move the files around to make code reviews easier.

Bug: 163171599
Test: atest inputflinger_tests
Change-Id: I316084886c3f09a1776fdb449d2f03d0563b66c1
2020-09-02 20:54:38 -07:00
Treehugger Robot bc2fbe9ce4 Merge "Create directories under /data/local/tests at boot" am: 480335dfd6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1416432

Change-Id: I3136907e6137b8045e884b9cbffbe096951b8010
2020-09-03 03:07:06 +00:00
Treehugger Robot 480335dfd6 Merge "Create directories under /data/local/tests at boot" 2020-09-03 02:26:10 +00:00
Kelvin Zhang 756e361551 Merge "Enable libsnapshot_cow in recovery builds" am: 0b26cbb6b1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1416091

Change-Id: Ia4e0b0c1447336ac2d149ef6273decd9d6d0e790
2020-09-03 00:45:20 +00:00
Kelvin Zhang 0b26cbb6b1 Merge "Enable libsnapshot_cow in recovery builds" 2020-09-03 00:11:43 +00:00
Kelvin Zhang f6219e2d56 Enable libsnapshot_cow in recovery builds
update_engine is enabled in recovery mode, needs to link with
libsnapshot_cow

Test: mm -j
Change-Id: Ia4823c866b16f47cd03dda1779701e957a77aed6
2020-09-02 20:08:46 -04:00
David Anderson 4852a2654a Merge "liblp: fix host lpdump cannot work issue" am: 29e7b2af30
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1320937

Change-Id: Ifc77676b6f750c98557f42707f4ca9a96f05cad7
2020-09-02 17:57:42 +00:00
David Anderson 29e7b2af30 Merge "liblp: fix host lpdump cannot work issue" 2020-09-02 17:36:00 +00:00
Tom Cherry e3632d125e Merge "logcat: fix tests broken from new formatting" am: 6233b23918
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1417788

Change-Id: I0bf786f464867879353f8fe92803bbd385df6062
2020-09-01 23:33:47 +00:00
Christopher Ferris 49349e69af Merge "Do not create a map with start == end." am: 6a06520258
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1416434

Change-Id: Ia70ac678c016070361fcfd8d66a5d3dd6e6b561a
2020-09-01 23:33:27 +00:00
Tom Cherry 6233b23918 Merge "logcat: fix tests broken from new formatting" 2020-09-01 23:23:38 +00:00
Christopher Ferris 6a06520258 Merge "Do not create a map with start == end." 2020-09-01 23:10:55 +00:00
Tom Cherry 500c25cb61 logcat: fix tests broken from new formatting
1) `logcat -g` now contains 'readable', so fix sscanf() appropriately
2) Remove tests that the security buffer isn't returned as an error,
since it's not important to hide this buffer from the logging front
end, and more importantly: the expected failures no longer happen.
3) Update invalid_buffer for the new error format.

Test: logcat-unit-tests
Change-Id: I1a607815bdc7b1135e9a0e97f8b7334f2d259e31
2020-09-01 21:33:34 +00:00
Xin Li 15144fd1ec Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:04:21 +00:00
Christopher Ferris c9b6e084a3 Do not create a map with start == end.
This is not possible in the real world, so prevent this particular case
to avoid leaking memory and any other issues.

Bug: 165619316

Test: Verified the fuzzer test case that caused a leak no longer leaks.
Change-Id: I352b3bd21a4931432e015af89c256ddbcdaa1070
2020-09-01 12:36:26 -07:00
Colin Cross 7201ef820f Create directories under /data/local/tests at boot
Create directories under /data/local/tests at boot for atest to use
to execute tests on the device.

Bug: 138450837
Test: atest binderVendorDoubleLoadTest memunreachable_unit_test memunreachable_binder_test
Change-Id: Ic8e5031ad8701a063be14b6db760feb78f3eb412
2020-09-01 11:17:37 -07:00
Treehugger Robot b1463adad0 Merge changes I3a2191b0,Ide1056b5 am: af13a8b744
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1409690

Change-Id: I5be6adf25166b6597de3b792f4da7212acd3d009
2020-09-01 00:09:29 +00:00
Treehugger Robot af13a8b744 Merge changes I3a2191b0,Ide1056b5
* changes:
  libfastboot uses usb_linux.cpp for all Linux targets
  Don't enable version lib for libadb_sysdeps
2020-08-31 23:39:45 +00:00
Xin Li 0a112d52f8 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id18cb0e2d2f3e776a42b566c4a1af2e250890896
Change-Id: Iba7cab32ab3aa6f47952c840ff6dc8492e8d0704
2020-08-29 01:42:13 -07:00
Christopher Ferris ebd6a0f309 Merge "libunwindstack: expose static version of BuildFrameFromPcOnly." am: f60d4f9a04
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1406430

Change-Id: Id19b278cc7cccfe8f2550f53a38062426474f752
2020-08-29 00:49:31 +00:00
Christopher Ferris f60d4f9a04 Merge "libunwindstack: expose static version of BuildFrameFromPcOnly." 2020-08-29 00:38:03 +00:00
Josh Gao 0d0f32369f libunwindstack: expose static version of BuildFrameFromPcOnly.
Bug: http://b/165206592
Test: unit tests and treehugger
Change-Id: Ic357ee6160281c5986570de5536b3247b231bc6f
2020-08-28 15:36:54 -07:00
Christopher Ferris fbdb98b2b7 Merge "Fix bugs in BuildFrameFromPcOnly." am: 86f19217fb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1413714

Change-Id: I808f0f38874075cdc6f3272ad013b22116cc1472
2020-08-28 18:09:33 +00:00
Christopher Ferris 86f19217fb Merge "Fix bugs in BuildFrameFromPcOnly." 2020-08-28 17:37:08 +00:00
Victor Chang f1d18ccc8e Add a new public library libicu.so
Bug: 160350521
Test: atest CtsJniTestCases
Change-Id: I9693dc225d2ccbdd55b5e609250534e541aaeb75
2020-08-28 15:17:08 +01:00
Jiyong Park fd890289e2 libfastboot uses usb_linux.cpp for all Linux targets
The build system has added the new target named 'linux_cross' which is
the cross-compiled (i.e. arm on x86) host target. libfastboot is now
configured to use usb_linux.cpp not only for linux_glibc (which is the
native host target using glibc), but for all Linux-based host targets
including linux_glibc, linux_bionic, and the new linux_cross.

Note that the device target 'android' is also included in the 'linux'
target. But that doesn't cause a problem because libfastboot is a host
library which is not enabled for the device target.

Bug: 159685774
Test: HOST_CROSS_OS=linux_cross m
out/soong/host/linux_cross-arm64/bin/fastboot

Change-Id: I3a2191b0878a26914cb0282ecf41a45296827c04
2020-08-28 13:30:35 +09:00
Jiyong Park 4c57596b81 Don't enable version lib for libadb_sysdeps
When use_version_lib is set to true, but build::GetBuildNumber() isn't
used, the library can't be processed by symbol_inject. For example,

$ m out/soong/.intermediates/system/core/adb/libadb_sysdeps/android/arm64_armv8-a_shared/versioned/libadb_sysdeps.so

FAILED:
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/versioned/libadb_sysdeps.so
out/soong/host/linux-x86/bin/symbol_inject -i
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/unstripped/libadb_sysdeps.so
-o
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/versioned/libadb_sysdeps.so
-s soong_build_number -from 'SOONG BUILD NUMBER PLACEHOLDER' -v $(cat
out/soong/build_number.txt)
symbol not found
17:09:10 ninja failed with: exit status 1

This is because the visibility of the symbol `soong_build_number` in
libbuildversion.a is hidden via the -fvisibility=hidden flag for the
library. In addition, -Wl,--gc-sections strips the hidden symbol when
it is not referenced.

This fortunately hasn't caused a problem because, for the device target,
the output of symbol_inject was used only for dist outputs.
libadb_sysdeps wasn't registered as dists. So
versioned/libadb_sysprops.so never had a chance to be built. For the
host target, in the other hand, the output of symbol_inject is used
always, but --gc-sections is not used for host targets. So the symbol
wasn't stripped and therefore symbol_inject could always find the
symbol.

This however is expected to cause a problem when the support for
LinuxCross is added. It is one of the host targets, therefore
symbol_inject is always used. However, unlike other host targets,
--gc-sections is turned on because it inherits most of the flags from
Android/ARM64.

To avoid the problem, we might want to disable --gc-sections for the
target. But regardless of the decision, having a build rule that always
fails is not desirable - even though the build rule is essentially never
triggered. Therefore, we choose to not use version lib for
libadb_sysdeps because GetBuildNumber() is not used in the lib.

Bug: 159685774
Test: m \
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android/\
arm64_armv8-a_shared/versioned/libadb_sysdeps.so

Change-Id: Ide1056b5b55e409ab809e302a697d10d759c92ce
2020-08-28 13:30:34 +09:00
Christopher Ferris 06996a8196 Fix bugs in BuildFrameFromPcOnly.
There are a few bugs in this routine, so fix them and add unit tests
to cover the cases.

Test: Unit tests pass.
Change-Id: I9bcb9b9fbe33d56a17a613ae3aa88036bd1d0ef1
2020-08-27 19:52:54 -07:00
Christopher Ferris 1300d1cfe9 Merge "Fix nullptr dereference." am: bb81b77895
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1413809

Change-Id: Idd6943263d1e6a8db79eda0823409397485045cd
2020-08-27 21:52:25 +00:00
Christopher Ferris bb81b77895 Merge "Fix nullptr dereference." 2020-08-27 20:58:09 +00:00
Christopher Ferris afbed690f0 Fix nullptr dereference.
A previous cl missed adding a return in the new path which could result
in a crash if the map info is null. Add the return back.

Added a new test to catch this case.

Bug: 166188440

Test: Unit tests pass. Verified the new test crashes on the old code.
Change-Id: I9420b47dae0f880493c0e6a60d97bb3468ff2906
2020-08-27 12:00:43 -07:00
Treehugger Robot a0ddddb69c Merge "libsnapshot: Fix uninitialized variables" am: e27781db4c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1413807

Change-Id: I8d3ad7365a54576d9286c15e69fb930d39c1d48e
2020-08-27 18:51:18 +00:00