Commit graph

42637 commits

Author SHA1 Message Date
Treehugger Robot
6544056d54 Merge "Support 'adb reboot fastboot' command conditionally." 2018-09-25 17:17:08 +00:00
Treehugger Robot
00781649fb Merge "liblp: test: fix liblp.UpdateAnyMetadataSlot" 2018-09-25 17:05:19 +00:00
Hridya Valsaraju
542582689d Support 'adb reboot fastboot' command conditionally.
Devices not supporting logical partitions do not require the command.

Bug: 78793464
Test: 'adb reboot fastboot' reboots to bootloader for a device
not supporting logical partitions.

Change-Id: I0a7b6d4335040e24efbf461e2dd2d56ab1985b7f
2018-09-25 03:52:12 +00:00
Tom Cherry
c30240f475 Merge "fastboot: clean up CheckRequirements" 2018-09-25 00:29:38 +00:00
Stephen Hines
9b92f57a0a Merge "Fix two clang-tidy issues in crasher.cpp." 2018-09-24 22:25:59 +00:00
Stephen Hines
8395de6927 Fix two clang-tidy issues in crasher.cpp.
TEMP_FAILURE_RETRY's result was unused for the call to read(), so now
mark it as such to silence a possible unused result warning. For
__read_chk(), this function is an internal implementation detail of
FORTIFY in Bionic. Under clang-tidy, FORTIFY checks are actually
removed, so this now results in an unknown function being called. The
code should not be explicitly depending on an implementation detail, but
we can just suppress the failing case to retain test coverage of the
actual implementation.

Bug: http://b/110779387
Test: Build using WITH_TIDY=1
Change-Id: If83ac1d6f3b6dc32c0d0fb56d8e675e53b586f78
2018-09-24 13:18:22 -07:00
Tom Cherry
ad13cf96f0 Merge "Use vector<char> instead of char* and malloc() for images" 2018-09-24 20:08:32 +00:00
Mark Salyzyn
20ff1b2033 liblp: test: fix liblp.UpdateAnyMetadataSlot
Move test to verify we can't read unwritten metadata from
liblp.UpdateAnyMetadataSlot to liblp.CreateFakeDisk.

Test: gTest liblpg_test
Bug: 109821005
Change-Id: I4714c949e2b2d9de6444996a2af2992a821c4a85
2018-09-24 10:20:57 -07:00
Treehugger Robot
f86e85cb0a Merge "init: Cleanly exit subcontext processes upon init's death" 2018-09-22 00:12:09 +00:00
Mark Salyzyn
6aaff2fe7d Merge "fs_mgr: overlayfs: const to kNames" 2018-09-21 22:59:19 +00:00
Mark Salyzyn
0006b4de0c Merge "fs_mgr: liblp: add additional debugging details" 2018-09-21 22:58:34 +00:00
Treehugger Robot
a988b4d9ed Merge "fs_mgr: Support checkpoints" 2018-09-21 20:43:48 +00:00
Tom Cherry
692c9973e1 Merge "liblog#__android_log_btwrite__android_logger_list_read fail" 2018-09-21 20:34:15 +00:00
Mark Salyzyn
e5ecbb5e50 fs_mgr: overlayfs: const to kNames
Test: compile
Bug: 109821005
Change-Id: I792dc74a7646f4512af201b1451b9f078cea32bf
2018-09-21 13:26:40 -07:00
Mark Salyzyn
a2af0dec14 fs_mgr: liblp: add additional debugging details
Test: none
Bug: 109821005
Change-Id: I759e76f793e8dd6f26f649dc727e80c9955e764f
2018-09-21 13:26:37 -07:00
Tom Cherry
4aa60b382c fastboot: clean up CheckRequirements
CheckRequirements() had various issues that are cleaned up here,

1) Move from C string parsing to C++
2) Moved from C data structures to C++, including fixing memory leaks.
3) Removed the 'cur_product' global and the 'query_save' function that
   stores it
4) Actually writing tests for the parsing function for
android-info.txt
5) Check that a variable needs to be checked for a given product before
   trying to read it.  Previously, fastboot would fail if a variable
   isn't recognized on a device, even if the check should be ignored.

A lot of flexibility is allowed for the input strings, to keep
backwards compatibility with the previous parsers.

Test: fastboot works, unit tests

Change-Id: Idc3bba8b8fe829d8eefe5f6c495e63a9441c0b60
2018-09-21 12:50:39 -07:00
Luis Hector Chavez
7235359d2e init: Cleanly exit subcontext processes upon init's death
This change makes the subcontext processes cleanly exit in the event of
the init's socket being closed. If that was an accident, init will
respawn the process immediately. Otherwise, it will just quietly go
away.

