Commit graph

34345 commits

Author SHA1 Message Date
Jin Qian
041f849548 init: require e2fsdroid and mke2fs when building init
init calls fs_mgr to format ext4 partitions. This requires
e2fsdroid and mke2fs in /system/bin/

Bug: 35219933
Change-Id: Ia32fe438cd9b9332f8e18e0cbe7f61bd050adcb1
2017-07-06 11:45:06 -07:00
Keun-young Park
3b15f44041 Merge "add "shutdown critical" to service" into oc-dr1-dev 2017-07-06 17:14:23 +00:00
TreeHugger Robot
7be26793eb Merge "init: add info logs in first stage mount if we have to poll" into oc-dr1-dev 2017-07-06 16:15:11 +00:00
TreeHugger Robot
3d7422dbfe Merge "fs_mgr: replace make_ext4 api with e2fsprogs" into oc-dr1-dev 2017-07-06 14:24:04 +00:00
Tom Cherry
c680bfeaf2 init: add info logs in first stage mount if we have to poll
It's not a error case if we do not find a device that we're attempting
to regenerate uevents for during first stage mount, but it is likely
to increase boot time, so we log a message to attribute this delay.

Bug: 63327193
Test: Boot bullhead, sailfish

Merged-In: I97c2e5aefd218bbdd87717ff3c375381f725de08
Change-Id: I97c2e5aefd218bbdd87717ff3c375381f725de08
(cherry picked from commit 322e176f6a)
2017-07-06 13:04:23 +08:00
Keun-young Park
d266d37e4c add "shutdown critical" to service
- "shutdown critical" prevents killing the service during
  shutdown. And the service will be started if not running.
- Without it, services will be killed by SIGTERM / SIGKILL during shutdown.
- Even services with "shutdown critical" will be killed if shutdown
  times out.
- Removes ueventd and vold from hard coded list. Each service's rc will
  be updated to add "shutdown critical". watchdogd is still kept in the list.

bug: 37626581
Test: reboot and check last kmsg

(cherry picked from commit cccb34fce8)

Change-Id: I3c6aeb7151e64beca4b435f843ae64455217262d
2017-07-06 00:54:02 +00:00
TreeHugger Robot
5c5c544e80 Merge "init: rename mke2fs tools with _static suffix" into oc-dr1-dev 2017-07-05 22:33:35 +00:00
Logan Chien
f499bcdde7 Revert "Move libz to vndk-sp"
This commit removes libz.so from the exported libs of "vndk" linker
namespace and export libz.so from "default" linker namespace instead.

We have to remove libz.so from vndk-sp because we don't have a good
mechanism to stop "classloader" linker namespace from loading
/system/lib[64]/vndk-sp/libz.so.  Other alternatives require significant
changes to dynamic linker or CTS test cases.

Let's temporarily revert the commit to fix b/62195853 for oc-dr1-dev.
The long-term solution will be discussed in b/37617391.

This reverts commit 63226400f3.

Bug: 62195853
Bug: 37617391
Test: Boot sailfish to home screen.
Change-Id: I4a97819b080f7091b633152d4a11353b24c463ee
2017-07-05 11:18:13 +08:00
Josh Gao
aabd9a09b5 Revert "adb: turn on libusb by default."
This reverts commit f2f0b31850.

libusb seems to be causing flakiness on some machines. Disable it for
now.

Bug: http://b/62962248
Test: python test_device.py (with DeviceOfflineTest commented out)
Change-Id: Ia9de78ab772c22574cf5ca7facb78f22af6d7a71
(cherry picked from commit 969110ca4a)
2017-06-29 11:22:55 -07:00
TreeHugger Robot
712b628d70 Merge "Allow configuration of the number of tombstones." into oc-dr1-dev 2017-06-28 20:51:41 +00:00
TreeHugger Robot
d334d69b70 Merge "Load default prop from /system/etc/prop.default" into oc-dr1-dev 2017-06-28 06:28:09 +00:00
Elliott Hughes
36a90f0569 Allow configuration of the number of tombstones.
(cherry picked from commit 35bb6d2a89)

