Commit graph

56753 commits

Author SHA1 Message Date
Jaegeuk Kim
b9be427848 run ext4 tools in first_stage_ramdisk
Bug: 149039306
Change-Id: I646960baa3c0d5a0dedda82b1fdc3816321aaa2e
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-03-11 09:33:51 -07:00
Jiyong Park
f1e27502e4 Merge "don't include liblog to APEXes" 2020-03-11 09:20:24 +00:00
Jiyong Park
95b6f45b0e don't include liblog to APEXes
liblog is a platform library that provides stable C API. There is no
need to include the library, especialy by statically linking to it, in
any APEX. It not only wastes the storage/ram, but also is incorrect
because the socket interface to logd which is implemented in liblog is
not guaranteed to be stable.

Fixing this issue by converting static_libs: ["liblog"] into
shared_libs: ["liblog"], in which case the dependency to the library
is satisfied via the stub variant of the library.

As a result, we could restrict the availablity of the library to
the platform and the runtime APEX.

Exempt-From-Owner-Approval: already approved when this was in internal
master (ag/10572699)

Bug: http://b/151051671
Bug: http://b/150827719
Test: m
Change-Id: I5aab863cb12b8767b6979255c247000a59355b0e
2020-03-11 09:20:08 +00:00
Jiyong Park
ac72606f98 Merge changes from topic "liblog"
* changes:
  Whole static link libasync_safe to libbacktrace.a
  libbase uses liblog symbols via dlsym when it is built for APEX
2020-03-11 07:55:40 +00:00
Jiyong Park
cc26bbd232 Whole static link libasync_safe to libbacktrace.a
When libbacktrace.a is statically lined to somewhere, that library had
to add libasync_safe.a to static_libs because libbacktrace.a has
references to libasync_safe.a. But libbacktace depending on
libasync_safe is an implementation detail of libbacktrace, and therefore
its client shouldn't be affected by it.

Fixing this by doing the whole static link to libasync_safe to
libbacktrace.a so that the former is included in libbacktrace.a

Exempt-From-Owner-Approval: cherry-pick rvc-dev

Bug: 149569129
Test: m
Merged-In: If7366a240bc945dda9944fe7c111e10d328165bb
(cherry picked from commit 7c8e2b247d)
Change-Id: If7366a240bc945dda9944fe7c111e10d328165bb
2020-03-11 07:55:23 +00:00
Jiyong Park
2c608b32db libbase uses liblog symbols via dlsym when it is built for APEX
libbase is a popular library that is used by many APEXes either directly
or transitively. It is being used by several Mainline modules that were
launched with Q, in which case everything in the APEX - including
libbase - shouldn't use new APIs that are added post Q, i.e. R.

libbase however is using a few new R symbols from liblog, and this is
preventing those Q-launching Mainline modules that are built in R source
tree from being installed to Q devices.

Fortunately, the dependencies to the new R symbols are guarded with a
flag; when the existence of the symbols are not guaranteed, it uses
dlsym. This change fixes the aforementioned problem by turning on the
flag also when libbase is built for an APEX.

Exempt-From-Owner-Approval: cherry-pick rvc-dev

Bug: 149569129
Test: TARGET_BUILD_APPS=com.android.media
vendor/google/build/build_mainline_modules.sh
adb install --staged out/dist/mainline_modules_arm64/com.android.media.apex
adb reboot
The APEX is installed and mediaextractor process doesn't crash

Merged-In: I44b5ec028850613cb45fc3e792f43cd8e87cfd00
(cherry picked from commit 5280b5c03e)
Change-Id: I44b5ec028850613cb45fc3e792f43cd8e87cfd00
2020-03-11 07:53:23 +00:00
Tianjie Xu
73ae00bbde Merge "Create an interface for the cd entry hash table" 2020-03-10 23:51:18 +00:00
Josh Gao
a964a96ae7 Merge "base: tag unique_fd::reset as reinitializing for clang-tidy." 2020-03-10 22:32:41 +00:00
Tom Cherry
eb20ff0be0 Merge changes Ib8a4835c,I2e11b782
* changes:
  Revert "init: handle property service callbacks asynchronously"
  Revert "Stop & Resume property service when switching to bootstrap namespace"
