Commit graph

33793 commits

Author SHA1 Message Date
Josh Gao
550f3bf328 Merge "Revert "crash_dump: defer pausing threads until we're ready."" 2017-06-13 18:22:01 +00:00
Josh Gao
3407d7c80f Revert "crash_dump: defer pausing threads until we're ready."
This reverts commit 8a2a2d182a.

Bug: http://b/62572585
Change-Id: Ia4278bca52178eb7b7b28b30d0930b292d97f353
2017-06-13 17:21:12 +00:00
Hung-ying Tyan
75801ab5e3 Load /prop.default in recovery mode
Bug: 37815285
Bug: 62525809
Test: Tested with ag/2398663 and ag/2400523. Booted pixel phones,
      checked the location of prop.default, verified the symlink,
      checked a few properties via adb shell and manually tested
      a few apps.
      Booted to recovery and ran 'adb sideload' successfully.
Change-Id: I034b700fcd60b0104873131e94864b16ef4bd9f6
2017-06-13 21:22:50 +08:00
Hung-ying Tyan
12ea2d12ef Revert "Revert "Load default prop from /system/etc/prop.default""
This reverts commit 98a73a2ce1.

Bug: 37815285
Bug: 62525809
Test: Tested with ag/2398663 and ag/2400524. Booted pixel phones,
      checked the location of pro.default, verified the symlink
      at /default.prop, checked a few properties via adb shell and
      manually tested a few apps.
      Booted to recovery mode and ran 'adb sideload' successfully.
Change-Id: I407412a7002b898ffb352cb5f331cab9c15be39a
2017-06-13 21:22:06 +08:00
Josh Gao
3cca239ce7 Merge "tombstoned: log where we're writing the tombstone." into oc-dev
am: 855333f346  -s ours

Change-Id: I23e17c351bb2243850074be335677431119c0b70
2017-06-13 05:37:43 +00:00
TreeHugger Robot
855333f346 Merge "tombstoned: log where we're writing the tombstone." into oc-dev 2017-06-13 05:35:09 +00:00
Josh Gao
4e64f812d7 Merge "tombstoned: log where we're writing the tombstone." am: 87f5432f52
am: 5e84d90791

Change-Id: I704d22ca89f9c2c7a4eafd79d8546c53b55e39d4
2017-06-13 02:56:03 +00:00
Josh Gao
5e84d90791 Merge "tombstoned: log where we're writing the tombstone."
am: 87f5432f52

Change-Id: I29faed29b8245bef13284bb702f5c64e1619962a
2017-06-13 02:52:58 +00:00
Treehugger Robot
87f5432f52 Merge "tombstoned: log where we're writing the tombstone." 2017-06-13 02:47:34 +00:00
Josh Gao
63f8c3d23a Merge changes Id7ab0464,Ic2a212be am: 66e1a1e3e2
am: b0b165caf7

Change-Id: I34a571357d2bff0a1df1a96b2763bc6f21e6d59c
2017-06-12 23:15:15 +00:00
Josh Gao
b0b165caf7 Merge changes Id7ab0464,Ic2a212be
am: 66e1a1e3e2

Change-Id: I11b6a8046d524b452aabb062d96d9d38e41d6af3
2017-06-12 23:12:43 +00:00
Josh Gao
64523c01bd Merge "adb: fix deadlock between transport_unref and usb_close." am: 6f61a6d9c4
am: 2a8ce10cd8

Change-Id: I3cce2167e58402732be09a3eb567cf0de3536f09
2017-06-12 23:12:41 +00:00
Josh Gao
2a8ce10cd8 Merge "adb: fix deadlock between transport_unref and usb_close."
am: 6f61a6d9c4

Change-Id: Ib55b681b57298d93123ffaa7e390ea49a76fee23
2017-06-12 23:09:47 +00:00
Treehugger Robot
66e1a1e3e2 Merge changes Id7ab0464,Ic2a212be
* changes:
  crash_dump: defer pausing threads until we're ready.
  crash_dump: add tracing.