Bug: http://b/62810514
Test: altered the property, got more tombstones
Change-Id: I35cd3a5582306d9fff5b74f193ef739a8f09bbf8
2017-06-27 22:19:43 -07:00
TreeHugger Robot
ad692c9b29 Merge "AVB: allow no metadata in the generic system.img for project Treble" into oc-dr1-dev 2017-06-28 03:37:04 +00:00
Todd Poynor
4d88b49320 healthd: notify listeners using local copy of list, drop lock
am: fd68370074

Change-Id: I6ab2f3131139a553bf9e8eb927e266ab128a5f49
2017-06-27 21:52:28 +00:00
Todd Poynor
fd68370074 healthd: notify listeners using local copy of list, drop lock
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting).  The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded.  The binder behavior is considered a bug and may change in
the future.  For now, work around this in healthd.

Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.

Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
2017-06-27 11:58:17 -07:00
Jin Qian
1be46c0d0e fs_mgr: replace make_ext4 api with e2fsprogs
Execute mke2fs to create empty ext4 filesystem.
Execute e2fsdroid to initialize selinux context.

Test: zero-out first 4k of data partition and reboot,
      fs_mgr successfully formats /data.
Bug: 35219933
Change-Id: If6f72f62c618c64be703b83f0114a4dd0a2b079f
Merged-In: If6f72f62c618c64be703b83f0114a4dd0a2b079f
2017-06-26 17:15:25 -07:00
Jin Qian
5eb6e5bd73 init: rename mke2fs tools with _static suffix
We build a static version for recovery mode. Give them
different names to avoid conflicts with regular version
in /system/bin/

Bug: 35219933
Change-Id: I738655ad9b9ad71c63ae604d9a4d659b0b671121
Merged-In: I738655ad9b9ad71c63ae604d9a4d659b0b671121
2017-06-26 17:15:15 -07:00
Bowgo Tsai
1773266f95 AVB: allow no metadata in the generic system.img for project Treble
The generic system.img released from project Treble can't contain any verity
metadata (e.g., vboot 1.0, AVB, or any other implementation) because it's
*generic*. To make any device can boot with it, `avbctl disable-verification`
is introduced to set a new flag AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED
in the top-level vbmeta to disable the entire AVB verification process. This
should be done prior to flash the generic system.img. See the following link
for details:

    https://android-review.googlesource.com/#/c/418399/

This CL checks whether AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED is
set in the top-level vbmeta. When set, skip verifying the vbmeta structs
against androidboot.vbmeta.{hash_alg, size, digest} because it will be
absent in kernel cmdline. Also, only top-level vbmeta struct is read then
returned by libavb in this case.

Note that another flag AVB_VBMETA_IMAGE_FLAGS_HASHTREE_DISABLED, usually
set by `adb disable-verity`, is used to signal fs_mgr to skip setting up
dm-verity, but libavb still verifies all vbmeta structs. fs_mgr will
also verify all vbmeta structs against androidboot.vbmeta.{hash_alg,
size, digest} from kernel cmdline as well.

Also rename SetUpAvb() to SetUpAvbHashtree() to better fit its usage.
This function will return kDisabled when any of the above two flags is set.

Finally, regardless of which flag is set or not set, we still only allow two
return values from avb_slot_verify():

   - AVB_SLOT_VERIFY_RESULT_OK: it's still possible to get this value
     when any of these flags are set in build time. e.g.,
     BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS=--flags 2

   - AVB_SLOT_VERIFY_RESULT_ERROR_VERIFICATION: in most cases we should
     get this value, because the flags are likely set at run time.

Bug: 62523303
Test: boot device with 'avbctl disable-verification'.
Test: boot device with 'avbctl enable-verification'.
Test: boot device with 'adb disable-verity'.
Test: boot device with 'adb enable-verity'.

Test: build image with BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS=--flags 2, then boot device.
      repeat the above steps to boot device again.

Merged-In: Ie8436f3e0e82c78490208f3b85eac5238a9fdfdb
Change-Id: Ie8436f3e0e82c78490208f3b85eac5238a9fdfdb
(cherry picked from commit 60f19a0792)
2017-06-24 10:01:32 +08:00
TreeHugger Robot
75a32dead5 Merge "Revert "crash_dump: during early boot, output to kmsg on userdebug."" into oc-dr1-dev 2017-06-23 22:45:48 +00:00
Jeff Vander Stoep
5fdc4cc746 Revert "crash_dump: during early boot, output to kmsg on userdebug."
This reverts commit bf2dd48241.