2020-03-10 20:44:55 +00:00
Tom Cherry
832f9f1dbd Revert "init: handle property service callbacks asynchronously"
This is apparently causing problems with reboot.

This reverts commit 7205c62933.

Bug: 150863651
Test: build
Change-Id: Ib8a4835cdc8358a54c7acdebc5c95038963a0419
2020-03-10 11:53:11 -07:00
Tianjie Xu
28f8eaeffb Create an interface for the cd entry hash table
The current implementation of the hashtable uses less memory than
a std::map. As most of the zip files we encountered don't use the zip64
extension, we should keep the current implementation. And the interface
adds the flexibility for us to switch to std::map for zip64 format.

Bug: 150900468
Test: unit tests pass
Change-Id: Ifd008785c9ff416a27049f9e0c54d9eef985bd85
2020-03-10 11:51:53 -07:00
Tom Cherry
459ca0be74 Revert "Stop & Resume property service when switching to bootstrap namespace"
Dependent change was reverted.

This reverts commit 352ae2d225.

Bug: 150863651
Test: build
Change-Id: I2e11b782fcd2b7baded133a841fdcf519f702b84
2020-03-10 11:48:24 -07:00
Tianjie Xu
0ac447ab95 Merge "adbd: make libadbd_services cc_library again." 2020-03-10 18:43:30 +00:00
Yifan Hong
86008cccb3 Merge changes from topic "no_snapshot_callstack"
* changes:
  Revert "libsnapshot::RemoveAllUpdateState log stack"
  Revert "libsnapshot callstack files readable by dumpstate"
  libsnapshot: delete InitiateMergeAndWait.
2020-03-10 17:08:54 +00:00
Tom Cherry
cc032194b3 Merge "liblog: add API level guard to NDK log.h header" 2020-03-10 16:00:44 +00:00
Tom Cherry
59e93a55fc liblog: add API level guard to NDK log.h header
Bug: 119867234
Test: build
Change-Id: I6fdd7c070af06f04314b9bf7bbfede2a106e0d7c
2020-03-10 08:50:46 -07:00
Howard Chen
14326821f0 Merge "Convert gsid to use the dynamic AIDL service infrastructure" 2020-03-10 09:49:01 +00:00
Treehugger Robot
2401f5f2cc Merge "Set apex_available property" 2020-03-10 07:30:36 +00:00
Treehugger Robot
ecfdda2c14 Merge "Convert vts configs to Android.bp" 2020-03-10 05:00:33 +00:00
Josh Gao
2263bcb4d0 Merge "adb: defer acknowledgement of pushed files until the end." 2020-03-10 01:55:51 +00:00
Chih-hung Hsieh
262b58cd07 Merge "Fix bugprone-string-integer-assignment warnings" 2020-03-10 00:07:58 +00:00
David Anderson
66147bad94 Merge "libdm: Fix WaitForFile early-returning on failed accesses." 2020-03-10 00:06:09 +00:00
Yifan Hong
78671597ca Revert "libsnapshot::RemoveAllUpdateState log stack"
Revert submission snapshotctl_callstack

Reason for revert: Callstack should not be logged
Reverted Changes:
Ib80c74a9a:Temporarily add libutilscallstack dependency
I2dfb6b7f1:libsnapshot::RemoveAllUpdateState log stack

Test: none
Bug: 148818798

Change-Id: I34683e93f10971629737f6fe648b25c6066c702f
2020-03-09 16:14:30 -07:00
Yifan Hong
4a64da427e Revert "libsnapshot callstack files readable by dumpstate"
This reverts commit faa49d1d00.

Reason for revert: Callstack should not be logged.

Test: none
Bug: 148818798

Change-Id: Ie5506ae0c7408e255a464b2f403d0a47d272229e
2020-03-09 16:14:30 -07:00
Yifan Hong
7a0fb3562f libsnapshot: delete InitiateMergeAndWait.
Now that update_engine is responsible for initiating the
merge, InitiateMergeAndWait function becomes useless.