2017-06-12 23:08:24 +00:00
Treehugger Robot
6f61a6d9c4 Merge "adb: fix deadlock between transport_unref and usb_close." 2017-06-12 23:03:55 +00:00
Nicolas Norvez
6ff249f483 Merge "adbd: optionally use qemud pipe without ro.kernel.qemu" am: b3c363f32c
am: 516ee2445d

Change-Id: Iaf3be508465ea6ab59fc6a7f4fb0b2878d50b279
2017-06-12 21:48:35 +00:00
Nicolas Norvez
516ee2445d Merge "adbd: optionally use qemud pipe without ro.kernel.qemu"
am: b3c363f32c

Change-Id: Id98add505c45a7e49141d13d535fb3849287ba0e
2017-06-12 21:46:03 +00:00
Treehugger Robot
b3c363f32c Merge "adbd: optionally use qemud pipe without ro.kernel.qemu" 2017-06-12 21:33:00 +00:00
Josh Gao
3272000382 tombstoned: log where we're writing the tombstone.
Make it easy to find out where a specific crash's tombstone was written
to by adding a log.

Bug: http://b/62268830
Test: crasher
Merged-In: I1961dfb19f76a42a8448ebafd4be153b73cb6800
Change-Id: I1961dfb19f76a42a8448ebafd4be153b73cb6800
(cherry picked from commit cb68a0317d)
2017-06-12 21:02:02 +00:00
Josh Gao
cb68a0317d tombstoned: log where we're writing the tombstone.
Make it easy to find out where a specific crash's tombstone was written
to by adding a log.

Bug: http://b/62268830
Test: crasher
Change-Id: I1961dfb19f76a42a8448ebafd4be153b73cb6800
2017-06-12 21:00:59 +00:00
Android Build Merger (Role)
7706a2fdd9 Merge "Merge "Revert "Load default prop from /system/etc/prop.default"" into oc-dev am: 642ca632f6 -s ours" into oc-dev-plus-aosp 2017-06-12 19:57:41 +00:00
Tao Bao
e57cc426e3 Merge "Revert "Load default prop from /system/etc/prop.default"" into oc-dev
am: 642ca632f6  -s ours

Change-Id: I4dbc6a7e70277ddd910d28323d3c64aa28f8d4b0
2017-06-12 19:57:05 +00:00
Elliott Hughes
184fa60c23 Merge "Fix prctl argument type" am: 6cc5927e0d
am: 316b7334b8

Change-Id: Iaaf987d8b996a44a0b11eae3a1f1386adf721f3c
2017-06-12 19:56:56 +00:00
Elliott Hughes
316b7334b8 Merge "Fix prctl argument type"
am: 6cc5927e0d

Change-Id: Iee476e7734bde72bdaebf9d1643c4b3e60f2339e
2017-06-12 19:53:57 +00:00
Elliott Hughes
6cc5927e0d Merge "Fix prctl argument type" 2017-06-12 19:48:23 +00:00
Tao Bao
642ca632f6 Merge "Revert "Load default prop from /system/etc/prop.default"" into oc-dev 2017-06-12 19:39:53 +00:00
Nicolas Norvez
717f15353f adbd: optionally use qemud pipe without ro.kernel.qemu
adbd currently decides to use the QEMUD pipe if ro.kernel.qemu=1, as set
for ranchu. The Android container in Chrome OS doesn't have that
property set and it can't be set to 1 because it's used as equivalent to
"runs inside an emulator" throughout Android and changes the way
graphics are handled, whether Bluetooth is supported, etc., behaviour
that we do not want to trigger in Chrome OS.

adbd now also checks service.adb.transport to decide whether to use the
QEMUD (goldfish) pipe.
adbd still first checks for ro.kernel.qemu to preserve existing
behaviour and will still fallback to TCP if it can't use Goldfish.

Bug: 38497992
Test: tested by jmgao@ -thanks!- on aosp_angler, adb still works.

Change-Id: I8370704145ae7301ac7aeef81c5cbd94cfcb7fd7
2017-06-12 12:22:32 -07:00
Tao Bao
98a73a2ce1 Revert "Load default prop from /system/etc/prop.default"
This reverts commit 810d71b005.

init fails to read default.prop under recovery:
init: Couldn't load properties from /default.prop: Too many symbolic links encountered