Addresses:
avc: denied { relabelto } for name="kmsg_debug" dev="tmpfs" ino=10642
scontext=u:r:init:s0 tcontext=u:object_r:device:s0 tclass=chr_file

Bug: 62101480, 35197529
Test: build and boot device. Verify selinux denial no longer occurs.
Change-Id: I28ce16f50eec20ef15c1721f41b66f22a84e7cca
2017-06-23 13:37:54 -07:00
TreeHugger Robot
394c1ad959 Merge "Debuggerd: Fix debuggerd_test" into oc-dr1-dev 2017-06-23 20:28:30 +00:00
Andreas Gampe
0ecc88bb28 Debuggerd: Fix debuggerd_test
Follow-up to commit 695713e931f0436aca56be9c0dacf2a5dd4e56e7 in
bionic. Change expectations of the abort callstack.

(cherry picked from commit 26cbafb892)

Bug: 62810360
Merged-In: I350a29ee1713a7ebdd50f2b9bdc2078c671e22c7
Test: mmma system/core/debuggerd
Test: adb shell /data/nativetest/debuggerd_test/debuggerd_test32
Test: adb shell /data/nativetest64/debuggerd_test/debuggerd_test64
Change-Id: I350a29ee1713a7ebdd50f2b9bdc2078c671e22c7
2017-06-23 10:49:19 -07:00
Daichi Hirono
d9cda90ad4 Add volatile to temporary variable.
FuseBuffer::HandleNotImpl save the value of |request.header.unique| to the
temporary variable, clear the buffer which is a union of |request| and
|response|, then write back the unique value to response.header.unique.

Before the CL, the temporary variable was wrongly removed by the compiler
optimization, and response.header.unique was always 0. The CL adds
volatile modifier as workaround to prevent the compiler optimization
from removing the temporary value.

Bug: 62429763
Test: libappfuse_tests
Change-Id: Ia853f805633f646f316f585a35c7b018000b6eb3
(cherry picked from commit a6dee5e279)
2017-06-23 07:15:27 +00:00
Andreas Gampe
1d873b3512 Debuggerd: Extend crash_dump timeout to 5 seconds
am: 4f5f558d38

Change-Id: I25274053b0b45b00cefbc8d65d5ef271050269b2
2017-06-23 06:22:08 +00:00
Andreas Gampe
4f5f558d38 Debuggerd: Extend crash_dump timeout to 5 seconds
Some processes have lots of threads and minidebug-info. Unwinding
these can take more than the original two seconds.

Bug: 62828735
Test: m
Test: debuggerd_test
Test: adb shell kill -s 6 `pid system_server`
Merged-In: I0041bd01753135ef9d86783a3c6a5cbca1c5bbad
Change-Id: I0041bd01753135ef9d86783a3c6a5cbca1c5bbad
(cherry picked from commit b02851a984)
2017-06-22 23:02:52 -07:00
Logan Chien
7c61689d5a ld-config: Export android.hidl.memory@1.0-impl
am: fb2a4f0874  -s ours

Change-Id: Ife655ab99a716adce10243e903ccd20192679614
2017-06-23 05:12:14 +00:00
Logan Chien
fb2a4f0874 ld-config: Export android.hidl.memory@1.0-impl
This commit exports android.hidl.memory@1.0-impl.so from default linker
namespace to vndk (VNDK-SP) linker namespace.  This fixes
libhidlmemory.so failure.

Note: Exposing android.hidl.memory@1.0-impl.so from default linker
namespace to vndk (VNDK-SP) linker namespace shall be fine because its
APIs are frozen and won't be changed in the future.

Note: android.hidl.memory@1.0-impl.so is NOT exported to sphal linker
namespace.

Bug: 35107583
Bug: 62778280
Test: Write a test SP-HAL lib which links libhidlmemory.so, load that
SP-HAL lib into system executable, and make sure mapMemory() works.
Test: sailfish boots w/o problems.

