Commit Graph

31707 Commits

Author SHA1 Message Date
Tom Cherry d43b615216 ueventd: remove PlatformDeviceList
In order to create symlinks for USB and block devices, the path for
their parent platform device must be known.

Previously, ueventd would save each platform device that it encounters
to a list and query this list when creating the symlinks.  That,
however, is racy because the uevent socket does not differentiate
uevents from device_init() and uevents sent by the kernel when
probing a device first the first time.  The below scenario is the
faulty case:

1) Kernel probes parent platform device for a block device
2) ueventd calls device_init() and starts processing uevents
3) Kernel probes block device and sends its uevents
4) ueventd picks up the block device uevent during its uevent processing,
   without yet regenerating the platform device uevent, causing improper
   symlinks to be created.

This change stops storing the platform devices in a list, and instead
traverses up the directory structure for each USB or block device
until it reaches a platform device, defined as one whose subsystem is
the platform bus.  This fixes the race and simplifies the ueventd
code.

Bug: 62436493
Bug: 62681642
Test: Boot bullhead
Test: Boot sailfish
Test: Boot hikey + hotplug/unplug sdcard
Merged-In: I21636355d8e434f30e0cba568598a6cf139e67f9
Change-Id: I21636355d8e434f30e0cba568598a6cf139e67f9
2017-06-20 21:22:00 +00:00
Hung-ying Tyan c6b07ec095 Merge changes from topic 'move-default-prop-v2' into oc-dev
* changes:
  Load /prop.default in recovery mode
  Revert "Revert "Load default prop from /system/etc/prop.default""
2017-06-14 02:13:50 +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
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 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
Tao Bao 642ca632f6 Merge "Revert "Load default prop from /system/etc/prop.default"" into oc-dev 2017-06-12 19:39:53 +00: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
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
Logan Chien 40624c5d1d Add libion.so to vndk-sp
This commit adds libion.so to VNDK-SP so that some vendor's
gralloc.${chipset}.so can run without problems.

Bug: 62280700
Test: Boots a device from our partners
Merged-In: Ib745dfe52107d792296426b097e13b7c7755d88c
Merged-In: I2bcfe40ed9342de6d81dd310313e984a2c64964b
Change-Id: If30657b93157a2abea29fadcdb0004b37ad9eaf2
2017-06-07 18:13:32 +08:00
Guang Zhu de29bf4884 add component metadata tag to CTS liblog test acses
Bug: 36140955
Bug: 35360169
Test: new unit test to ensure that all modules have this field
Change-Id: I352145965e8cd20371ccce3ba2b25f3a166bc3e8
Merged-In: Ifb7a14817265b4624f1dc6414b547c86aafcf4ac
2017-06-05 23:21:23 +00:00
Josh Gao a1c9e943c0 debuggerd_client: increase pipe buffer size to max.
If a process tries to dump itself (e.g. system_server during ANRs),
crash_dump will block trying to write to its pipe if it's not
sufficiently large. Increase the pipe size to the max, and add a test
to make sure that it's always at least 1MB (the default value).

Bug: http://b/38427757
Test: debuggerd_test
Merged-In: Iddb0cb1e5ce9e687efa9e94c2748a1edfe09f119
Change-Id: Iddb0cb1e5ce9e687efa9e94c2748a1edfe09f119
(cherry picked from commit 5675f3c321)
2017-06-01 16:26:23 -07:00
Josh Gao 8126d2de3e crash_dump: don't notify ActivityManager if it crashed.
Bug: http://b/38427757
Test: killall -ABRT system_server, plus added logging
Merged-In: Ic15e0b0870b1ec08a2f165ad0e5356afed02eece
Change-Id: Ic15e0b0870b1ec08a2f165ad0e5356afed02eece
(cherry picked from commit b0e51e388b)
2017-06-01 16:26:10 -07:00
Josh Gao 615d939974 crash_dump: clear the signal mask.
crash_dump inherits its signal mask from the thread that forked it,
which always has all of its signals blocked, now that sigchain respects
sa_mask.