Bug: 62525809
Change-Id: I1f84a18e545e1307dcb230be51606cca731667f9
2017-06-12 17:07:11 +00:00
Bowgo Tsai
3b0512b75c Merge "fs_mgr_verity: support updating actual block device path in verity table" am: 4c28ca1ac8
am: 95d78849b4

Change-Id: Iafd903aaaa22385c6d5c50a294fdca44bf399a24
2017-06-10 03:04:22 +00:00
Bowgo Tsai
95d78849b4 Merge "fs_mgr_verity: support updating actual block device path in verity table"
am: 4c28ca1ac8

Change-Id: I8f35a15f09518bc1757432004a5126c93d1b96ae
2017-06-10 03:02:21 +00:00
Treehugger Robot
4c28ca1ac8 Merge "fs_mgr_verity: support updating actual block device path in verity table" 2017-06-10 02:57:09 +00:00
Hung-ying Tyan
fbdbbeff82 Merge "Load default prop from /system/etc/prop.default" into oc-dev
am: 0af496af01  -s ours

Change-Id: I5b22d27c22a61ff71bd9046d7b9a88bc7a7e2f7e
2017-06-09 08:12:18 +00:00
Hung-ying Tyan
0af496af01 Merge "Load default prop from /system/etc/prop.default" into oc-dev 2017-06-09 08:04:36 +00:00
Hung-ying Tyan
810d71b005 Load default prop from /system/etc/prop.default
/default.prop is moved to /system/etc/prop.default for full Treblized
devices. Modifies property_service to load it from there first.

Bug: 37815285
Test: Tested with ag/2371424. Booted pixel phones, checked the location
      of pro.default, verified the symlink at /default.prop, checked a
      few properties via adb shell and manually tested a few apps.

Change-Id: I485231f21fc86b0aec58edf867e229a31e77d85e
2017-06-09 13:02:56 +08:00
Bowgo Tsai
c3eca505cd fs_mgr_verity: support updating actual block device path in verity table
The value of PRODUCT_{SYSTEM,VENDOR}_VERITY_PARTITION will be included
in the verity metadata of an image. For example:

    PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor

This makes the image cannot be shared for devices with different by-name
prefix:
    /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor
    /dev/block/platform/soc.0/7824900.sdhci/by-name/vendor

This change supports using a generic PRODUCT_{SYSTEM,VENDOR}_VERITY_PARTITION to
build image and replace it with the actual path at run time:

    PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/bootdevice/by-name/vendor ==>
    /dev/block/platform/soc.0/7824900.sdhci/by-name/vendor

Bug: 62171170
Test: Boot sailfish with PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/bootdevice/by-name/vendor
Change-Id: I2789d2a025e80a628a1b4e7419818065c209fb7f
2017-06-09 10:02:42 +08:00
Bowgo Tsai
7f6df5ddf9 Merge "first stage mount: removing the restriction of mount points" am: 5218d69817
am: 7d491a0a7b

Change-Id: Idd5dc13632631de213aa341ddcfca9186c2f8510
2017-06-09 01:58:10 +00:00
Bowgo Tsai
7d491a0a7b Merge "first stage mount: removing the restriction of mount points"
am: 5218d69817

Change-Id: I79fa29cf2cbe899362fb93e69b673725160c2579
2017-06-09 01:56:08 +00:00
Treehugger Robot
5218d69817 Merge "first stage mount: removing the restriction of mount points" 2017-06-09 01:51:50 +00:00
Narayan Kamath
c6f30913bf Merge "tombstoned: turn on java trace support + unit tests." am: 3aaf17fc16
am: dcb4b80694

Change-Id: I209fdf87135d88468bc37f102710078ffe871bdc
2017-06-08 13:26:17 +00:00
Narayan Kamath
dcb4b80694 Merge "tombstoned: turn on java trace support + unit tests."
am: 3aaf17fc16