Merged-In: Ia36350dcf1f8c8dc6d7bf2c7a6ae65e0ebaef578
Merged-In: Iddb723558c3a814a905cd42797594a707bc651da
Change-Id: I69034595b2cd355e786ce7943fed7dddf1b12525
(cherry picked from commit bd7503dae7)
(cherry picked from commit 3251e582f2)
2017-06-22 20:13:01 +08:00
Logan Chien
bd7503dae7 ld-config: Export android.hidl.memory@1.0-impl
This commit exports android.hidl.memory@1.0-impl.so from default linker
namespace to vndk (VNDK-SP) linker namespace.  This fixes
libhidlmemory.so failure.

Note: Exposing android.hidl.memory@1.0-impl.so from default linker
namespace to vndk (VNDK-SP) linker namespace shall be fine because its
APIs are frozen and won't be changed in the future.

Note: android.hidl.memory@1.0-impl.so is NOT exported to sphal linker
namespace.

Bug: 35107583
Bug: 62778280
Test: Write a test SP-HAL lib which links libhidlmemory.so, load that
SP-HAL lib into system executable, and make sure mapMemory() works.
Test: sailfish boots w/o problems.

Change-Id: Ia36350dcf1f8c8dc6d7bf2c7a6ae65e0ebaef578
2017-06-22 20:12:21 +08:00
TreeHugger Robot
46163119d5 Merge changes Ic9c27552,Ie3980cd5,I42bf2bdc into oc-dr1-dev
* changes:
  Revert "Revert "init: poll in first stage mount if required devices are not found""
  Revert "Revert "ueventd: remove PlatformDeviceList""
  fs_mgr: differentiate if fs_mgr_set_verity() was skipped or disabled
2017-06-22 09:43:54 +00:00
Logan Chien
2b7e892b7c Merge "ld-config: Add HIDL memory libs to VNDK-SP" into oc-dev
am: 86530fac97  -s ours

Change-Id: I8321a6e632d3a9a2476570b04877e538f250b271
2017-06-22 05:14:00 +00:00
Logan Chien
ba2b4bb9dd ld-config: Add HIDL memory libs to VNDK-SP
am: ea2719f9f1  -s ours

Change-Id: I2fd70479f08eae658fad2a48ae678a300f710f10
2017-06-22 05:11:55 +00:00
TreeHugger Robot
86530fac97 Merge "ld-config: Add HIDL memory libs to VNDK-SP" into oc-dev 2017-06-22 05:07:14 +00:00
Sandeep Patil
1266930e8a Revert "Revert "init: poll in first stage mount if required devices are not found""
This reverts commit d6fccea093.

Bug: 62681642
Bug: 62682821
Bug: 62864413

Merged-In: Ic9c27552acbd2ae312e44ea2cdf060dcf493bfe6
Change-Id: Ic9c27552acbd2ae312e44ea2cdf060dcf493bfe6
Signed-off-by: Sandeep Patil <sspatil@google.com>
(cherry picked from commit 4cbedee541)
2017-06-21 17:02:12 -07:00
Sandeep Patil
5d0299906e Revert "Revert "ueventd: remove PlatformDeviceList""
This reverts commit 516ff99711.

Bug: 62864413
Bug: 62864413

Merged-In: Ie3980cd536c2c83adace063f0950128f68561105
Change-Id: Ie3980cd536c2c83adace063f0950128f68561105
Signed-off-by: Sandeep Patil <sspatil@google.com>
(cherry picked from commit cd2ba0d184)
2017-06-21 17:02:03 -07:00
Sandeep Patil
fa59bba6af fs_mgr: differentiate if fs_mgr_set_verity() was skipped or disabled
In case of non-secure builds (eng variant) fs_mgr_setup_verity() skips
verity checks regardless of fstab options. This is slightly different
than 'adb disable-verity' where it would first read the verity metadata
to check if verity is disabled.

So, this change adds a new return value of FS_MGR_SETUP_VERITY_SKIPPED
instead of piggy backing on the FS_MGR_SETUP_VERITY_DISABLED.

Bug: 62864413
Test: Boot sailfish

Merged-In: I42bf2bdce0ecb18b4c3b568e2bc96bf1590dfb35
Change-Id: I42bf2bdce0ecb18b4c3b568e2bc96bf1590dfb35
Signed-off-by: Sandeep Patil <sspatil@google.com>
(cherry picked from commit 95366e97dd)
2017-06-21 17:01:48 -07:00
TreeHugger Robot
b7806433bf Merge "adb: increase the shell command length limit." into oc-dr1-dev 2017-06-21 20:18:32 +00:00
Tom Cherry
e1519ba27c Merge "Revert "ueventd: remove PlatformDeviceList"" into oc-dev
am: fef83abd89  -s ours

