Commit graph

43691 commits

Author SHA1 Message Date
Josh Gao
e26154167c adb: switch daemon_service_to_fd to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: I298517b688650c9d94bf837284e0264ca0ac6702
2018-12-21 11:52:56 -08:00
Josh Gao
5021cfc135 adb: switch usb_linux helper to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: Iccbeb61905852b72fceec1bca498895b38a2e7d4
2018-12-21 01:43:34 -08:00
Josh Gao
0f29cbc750 adb: switch unix_open to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: Ieecc9b1b7f2111f4da45d4bbd1b7703535fe7d4d
2018-12-21 01:43:31 -08:00
Treehugger Robot
db2ffaa0f0 Merge "Minor refactor to support strings with embedded zeros." 2018-12-21 00:59:48 +00:00
Treehugger Robot
b0b0f62ced Merge "Remove unnecessary warning suppression from libdm." 2018-12-20 23:15:16 +00:00
Treehugger Robot
713398f8bf Merge "Add librank2" 2018-12-20 21:58:49 +00:00
Alex Buynytskyy
a9e79489dc Minor refactor to support strings with embedded zeros.
Test: manual
Change-Id: Iaece3003deb257cbcae65a23a4c4a1ccfd690d49
2018-12-20 10:11:15 -08:00
Tom Cherry
b5a5c31093 Merge "improve LogBufferElement copy constructor" 2018-12-20 18:03:59 +00:00
Sandeep Patil
e9f8eb46e3 Remove unnecessary warning suppression from libdm.
Fixes: 110035986
Test:  mma -j builds without errors or warnings

Change-Id: Id00f844ad75c3ee2ebb9f47eebc7976bc40bdf59
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-20 09:31:05 -08:00
Treehugger Robot
d1ff11b94a Merge "Create staging directory for Staging Manager." 2018-12-20 17:10:25 +00:00
Sandeep Patil
2aeaaebc49 Add librank2
Identical with librank, but written using libmeminfo.

Bug: 114325007
Bug: 111694435
Test: librank2
Test: librank2 -m rx
Test: librank2 -m rx -P /system/lib64
Test: librank2 -u -P /system/lib
Test: librank2 -R -m rx

Change-Id: Ib6ecb601a0b6ecb5b4b75285f772586e05ae388a
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-20 09:01:40 -08:00
Dario Freni
22cdf96697 Create staging directory for Staging Manager.
Staging Manager is a high-level service (yet to be committed) that
manages multi-package sessions requiring a reboot to be applied, for
example if one of the packages is an APEX file. This directory will
contain the session data and the temporary copies of the packages.

Bug: 118865310
Test: N/A
Change-Id: I8aceefab849cf5af17086cb6868b801d1c2615e9
2018-12-20 15:24:18 +00:00
Martin Stjernholm
8478e56580 Merge "Revert^2 "Use libdexfile external API in libunwindstack."" 2018-12-20 11:34:26 +00:00
Elliott Hughes
ef4c29886c Merge "Build libbase with _FILE_OFFSET_BITS=64." 2018-12-20 00:47:38 +00:00
Yifan Hong
3fff9fbe00 Merge changes from topic "vintf_object_recovery_mount"
* changes:
  Move parts of roots.cpp from librecovery
  fs_mgr_do_mount_one: allow overriding mount_point
2018-12-19 22:19:52 +00:00
Tom Cherry
38ff80810a Merge "fs_mgr: Fix kernel command line parsing" 2018-12-19 21:28:35 +00:00
Martin Stjernholm
bb4f2b440a Revert^2 "Use libdexfile external API in libunwindstack."
This reverts commit cacf5bf6bc.

Reason for revert: Re-apply with proper fix for VNDK visibility on marlin and sailfish.

Test: Manual repro of http://b/121110092#comment1 on reported branch
Test: atest CtsRenderscriptTestCases
Test: mmma system/core/{libunwindstack,libbacktrace}, run host gtests
Test: Make image, flash, and reboot device.
Test: Forrest cts/art/gce-all: https://android-build.googleplex.com/builds/forrest/run/L00300000240828791
Test: Forrest cts/bionic/gce-all: https://android-build.googleplex.com/builds/forrest/run/L05600000240682947 (shows 27/2958 failed, but it doesn't pass on Blackbox either: http://screen/xbjioEf6UgR)
Test: Forrest cts/renderscript/gce-all: https://android-build.googleplex.com/builds/forrest/run/L66200000240680523
Bug: 119632407
Change-Id: I601aa97eac8127e30d753405f8bc1fc4ae7f849f
2018-12-19 21:04:35 +00:00
Elliott Hughes
9082e7af37 Build libbase with _FILE_OFFSET_BITS=64.
sehr points out that we already have two bugs caused by not doing this:
file.cpp has a call to pread with an off64_t that gets truncated, and
mapped_file.cpp does similar with mmap.