Bug: 147696014
Test: libsnapshot_test
Change-Id: I5473dc543ca8ac2fd31f597720847b02d0e5e33d
2020-03-09 16:14:30 -07:00
Treehugger Robot
b34449d5fe Merge "Remove mips build." 2020-03-09 23:10:04 +00:00
Yifan Hong
d8f7b26ed2 Merge "init: restorecon libsnapshot rollback indicator" 2020-03-09 23:09:05 +00:00
Tom Cherry
ce71d36d13 Merge "liblog: minimum_log_priority should be atomic" 2020-03-09 23:06:12 +00:00
Josh Gao
7f8a37c8c7 adbd: make libadbd_services cc_library again.
For currently unknown reasons, sideloading is broken with
libadbd_services as a cc_library_static.

Partial revert of commit a9b62d5452.

Bug: http://b/151056300
Test: xunchang@ tested manually
Change-Id: Iaffad9c476ba0adcffc5db512ba4a7ee0fb5cb22
2020-03-09 15:20:55 -07:00
Chih-Hung Hsieh
5d13645bfe Fix bugprone-string-integer-assignment warnings
* mdns.cpp:153:20: warning: an integer is interpreted as a character code
  when assigning it to a string; if this is intended, cast the integer to
  the appropriate character type; if you want a string representation, use
  the appropriate conversion facility [bugprone-string-integer-assignment]

Test: WITH_TIDY=1 make
Change-Id: Id9a790ac31722c6ee8886703939977b913ce95fe
2020-03-09 15:05:54 -07:00
Treehugger Robot
c6e64b3e1d Merge ""track-app" service showing debuggable/profileable apps" 2020-03-09 21:21:38 +00:00
Tom Cherry
bbb16022c7 liblog: minimum_log_priority should be atomic
In case multiple threads try to reference this variable while it is
being set, it should be atomic so that all threads always see a valid
value.

Bug: 150898477
Test: liblog, libbase unit tests
Change-Id: If6c9e291f2471b96a752dc6e76e3e63458b71391
2020-03-09 12:43:18 -07:00
Josh Gao
e43893e95c base: tag unique_fd::reset as reinitializing for clang-tidy.
Appease clang-tidy by marking reset() as a method that reinitializes
after moving out of a unique_fd.

Unfortunately, there isn't an attribute that let us mark the type as
being safe to use after move in general, which means that moving out of
a unique_fd and then calling get() on it will still be frowned upon.

clang-tidy has a hard-coded list of standard container types that
are safe to use after move, but doesn't provide a way to mark custom
types as satisfying this condition.

Bug: http://b/150959261
Test: reverted the change to unique_fd.h and the test failed
Change-Id: Ide73d7caa4cd2b192018f111059d696dca4de987
2020-03-09 12:32:56 -07:00
Jeffrey Huang
3a4e3825f4 Merge "Add new directory for stats metadata" 2020-03-09 18:09:21 +00:00
Treehugger Robot
9da07506de Merge "adb: improve logging of key loading slightly." 2020-03-09 18:00:25 +00:00
Jiyong Park
8bf9b1632e Set apex_available property
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.

In this change, following libs were made available to all apexes because
their usage is quite common and there is no reason to restrict them
to some APEXes.

* libbase_headers
* libcutils, libcutils_headers
* libutils_headers, libsystem_headers
* liblog_headers
* libbacktrace, libbacktrace_headers
* libcrypto_utils

Bug: 150999716
Test: m
Change-Id: If3d3652e6604ed4f6d7694fe7ac61ae496621026
2020-03-09 16:38:02 +09:00
Dan Willemsen
a8f188f011 Convert vts configs to Android.bp
Test: treehugger
Change-Id: Ibe8ed03555ac78ee38be6511eb4169cddfcd3555
2020-03-07 21:21:33 -08:00
Elliott Hughes
401c78780f adb: improve logging of key loading slightly.
In particular, always include the file name in the log.

Bug: http://b/144462309
Test: adb kill-server && adb devices -l && cat /tmp/adb.*.log
Change-Id: I66b5e063b00381f9dfa9ace222cad3e415e4f43b
2020-03-07 12:52:36 -08:00
Yifan Hong
d91998f1c4 init: restorecon libsnapshot rollback indicator
The rollback indicator is created during first stage init and
is unlabeled. Need to restorecon it properly so that it can
be properly deleted by update_engine later.