Manually clear the signal mask, and reduce the timeout to a
still-generous 2 seconds.

Bug: http://b/38427757
Test: manually inserted sleep in crash_dump
Merged-In: If1c9adb68777b71fb19d9b0f47d6998733ed8f52
Change-Id: If1c9adb68777b71fb19d9b0f47d6998733ed8f52
(cherry picked from commit e740250b9d)
2017-06-01 16:25:39 -07:00
TreeHugger Robot 8ecf59439c Merge "init: allow ':' in property names" into oc-dev 2017-05-31 18:09:10 +00:00
TreeHugger Robot 147743176a Merge "libvndksupport: Do not lookup default namespace for sphal failure" into oc-dev 2017-05-31 07:01:41 +00:00
Jayant Chowdhary f751b13401 Merge "Add vendor_available:true to libmemunreachable" into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary 30a365a488 Merge "Mark libprocinfo vendor_avaialable." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary c9b14b96c1 Merge "Mark libion vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary 942e5b2808 Merge "Mark libdiskconfig vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary 534d886507 Merge "Mark libnetutils vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary 571cee730f Merge "Mark libmetricslogger vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary 83c5121b5e Merge "Mark libsuspend vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary b532d0d921 Merge "Mark libsysutils vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary b8c0f4fb04 Merge "Mark libziparchive vendor_available." into oc-dev 2017-05-31 03:59:47 +00:00
Jayant Chowdhary 9feff960e3 Mark libnetutils vendor_available.
libneutils is a library which belongs to vndk-cap. Mark it
vendor_available to enable vndk abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: Ief58111dea549224b3bce5cb52fd691d4381fb88
Change-Id: I32938e3e0bcc1e771290d87f561cc06b9b019046
(cherry picked from commit 409731efc1)
2017-05-31 02:02:17 +00:00
Jayant Chowdhary 7633221265 Mark libsysutils vendor_available.
libsysutils belongs to vndk-cap. Mark it vendor_available to enable vndk
abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: Ib1490362c5c800e2bdc96ef06e607c93da1006b2
Change-Id: I3ef1d09c7e836549eb13ce68ac7cdcd5923bde0f
(cherry picked from commit a1bdd2412e)
2017-05-31 01:59:42 +00:00
Jayant Chowdhary 6703270d4b Mark libziparchive vendor_available.
libziparchive is a library which belongs to vndk-cap. Mark it
vendor_available to enable header-abi-dumper's invocation to identify it
as a part of the vndk.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: Ic414d368d7043083ce9cf9c09d124fb700ac8866
Change-Id: Ibe490cc6c2cfca0f8d58df45317bb3a491d530f0
(cherry picked from commit 2c87bccf46)
2017-05-31 01:58:06 +00:00
Jayant Chowdhary 8cfdf1ba6a Mark libion vendor_available.
libion belongs to vndk-cap. Mark it vendor_available to enable vndk
abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: I195145af90433c29ce9e408197e8d7183cb960bc
Change-Id: I8ac290d435b7c4dc5e669bfccb4562495ce92516
(cherry picked from commit 2e31a8c4f9)
2017-05-31 01:56:38 +00:00
Jayant Chowdhary a3b4253f4e Mark libdiskconfig vendor_available.
libdisckonfig is a library which belongs to vndk-cap. Mark it
vendor_available to enable vndk abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: I18ed695d6df0e9848e979ad15eb56fba8923726c
Change-Id: I079869f0120fa33893540b72044ddf25c1d04bf2
(cherry picked from commit 69d1a88097)
2017-05-31 01:54:31 +00:00
Jayant Chowdhary df1ddab40d Mark libmetricslogger vendor_available.
libmetricslogger is a library which belongs to vndk-cap. Mark it
vendor_available to enable vndk abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: Id50e1bb8a7a4fecfde35a63439ac28b1be883e21
Change-Id: If4bb63d3769317bc7cfc0f2f326e8bdd7b565ebe
(cherry picked from commit 7f96d49370)
2017-05-31 01:52:59 +00:00
Jayant Chowdhary 24b34b10c6 Mark libprocinfo vendor_avaialable.
libprocinfo belongs to vndk-cap. Mark it vendor_available to enable vndk
abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: I05212410225d4cdb0cfa9abbd8b81071c79667db
Change-Id: Ib79c7e3bdde1c7d3cd9f2bb95c284b4690a22ebb
(cherry picked from commit 4362e5b0f8)
2017-05-31 01:52:14 +00:00
Jayant Chowdhary 8e1b591c57 Mark libsuspend vendor_available.
libsuspend belongs to vndk-cap. Mark it vendor_available to enable vndk
abi stability checks on it.