Change-Id: I1865c712e1cd96c360bebab4a6ca733255e81fe2
2017-06-08 13:23:11 +00:00
Narayan Kamath
3aaf17fc16 Merge "tombstoned: turn on java trace support + unit tests." 2017-06-08 13:18:48 +00:00
Bowgo Tsai
06ed613e73 first stage mount: removing the restriction of mount points
Current first stage mount only allows three mount points: system, vendor
and/or odm. This was introduced by project Treble to mount those
verified partitions early. However, there might be some other custom
partitions needs to be mounted early as well. This CL removes the
restriction and does first stage mount for whatever specified in
fstab-dt.

Bug: 62423887
Test: first stage mount /vendor with vboot 1.0
Test: first stage mount /vendor with vboot 2.0 (AVB)

Change-Id: I6c146c64e673c35c2823523ccbde193590430c48
2017-06-08 11:30:12 +08:00
Josh Gao
7e197ef833 adb: fix deadlock between transport_unref and usb_close.
Fix a deadlock that happened when a reader/writer thread released a
transport while the hotplug thread attempted  to handle a device
disconnection. Decrementing a transport refcount to zero would hold the
global transport mutex and attempt to take the usb handles mutex, while
the hotplug thread would hold the usb handles mutex and try to call
unregister_usb_transport, which would attempt to take the global
transport mutex.

Resolve this by making transport_unref not take the global transport
mutex.

Bug: http://b/62423753
Test: python test_device.py
Change-Id: Ib48b80a2091a254527f3a7d945b6a11fae61f937
2017-06-07 18:54:09 -07:00
Stephen Crane
f5b8e34660 Fix prctl argument type
Although prctl is declared as a varargs function, in actuality it takes
unsigned long arguments (after the first int argument). This patch
ensures that the slack value passed to prctl is correctly sized.

Without this change, the 32-bit ARM compiler places the 64-bit slack
value in registers r2 and r3, but prctl expects the first argument to be
in r1. For kernel versions < 4.6, set_sched_policy has not been
correctly setting the timer slack value in 32-bit ARM code.

Test: Run on bullhead device. Verified assembly of libcutils.so

Change-Id: Ie0e22cbf74a74ff168b257b2e58d0c252449d6c9
2017-06-07 17:25:00 -07:00
Josh Gao
8a2a2d182a crash_dump: defer pausing threads until we're ready.
Don't pause the threads we're going to dump until after we're about to
fetch their backtraces.

Bug: http://b/62112103
Test: debuggerd_test
Change-Id: Id7ab0464842b35f98f3b3ebc42fb76161d8afbd2
2017-06-07 14:11:28 -07:00
Josh Gao
8bb039073f crash_dump: add tracing.
Add some tracing to figure out where time is going during a dump.

Bug: http://b/62112103
Test: systrace.py sched freq idle bionic
Change-Id: Ic2a212beeb0bb0350b4d9c2cd7a4e70adc97752d
2017-06-07 14:11:06 -07:00
Tom Cherry
70a5ed49ef init: move killing of process groups to libprocessgroup
libprocessgroup kills the cgroup associated with a given pid and uid,
but not the POSIX process group associated with it.  This means that
to kill both, two of the same signals must be sent, which may cause
some issues.

This change kills all POSIX process groups whose group leaders are
found within a cgroup.  It only then kills processes in the cgroup
that are not part of the POSIX process groups that have been killed.

Bug: 37853905
Bug: 62418791
Test: Boot, kill zygote, reboot
Change-Id: Id1d96935745899b4c454c36c351ec16a0b1d3827
2017-06-07 13:20:21 -07:00
Josh Gao
4b32a1f8b8 Merge changes Id51dcb18,I2517dcb9 am: 4db472b779
am: aa3c3fc3be

Change-Id: I095bdeb2621fc49c568d3f7ada8e1abdf688e008
2017-06-07 20:11:22 +00:00
Josh Gao
aa3c3fc3be Merge changes Id51dcb18,I2517dcb9
am: 4db472b779

Change-Id: I86c616c6840133a38f8af6b8b9e61b58435bcc32
2017-06-07 20:08:54 +00:00
Treehugger Robot
4db472b779 Merge changes Id51dcb18,I2517dcb9
* changes:
  adb: libusb: switch from polling for accessibility to a sleep.
  adb: improve race between device_connected and device_disconnected.
2017-06-07 20:01:18 +00:00