Bug: 80425914
Test: kill -9 $INIT_PID  # Outside of an Android container
Change-Id: I664f11d1b3700ea46857abf24857335fe28e92fa
2018-09-21 12:29:52 -07:00
Daniel Rosenberg
4c93b256f6 fs_mgr: Support checkpoints
Adds support for partitions with checkpointing enabled. If the
checkpoint= fs_mgr flag is set, and the system has checkpointing on,
the partition will be mounted in checkpointing mode.

Test: Use vdc checkpoint commands, the checkpoint=fs fs_mgr flag
      in the fstab, and a kernel containing the f2fs checkpoint
      changes. https://lkml.org/lkml/2018/8/21/22
Change-Id: I3ea8da932de06fcfd2eed06b8640a8b1df837f1f
2018-09-20 17:28:23 -07:00
Tom Cherry
dfd85df11a Use vector<char> instead of char* and malloc() for images
And fix the associated memory leaks in the process.

Test: fastboot works
Change-Id: I6e41f351ca6cebf79282d30b1eca1506496e0c21
2018-09-20 16:48:36 -07:00
Josh Gao
3da42a6c05 Merge "libziparchive: encode type in fdsan owner tag." 2018-09-20 19:22:03 +00:00
Treehugger Robot
50947c1b29 Merge "Reduce libziparchive internal hashtable memory size" 2018-09-20 06:45:33 +00:00
Christopher Ferris
b649d39bd7 Merge "Fix implicit fall through switch cases." 2018-09-20 00:21:30 +00:00
Treehugger Robot
903eb5125e Merge "init: annotate intended fallthrough" 2018-09-20 00:07:24 +00:00
Tom Cherry
ae8a6b9af3 init: annotate intended fallthrough
Bug: 116020901
Test: treehugger
Change-Id: I5f4a5ebf09572501f564dce506ee0978354fde67
2018-09-19 14:34:51 -07:00
Christopher Ferris
3f9582f432 Fix implicit fall through switch cases.
Bug: 116020901

Test: Builds with -Werror=implicit-fallthrough.
Change-Id: I401f37585dae6cbf8995389a8a189abc2e102987
2018-09-19 14:12:59 -07:00
Treehugger Robot
2d4b48d155 Merge "crash_dump: annotate intended fallthrough." 2018-09-19 20:50:31 +00:00
Anton Hansson
cf7d0e85d4 Merge "Add product_services support to ld.config.vndk_lite" 2018-09-19 20:37:07 +00:00
Anton Hansson
70b3fdce20 Merge "Update ld config to use build-time determined paths." 2018-09-19 20:36:45 +00:00
Zimuzo
5a503efaf0 Reduce libziparchive internal hashtable memory size
Debugging memory allocations on the nexus launcher unveiled significant memory allocations for the hashatable used in libziparchive, ~1MB.
This is partly because of the ZipString struct storing an entry in the table. The struct stored a pointer to a string (on 64 bit, 8 bytes) and the length to read from that pointer, 2 bytes. Because of alignment, the structure consumed 16 bytes, wasting 6 bytes.
Now, we store entries in the hashtable as a ZipStringOffset. This new structure stores a 4 byte offset from a fixed location in the memory mapped file instead of the entire address, consuming 8 bytes with alignment.

Bug: 79416399
Test: Builds successfully and manual testing by opening launcher on Pixel 2 shows precisely 50% decrease in memory allocated for the hashtable. From 909312 bytes to 454656.
Change-Id: I28b43699233fbee7f63fccae2d4fe96fcc07e5c4
2018-09-19 19:20:21 +01:00
Anton Hansson
ece0a74691 Add product_services support to ld.config.vndk_lite
We're moving apps and their libs to product_services for older
devices too, so mimic the rules in the default ld.config related
to product_services.

Also fix a one-off disparity between /product and /product_services
in ld.config.txt.

Bug: 114804489
Test: m out/target/product/marlin/system/etc/ld.config.vndk_lite
Change-Id: I166275c035c85b4d69cff8e9d51af3d6d0ff4857
2018-09-19 02:53:33 +01:00
Anton Hansson
0244428c8e Update ld config to use build-time determined paths.
A few places had /product and /product_services hardcoded. Update
them to use values that get set at build time.