Bug: 149956852
Bug: 150907679
Test: apply OTA, reboot, look at serial console
Change-Id: Ie954023b557865691fec2ae378145596bf1973a9
2020-03-06 22:50:08 -08:00
Elliott Hughes
49e6ee928f Remove mips build.
For now this leaves the ability to cross-unwind a mips process, but we
should probably clean that up too. We need to remove the build remnants so
that we can clean up the build system itself (otherwise it sees us talking
about an architecture it doesn't know about, and assumes that something's
wrong).

Test: treehugger
Change-Id: I2862c630cec95dbdd474e34c3568d0e1a6d44b16
2020-03-06 22:02:09 -08:00
Treehugger Robot
cc642ec725 Merge "Move GetMountedEntryForUserdata to fs_mgr.h" 2020-03-07 05:14:38 +00:00
Ian Kasprzak
897444209c Merge "Revert "Fixed a typo in the version name"" 2020-03-06 21:57:57 +00:00
Shukang Zhou
f4ffae1055 "track-app" service showing debuggable/profileable apps
Add a "track-app" service in adbd. For every debuggable or
profileable-from-shell process, ART sends related info to
adbd and adbd surfaces the info through the "track-app"
service.

The output format of "track-app" is a line summarizing
the number of reported processes, followed by a protobuf
message in human readable form. For example,

Process count: 2
process {
  pid: 3307
  profileable: true
  architecture: "arm64"
}
process {
  pid: 3341
  debuggable: true
  profileable: true
  architecture: "arm64"
}

Bug: 149050485
Test: manually unplugged/replugged, "adb track-app",
      "adb track-jdwp"
Change-Id: Id1f1a920e1afc148c7e4d2add790baab796178e1
2020-03-06 13:56:27 -08:00
Nikita Ioffe
30b0c01dd8 Move GetMountedEntryForUserdata to fs_mgr.h
Logic of unwinding dm-device stack to figure out what entry was used to
mount userdata turned out to be a little bit more involved, and it
shouldn't be part of libfstab

This CL just moves code around and cleans API a little bit, actual fix
will be in the follow-up CL.

Test: atest CtsFsMgrTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 148612148
Change-Id: If0f8a765dba63adb0e6a711eb81fffdcabea3480
Merged-In: If0f8a765dba63adb0e6a711eb81fffdcabea3480
(cherry picked from commit 8f50cfc28d)
2020-03-06 19:50:10 +00:00
Ian Kasprzak
e6e87fd705 Revert "Fixed a typo in the version name"
This reverts commit eb94c7802d.

Reason for revert: b/150949964 - Broke boot test on aosp-master-with-phones.

Merged-In tags to revert just aosp-master/stage-aosp-master where boot
is broken.

Change-Id: Ic76e36b42060b5948f48af41f67544598d6f9f87
Merged-In: I0e1e7da1cfbe320ba6605f8de9dcdb5091c41e4f
Merged-In: Icff3bd68b31f8c1d5a71f05c7c52eae6e896bfc2
2020-03-06 19:38:13 +00:00
Elliott Hughes
151e74894f Merge "debuggerd: add an opt-out for OEMs that would rather collect core dumps." 2020-03-06 17:17:51 +00:00
Josh Gao
64ff82ba68 adb: defer acknowledgement of pushed files until the end.
Previously, we were waiting for the other end to respond after every
file sent, which results in massive slowdown when there's any amount of
latency on the transport.

This improves performance on a cuttlefish instance with ~7ms RTT from:

    system/: 2037 files pushed, 0 skipped. 2.8 MB/s (762803979 bytes in 262.964s)

to:

    system/: 2037 files pushed, 0 skipped. 11.9 MB/s (762803979 bytes in 61.278s)

Bug: https://issuetracker.google.com/150827486
Test: ./test_device.py
Change-Id: I3a0c893faa5d455cc6ccbc86915a17e1b5abbfbe
2020-03-05 19:48:11 -08:00
Jiyong Park
fd4e66221a Merge "Fixed a typo in the version name" 2020-03-06 00:53:07 +00:00
Elliott Hughes
14dc6ad240 Merge "run-as: improve error messages." 2020-03-05 23:51:57 +00:00
Treehugger Robot
561df7bfb3 Merge "liblog: Fix bugprone-macro-parentheses warnings" 2020-03-05 22:44:04 +00:00