Change-Id: I9d6d034bac825590e276327c27e61686beec51b1
2017-06-21 18:33:51 +00:00
Tom Cherry
165b58b64f Revert "init: poll in first stage mount if required devices are not found"
am: 0e63e61eb5  -s ours

Change-Id: Ie7e538917949762e4932c6c386c003b720408d8b
2017-06-21 18:31:19 +00:00
Tom Cherry
eb9edefdc8 Merge "Revert "ueventd: remove PlatformDeviceList"" into oc-dr1-dev 2017-06-21 18:19:03 +00:00
Tom Cherry
b829811587 Merge "Revert "init: poll in first stage mount if required devices are not found"" into oc-dr1-dev 2017-06-21 18:18:38 +00:00
Tom Cherry
fef83abd89 Merge "Revert "ueventd: remove PlatformDeviceList"" into oc-dev 2017-06-21 18:18:24 +00:00
Tom Cherry
3fa8396f3b Revert "ueventd: remove PlatformDeviceList"
Bug: 62864413

This reverts commit f51657ccef.

Change-Id: I1397ca2de716395782139688542c69848a31d62f
2017-06-21 18:11:03 +00:00
Tom Cherry
5bd4704db2 Revert "init: poll in first stage mount if required devices are not found"
Bug: 62864413

This reverts commit bea663d04c.

Change-Id: Ief069cae9de4393a59d1a499bc4861efb65e8250
2017-06-21 18:10:58 +00:00
Tom Cherry
f520e44c4c Revert "ueventd: remove PlatformDeviceList"
Bug: 62864413

This reverts commit d43b615216.

Change-Id: If3d9060e723d6040d3f32f253b492131a56edb9f
2017-06-21 18:10:53 +00:00
Tom Cherry
0e63e61eb5 Revert "init: poll in first stage mount if required devices are not found"
Bug: 62864413

This reverts commit 5f4e8eac8a.

Change-Id: I6f35b920bb52875c8ef430d3e20b205fda5165e8
2017-06-21 18:10:47 +00:00
Logan Chien
d7a6fb9383 ld-config: Add HIDL memory libs to VNDK-SP
This commit adds libhidlmemory.so and android.hidl.memory@1.0.so to the
exported libs of the `vndk` linker namespace (aka. VNDK-SP).  This is
necessary because some vendors' GLES implementation uses
libhidlmemory.so.  Check http://b/35107583#comment15 for the context.

Bug: 35107583
Test: sailfish boots
Change-Id: Idb5ba4ed4a89795e0e6105d55a84e7f6bbffff51
2017-06-21 20:13:08 +08:00
Logan Chien
ea2719f9f1 ld-config: Add HIDL memory libs to VNDK-SP
This commit adds libhidlmemory.so and android.hidl.memory@1.0.so to the
exported libs of the `vndk` linker namespace (aka. VNDK-SP).  This is
necessary because some vendors' GLES implementation uses
libhidlmemory.so.  Check http://b/35107583#comment15 for the context.

Bug: 35107583
Test: sailfish boots

Merged-In: Idb5ba4ed4a89795e0e6105d55a84e7f6bbffff51
Merged-In: I1556b7499bd981af995f000519b7a314c70567d1
Change-Id: I5af7c954d432a2e8de6c6b744cedbada836bbd98
2017-06-21 20:10:56 +08:00
Tom Cherry
07a1b34b69 init: poll in first stage mount if required devices are not found
am: 5f4e8eac8a  -s ours

Change-Id: I68ce2bceef8c0ec50610a5f69bce5b83bc407810
2017-06-21 04:22:39 +00:00
Tom Cherry
9c0d2e124a ueventd: remove PlatformDeviceList
am: d43b615216  -s ours

Change-Id: Ice290d027143458598995da53d612fa3e2ede3f3
2017-06-21 02:23:18 +00:00
Tom Cherry
baec926f40 Merge "init: poll in first stage mount if required devices are not found" into oc-dr1-dev 2017-06-21 02:02:02 +00:00