Bug: 114804489
Test: m out/target/product/marlin/system/etc/ld.config.vndk_lite.txt
Change-Id: Ie48dbb2453ae941c1b5ee57f092d12a5497d878f
2018-09-19 00:47:12 +01:00
Treehugger Robot
d800caf345 Merge "fastboot: Add vbmeta_mainline to the partition list." 2018-09-18 21:03:15 +00:00
Tom Cherry
f273b21232 Merge "init: move selinux and seccomp set up to 2nd stage init." 2018-09-18 20:48:38 +00:00
Josh Gao
8d44b14543 crash_dump: annotate intended fallthrough.
Bug: http://b/116020901
Test: treehugger
Change-Id: I5d059d051fb257efe7f7e1790fd0bc2abd364167
2018-09-18 13:22:22 -07:00
Tom Cherry
d9e53dacf5 init: move selinux and seccomp set up to 2nd stage init.
If there is no valid pre-compiled SEPolicy policy, init may call
secilc, which exists on the system partition.  1st stage init won't
always live on this partition, so we need to move this SELinux setup
to 2nd stage init, which always lives on the system partition, to
ensure that both secilc and its caller are updated together.

Bug: 114059212
Test: hikey boots, sailfish boots
Change-Id: Iaf7b4af4a5c2ace16755ec2e54510ab95c53f041
2018-09-18 11:24:56 -07:00
Treehugger Robot
146fd24c4b Merge "Fix clang-tidy performance warnings in system/core." 2018-09-18 17:32:20 +00:00
Steven Moreland
a285a8416c Merge "Add libbinder_ndk to public.libraries.*" 2018-09-18 15:19:44 +00:00
David Anderson
1109c92bea fastboot: Add vbmeta_mainline to the partition list.
Bug: 115939310
Test: fastboot flash vbmeta_mainline works
      fastboot flashall includes vbmeta_mainline

Change-Id: I081660cd8437ac66cab750b270f5019230050285
2018-09-17 17:34:22 -07:00
Josh Gao
11c7f43b90 Merge "tombstoned: don't generate tombstones for native backtraces." 2018-09-17 23:57:06 +00:00
Treehugger Robot
e329879dbf Merge "Don't attempt to create 'mkdir' and '-p' directories." 2018-09-17 23:11:28 +00:00
Chih-Hung Hsieh
42bf30651b Fix clang-tidy performance warnings in system/core.
* Use more efficient overloaded string methods.

Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: I449347565f83fae14ea337d0b3173beb5a56e0ca
2018-09-17 15:18:57 -07:00
Xin Li
17216455ad Don't attempt to create 'mkdir' and '-p' directories.
Test: build
Bug: 115920063
Change-Id: I65c60bfe0ca758a4213f10754bc872ea9885ca19
2018-09-17 14:20:16 -07:00
Steven Moreland
dd8eee871b Add libbinder_ndk to public.libraries.*
Bug: 111445392
Test: atest android.binder.cts.NdkBinderTest
Change-Id: I8ccb1f74654dcb925cd3ac20042cbffd2f594bb9
Merged-In: I8ccb1f74654dcb925cd3ac20042cbffd2f594bb9
2018-09-17 20:05:27 +00:00
Chih-hung Hsieh
16fef65f9e Merge "Suppress implicit-fallthrough warnings." 2018-09-17 17:36:09 +00:00
Chih-Hung Hsieh
502f4864d6 Suppress implicit-fallthrough warnings.
Add FALLTHROUGH_INTENDED for clang compiler.

Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I40f8bbf94e207c9dd90921e9b762ba51abab5777
2018-09-17 16:50:11 +00:00
Treehugger Robot
c2501fda60 Merge "adbd: fix remount on non-system-as-root devices." 2018-09-14 23:24:44 +00:00
Peter Collingbourne
9cd2a8c2b5 Merge "libadbd_services: Link libselinux dynamically instead of statically." 2018-09-14 22:45:55 +00:00
Josh Gao
96d445d846 adbd: fix remount on non-system-as-root devices.
The system image is now a root image, even on devices that don't use
system-as-root. Fix remount to always remount /, to account for this.

Bug: http://b/115751838
Test: `adb remount; adb shell mount | grep " / "`
Change-Id: I2d89a795bd0bc53af33fe69c9d049bbb64d26f3b
2018-09-14 14:32:27 -07:00
Treehugger Robot
8485d59790 Merge "Add OWNERS for libprocessgroup" 2018-09-14 21:08:32 +00:00
Josh Gao
2b22ae132f tombstoned: don't generate tombstones for native backtraces.
Previously, if an intercept ends before we ask for a file descriptor
when doing a backtrace, we'll create a tombstone file instead.

Bug: http://b/114139908
Bug: http://b/115349586
Test: debuggerd_test32
Change-Id: I23c7bb8ae5a982a4374a862d0a4f17bee03eb1d9
2018-09-14 14:06:47 -07:00