Details: https://android-review.googlesource.com/368372

Test: mm -j64

Bug: 38244611

Merged-In: Id716171806d71fabd9a67aa6a60189f30a35d2e2
Change-Id: I2243c6d8710b6b2f80375849e82afba28a735507
(cherry picked from commit e37259ec8b)
2017-05-31 01:51:00 +00:00
Vijay Venkatraman 447e14d12f Add vendor_available:true to libmemunreachable
Bug: 38244611
Test: build sailfish

Merged-In: I5f238377784b3a30308e9e5cb0817c71675edddf
Change-Id: Ieb7fdcae4b96a1e1622ba98a7cfb56a95b798452
(cherry picked from commit 52eaeb4825)
2017-05-31 01:48:40 +00:00
TreeHugger Robot b560e6db6a Merge "fix: ATRACE does not work for libs loaded in sphal namespace" into oc-dev 2017-05-31 00:26:13 +00:00
Tom Cherry 5543b0e848 init: allow ':' in property names
Bug: 62114389
Test: boot bullhead, get/set properties with ':' via command line
Test: trigger an init trigger with a property containing a ':'
Change-Id: Ib51853a1ef9d4f79d510c8175c0d9684e2025e23
(cherry picked from commit 1369379e33)
2017-05-30 16:53:01 -07:00
Jiyong Park 0b3c24bd4f fix: ATRACE does not work for libs loaded in sphal namespace
From O, libutils.so is loaded twice. Once in the default namespace and
once in the sphal namespace for vendor libs. However, since the
framework only communicates with the instance loaded in the default
namespace, report_sysprop_change() event is not notified to the instance
in sphal namespace. This causes ATRACE to not work for vendor libs
loaded in sphal namespace.

So, the instance loaded in default namespace now explicitly redirects
the event to the other instance.

Bug: 62084107
Test: start an app, run 'adb shell atrace gfx --stream'. atrace from the
graphics driver are visible.

Change-Id: Ia6c2ca6bcb9a8849ebb09b5c38d60480c92d4571
2017-05-27 15:32:01 +09:00
Sandeep Patil be4302bf58 Respect that status property when parsing fstab from device tree
For an fstab entry in device tree, fs_mgr now honors the status property
as done by linux. i.e. the node (in this case, the fstab entry) is
enabled if status is not set, "ok" or "okay". For every other value, the
node is considered as disabled.

Bug: 62127741
Test: Test sailfish w/ no status property, result: boots
Test: Test with status = "disabled", result: skips mounting /vendor
Test: Test with status = "ok", result: boots

Change-Id: I5ff8f710de2c54afc76b4af28108ca9075357ad1
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-05-26 18:09:06 -07:00
Justin Yun 7a1d8a10a8 libvndksupport: Do not lookup default namespace for sphal failure
Instead of looking up default namespace for the failure of loading
sphal libs, report failure. This is only for the devices that have
sphal namespace.