Bug: N/A
Test: ran tests
Change-Id: Ia098a836457e5adf109541235ad71c0ad7219da8
2018-12-19 12:55:17 -08:00
Yifan Hong
bf80e7dd91 Move parts of roots.cpp from librecovery
Move some mounting functionalities from librecovery so that
other modules can also mount logical partitions correctly.

- Also, refactor to use C++ Fstab struct.
- Also, fixed CreateLogicalPartitions() to take full path of
super device.

Test: run recovery tests
Test: vintf_object_recovery_test

Bug: 118634720
Bug: 113182233
Bug: 62292478
Change-Id: Ie02c3a941ed801fdae5818099faf5f3863444296
2018-12-19 10:23:50 -08:00
Yifan Hong
0cd2d5f048 fs_mgr_do_mount_one: allow overriding mount_point
Test: boots
Bug: 118634720
Change-Id: Ie2d05fdead27bfb1c922749272ff648bc7c418d1
2018-12-19 10:23:50 -08:00
Ruslan Trofymenko
23249c9fc5 fs_mgr: Fix kernel command line parsing
Remove new line character ('\n') from the kernel command line after
reading from '/proc/cmdline'. This character is not contained in the
original string and is added as a result of reading (according to
kernel source codes [1]):

    ...
    seq_puts(m, saved_command_line);
    seq_putc(m, '\n');
    ...

As a result, this may corrupt the last argument of the string. For
example, if the last argument is 'androidboot.slot_suffix=_a', then the
target partition ('vendor_a\n') will not be found in fstab section of
the device tree.

[1] fs/proc/cmdline.c

Change-Id: I96a853f1f55f27d782afe2ca8c0b006a75368149
Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org>
2018-12-19 20:03:10 +02:00
Treehugger Robot
1baa19b1a6 Merge "Fix offsets when shared lib split across maps." 2018-12-19 17:11:53 +00:00
Treehugger Robot
613674049f Merge "Propagate dlopen errors to callers of OpenNativeLibrary." 2018-12-19 15:36:25 +00:00
Jintao Zhu
245fb369b1 improve LogBufferElement copy constructor
LogBufferElement copy constructor supported only partial function.

Solution: handle all cases.

Test: unit test for calling the copy constructor with all possible states.
Change-Id: I55091569d98eb35a09b4c3fc068836ecd256558c
2018-12-19 22:20:12 +08:00
Lorenzo Colitti
95a8d0d0c7 Merge "Allow dlopen()ing libraries from the netd APEX." 2018-12-19 14:19:41 +00:00
Pete Bentley
632f142c42 Propagate dlopen errors to callers of OpenNativeLibrary.
Bug: 119867084
Test: make && flashall
Change-Id: If98082db39796f0097ce7ef1d095c9f202c3a95e
2018-12-19 13:48:01 +00:00
Lorenzo Colitti
472c900f6b Allow dlopen()ing libraries from the netd APEX.
This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

We cannot put the APEX into the search path due to b/120661824,
but we can put it into the permitted path,

Test: builds, boots
Test: system/netd/tests/runtests.sh
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Change-Id: Ia68df860b7edc92180284f62736146e6029d7655
2018-12-19 16:52:06 +09:00
Treehugger Robot
5ffa70ec4f Merge "Revert "Use libdexfile external API in libunwindstack."" 2018-12-19 02:30:27 +00:00
Remi NGUYEN VAN
354d5f27ff Merge "Add UID for network stack app" 2018-12-19 02:01:23 +00:00
Martin Stjernholm
cacf5bf6bc Revert "Use libdexfile external API in libunwindstack."
This reverts commit 444e23d2fc.

The rest of the topic doesn't need to be reverted.

Reason for revert: Breaks renderscript on marlin and sailfish.

Test: Manual repro of http://b/121110092#comment1 on reported branch
Test: "atest CtsRenderscriptTestCases" on that branch
Test: mmma system/core/{libunwindstack,libbacktrace}, run host gtests
Test: Make image, flash, and reboot device.
Bug: 121110092, 119632407
Change-Id: If1976b19ce386c95bc5bd4fd6d523745c167de18
2018-12-19 00:11:04 +00:00
Treehugger Robot
796e61c279 Merge "Log the last error code of StatsLog failures" 2018-12-18 23:28:12 +00:00
Treehugger Robot
958a669e58 Merge "zip_archive.cc: add O_CLOEXEC" 2018-12-18 22:49:32 +00:00
Tri Vo
96b8ce7228 Merge "init: support loading /product/etc/selinux/product_sepolicy.cil" 2018-12-18 21:13:27 +00:00
Nick Kralevich
3bdf744a55 zip_archive.cc: add O_CLOEXEC
Prevent file descriptors from leaking across an exec() boundary.