Bug: 38435840
Test: sailfish builds and boots
Test: libvndksupport-tests passes
Change-Id: Ibbff5f2d5d83f6482f98677a5492777db6416967
Merged-In: Ibbff5f2d5d83f6482f98677a5492777db6416967
(cherry picked from commit 17baed1012)
2017-05-26 12:21:56 +09:00
Mark Salyzyn e57b353597 Merge "liblog: test: android_logger_get_ "kernel" log buffer can be empty" into oc-dev 2017-05-25 16:58:05 +00:00
Dimitry Ivanov bb958f0f50 Merge "Load vendor public libraries to sphal namespace" into oc-dev 2017-05-25 16:19:31 +00:00
TreeHugger Robot 6ab008d183 Merge "fs_mgr: fix SIGSEGV when ostream << nullptr" into oc-dev 2017-05-25 01:49:01 +00:00
Mark Salyzyn 558f2a166b liblog: test: android_logger_get_ "kernel" log buffer can be empty
(cherry picked from commit 37eaefa9a0)

If user build and for the "kernel" log buffer, allow an empty report.

Test: CTS: User: liblog#android_logger_get_
Test: remove ro.debuggable line from /default.prop,
      run liblog-unit-tests --gtest_filter=*.android_logger_get_
Bug: 62030309
Change-Id: I5f91af07608988f322b3c46574becc308e1d8b13
2017-05-24 12:50:38 -07:00
Dimitry Ivanov af0264bbe9 Load vendor public libraries to sphal namespace
Load vendor public libraries to sphal namespace
if it exists - preserve old behavior of loading
these libraries to default namespace if sphal
namespace is not present on the device.

Bug: http://b/37410104
Test: cts-tradefed run singleCommand cts --skip-preconditions -m CtsJniTestCases
      on marlin (with enabled sphal configuration) and on angler where ld.config.txt
      is not present.

Change-Id: Iaa3fa437ba2900acc2e5b9c78039fe1553e4c9dd
2017-05-24 11:02:31 -07:00
Bowgo Tsai 98af6b320a fs_mgr: fix SIGSEGV when ostream << nullptr
fstab_rec.fs_options might be nullptr when printing error message.
Use android::base::StringPrintf() to '(null)' when needed.

Bug: 37759782
Test: Boot device and manaully trigger the output
Change-Id: I1bdf4ba57331aaea9dd5e790f6bf9d9b8bdc8b53
Merged-In: I1bdf4ba57331aaea9dd5e790f6bf9d9b8bdc8b53
(cherry picked from commit 59af33c9ed)
2017-05-25 00:25:24 +08:00
Mark Salyzyn 928e606d5a liblog: test: enoent requires userdebug or eng to run
(cherry picked from commit 38dad6c9e4)

Bypass test if we do not have all the prerequisites to run this check
of liblog failure propagation.  We need to be root, or be able to
call su, in order to temporarily stop logd to measure the error
response from liblog.  Basically a "user" build can not have the
levers to deny or fail the logger, preventing our ability to run the
liblog.enoent test.

Test: CTS: User: liblog#enoent
Test: remove ro.debuggable line from /default.prop,
      run liblog-unit-tests --gtest_filter=*.enoent
Bug: 62030441
Change-Id: I52177b8dd3c66d433bddf630e840ee088e13cddc
2017-05-24 09:15:27 -07:00
TreeHugger Robot ea6826448b Merge "Always print the initial bugreport progress message." into oc-dev 2017-05-24 03:47:09 +00:00
Felipe Leme 899e6321aa Always print the initial bugreport progress message.
Otherwise, it might take seconds to display the initial percentage,
and the user might thing something is wrong and CTRL-C the process.

Fixes: 62003852
Test: added BugreportTest.OkProgressZeroPercentIsNotIgnored
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I8e7dbb28666c825c1408d5d204f813064fc3048f
(cherry picked from commit e5d665b46f)
2017-05-23 19:01:18 -07:00
Sandeep Patil 3c8476cd99 shell_and_utils: add vendor shell and toybox targets
Bug: 36463595
Test: Build and boot.

Change-Id: I245d1755546fa597e941badce251c2e8293e998e
Signed-off-by: Sandeep Patil <sspatil@google.com>
(cherry picked from commit 52b20877dc)
2017-05-23 12:58:47 -07:00