Bug: 120983106
Test: compiles and boots
Change-Id: I392b0767674b557b1e4404a2ba63bc48e3e37b24
2018-12-18 12:48:06 -08:00
Christopher Ferris
a09c4a6ff2 Fix offsets when shared lib split across maps.
The linker was modified so that a shared library has a read-only
map, then a read-execute map to represent the whole shared library.
When backtraces are created, then the offsets are set incorrectly
for backtraces. For example, all backtraces wind up with an offset now,
and a shared library loaded out of an apk shows the wrong offset.

Changes:
- Fix the FormatFrame function which was putting the offset before the
  map name.
- Refactor the Maps and MapInfo classes to keep track of the previous map
  instead of all maps. This was the only map that was ever needed.
- Modify the unwind_for_offline tool to capture both the read-only and
  read-execute map when using the read-only segment option.

Bug: 120981155

Test: Updated unit tests pass.
Test: Unwinds on device don't show the offsets everywhere any more.
Change-Id: I75b3727221be9c20316dfdcd7a1c6d242d7ce948
2018-12-18 11:22:14 -08:00
Treehugger Robot
8fd4435d53 Merge "fastbootd: Only flash slots listed by the boot control HAL." 2018-12-18 03:56:48 +00:00
David Anderson
4d307b0975 fastbootd: Only flash slots listed by the boot control HAL.
Bug: N/A
Test: flash when metadata slot count is >2
Change-Id: I67481be0de162cab5da8d32c2e318489427f1932
Merged-In: I67481be0de162cab5da8d32c2e318489427f1932
(cherry picked from commit 8568dcb057)
2018-12-18 02:12:22 +00:00
Treehugger Robot
41e83c32ba Merge "use epoll_create1" 2018-12-18 01:45:35 +00:00
Nick Kralevich
f328edd142 Merge "use epoll_create1(EPOLL_CLOEXEC)" 2018-12-17 23:43:13 +00:00
Treehugger Robot
1f09b58aca Merge "[libbacktrace] Fix sign-compare warning" 2018-12-17 23:25:46 +00:00
Treehugger Robot
001c6b9c01 Merge "fs_mgr: overlayfs: test issues with single super device" 2018-12-17 22:59:55 +00:00
Treehugger Robot
ece144857b Merge "Revert "Linker namespace configuration for the Runtime APEX."" 2018-12-17 22:55:15 +00:00
Tri Vo
80e191af8b Merge "Reland "Remove obsolete ueventd.rc rules."" 2018-12-17 22:16:36 +00:00
Mark Salyzyn
eb9b11c096 Merge "llkd: adbd is allowed to be a bad parent on userdebug" 2018-12-17 21:51:29 +00:00
Andreas Gampe
a0d9f2fd6c Revert "Linker namespace configuration for the Runtime APEX."
This reverts commit f1038896ad.

Reason for revert: Breaks CTS

Bug: 119867084
Bug: 113373927
Bug: 121149887
Change-Id: I44b3e708ff1c87520bcfb64f509bf3ae6871f7bc
2018-12-17 21:22:53 +00:00
Yi Kong
c91e6f9e5f [libbacktrace] Fix sign-compare warning
static_cast GetThreadId result to pid_t.

Test: m checkbuild
Change-Id: Id3f541c1cb6cad9471e0cedf2ca49ce0fc38df38
2018-12-17 12:51:36 -08:00
Mark Salyzyn
38a17f0d76 fs_mgr: overlayfs: test issues with single super device
Cleanup test issues with single super device.  Indicate mount point
instead of partitions as that can lead to confusion when referencing
the partition when there is none.  For example root (/) partition
uses overlay on /system.  Resolve a script syntax error when there
are no devices.  Fix script logic surrounding detection of overlayfs
takeover and handling of reboot device request from
adb disable-verity.

In README.overlayfs.md discuss
BOARD_<partitiion>IMAGE_PARTITION_RESERVED_SIZE and its negative
impact on right sizing.

Soften README.overlayfs.md wording with respect to update_engine
to match changes in handling.

Test: adb-remount-test.sh
Bug: 120536582
Bug: 109821005
Change-Id: Iad7e19a436322ff9c3bdc597f4545028be112ff5
2018-12-17 11:26:03 -08:00
Nick Kralevich
0a8b4d1a8b use epoll_create1
epoll_create leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC)
instead.

Bug: 120983106
Test: compiles and boots
Change-Id: I7c135ee22aee61cc7895486fda904b1790c093d1
2018-12-17 09:39:24 -08:00
Nick Kralevich
f47c91053f use epoll_create1(EPOLL_CLOEXEC)
epoll_create(0) leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC)
instead.

Bug: 120983106
Test: compiles and boots
Change-Id: I2a733d4482d6a74ceb3254e501cdb5f6de0cd5dc
2018-12-17 09:32:23 -08:00
Treehugger Robot
17d41711c6 Merge "Change --fastdeploy behaviour" 2018-12-17 11:10:18 +00:00