Commit graph

34373 commits

Author SHA1 Message Date
Josh Gao
30b69aab46 debuggerd_handler: print pid and process name.
Bug: http://b/64483618
Test: manual

(cherry picked from commit 81e6c0b613)

Change-Id: Icd957ccd21c2ce072f4cdf973b94de08fb0c5567
2017-08-11 22:01:36 -07:00
Jin Qian
c2ca105575 fastboot: add mke2fs and e2fsdroid to build package
Bug: 23686092
Bug: 63849632
Change-Id: Iff0d92b7174597d43ee646847888aedc2080052a
(cherry picked from commit 6ce78321a2)
2017-08-03 14:50:17 -07:00
Jin Qian
92064ef073 fastboot: call mke2fs to format ext4 filesystem on windows
Bug: 35219933
Change-Id: I0cc8c165176e8dc9cbe4b6a52679937bc872e2d0
(cherry picked from commit 29fc859a6d)
2017-08-03 14:40:43 -07:00
Jin Qian
ffef31cef1 fastboot: call mke2fs tools to generate ext4 image
Set MKE2FS_CONFIG to empty to use mke2fs default configs

Test: fastboot --wipe-and-use-fbe
Bug: 35219933
Change-Id: Ibc97bb125899e1f1fe820d53709fdb2ab291c171
(cherry picked from commit d14d7c14cb)
2017-08-03 14:39:12 -07:00
Christine Hallstrom
c1f776d7d1 DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth am: 2e06a0ff6e -s ours am: 3c31204e68 -s ours
am: 3a66fd2174  -s ours

Change-Id: I5a2222a551bdfe4077f061131a99c9951cd9c152
2017-07-27 22:38:35 +00:00
Christine Hallstrom
3a66fd2174 DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth am: 2e06a0ff6e -s ours
am: 3c31204e68  -s ours

Change-Id: I251108805c58aabdd41f31a015a6760ea36878e0
2017-07-27 22:35:35 +00:00
Christine Hallstrom
3c31204e68 DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth
am: 2e06a0ff6e  -s ours

Change-Id: Ib595080a5bd778e6f844657c785708a37277633f
2017-07-27 22:33:22 +00:00
Christine Hallstrom
2e06a0ff6e DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth
Bug: 62410937
Change-Id: Ic6ddba03ee6316dc54d5d41b35c90fe3d9057723
2017-07-27 20:55:12 +00:00
TreeHugger Robot
4ee59e0b51 Merge "adbd: add logging to troubleshoot usb issues." into oc-dr1-dev 2017-07-27 15:26:00 +00:00
Josh Gao
8f484a6896 adbd: add logging to troubleshoot usb issues.
Bug: http://b/63899881
Bug: http://b/63901259
Bug: http://b/63904904
Test: treehugger
Change-Id: Ifbc3caa6b416093bf8e127194003747c910352dc
(cherry picked from commit 184f571cfd)
2017-07-27 00:34:31 -07:00
Siqi Lin
b9b76de6ff rootdir: record last build fingerprint
We can't copy /default.prop so just write the value of
$(ro.build.fingerprint) to /data/misc/recovery/ro.build.fingerprint
and rotate it after reboot instead.

Bug: 62793047
Test: manual - reboot phone and check /data/misc/recovery
Change-Id: I130a4b7a01d9e1bfe9baecde2781626eb72e768b
2017-07-26 13:40:15 -07:00
Wei Wang
b7a8764a12 Do not umount roofs even if it is R/W.
Latest device has rootfs instead of "/system" mount point

(cherry picked from commit a01c27eef8)

Bug: 37737296
Test: adb remount, reboot, and check log
Change-Id: I315ecf71e85255fc55c3a80619920b456bad0956
2017-07-25 11:39:22 -07:00
TreeHugger Robot
53ce94588b Merge "DO NOT MERGE ANYWHERE tombstoned: Avoid creating the tombstoned_java_trace socket." into oc-dr1-dev 2017-07-25 15:05:01 +00:00
Narayan Kamath
ed218dd556 DO NOT MERGE ANYWHERE tombstoned: Avoid creating the tombstoned_java_trace socket.
Its use is hard-wired off by default. This fixes an SELinux
denial when init tries to create it. We see a denail because
the SELinux aspects of these changes have been reverted on DR
because it's the same API level as oc-dev.

Test: manual
Bug: 63350870

Change-Id: I8b18a25bc14ad9cf79825596ce70483530dd3a8b
2017-07-25 13:17:01 +01:00
Wei Wang
63a1d0a5f9 init: Fire shutdown trigger for thermal shutdown
Recent change in init has bring normal shutdown sequence in
thermal-shutdown condition. This CL will make sure init fire shutdown
trigger where holds custom shutdown actions for vendor SoC/platform.

(cherry picked from commit 1be2212319)

Bug: 63686426
Test: adb shell setprop sys.powerctl thermal-shutdown
Change-Id: Ieb8579fdf9c30c1a81d60466a7375c9784f3ca98
2017-07-24 14:59:52 -07:00
Jiyong Park
c034a43d44 Add [test] section for /data/[nativetest|benchmarktest]
We have both system and vendor tests in the same directory
/data/nativetest. Since we can't distinguish system and vendor tests at
runtime, we choose to run all of them with the legacy namespace
configuration where /system/lib and /vendor/lib are both accessible
without any restriction. Furthermore, /system/lib/vndk-sp is added to
the list of accessible directories for tests since some libs (such as
libion.so) exist only in the directory but not in /system/lib.

This will change in the future when we install system and vendor tests
into different directories (vendor tests goes into ./vendor subdir).
Then, we will run the tests with [system] or [vendor] configurations
depending on their paths.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Change-Id: I810003b2da0b30335200c130f484ea7b041f9f80
2017-07-20 15:28:00 +09:00
TreeHugger Robot
b6962f2e44 Merge "init: Do full shutdown even for thermal shutdown" into oc-dr1-dev 2017-07-20 06:02:00 +00:00
TreeHugger Robot
6a55adc92b Merge "dump stack before kill all" into oc-dr1-dev 2017-07-20 03:38:56 +00:00
Keun-young Park
c111537f5d init: Do full shutdown even for thermal shutdown
- Skipping SIGTERM / SIGKILL / umount brings race between block
  device driver and fs layer. Do umount before shutting down.
- Reduce timeout to 1 sec for thermal shutdown and skip other time
  taking part like fsck.
- Refactor waiting part to check time in ms so that 1 sec can
  have enough resolution.

bug: 63686426
Test: adb shell setprop sys.powerctl thermal-shutdown, adb shell setprop sys.powerctl reboot and check dmesg
Merged-In: I048bac767b328c8d656a97fe65dde5f2b5bf4ae5
Change-Id: I048bac767b328c8d656a97fe65dde5f2b5bf4ae5
2017-07-19 18:38:20 -07:00
Luke Song
74a5f22d9f Merge "healthd: restructure healthd_mode_charger" into oc-dr1-dev 2017-07-20 01:02:06 +00:00
Keun-young Park
366c51ec1e dump stack before kill all
- If problematic process is from user, kill all kills
  it and dump does not show problematic process.

bug: 37737296
Test: reboot and check log

Merged-In: Iaa4f7d12f5a40fa7528c6672567c36e30b140372
Change-Id: Iaa4f7d12f5a40fa7528c6672567c36e30b140372
2017-07-19 17:11:36 -07:00
TreeHugger Robot
c5aba9702e Merge "/data/nativetest[64] processes are running with the new ns config" into oc-dr1-dev 2017-07-19 00:25:33 +00:00
Luke Song
7f386dcab9 healthd: restructure healthd_mode_charger
Refactor drawing code into separate class, and allow for split screen
drawing with offset.

Bug: 63541890
Test: Verify charging mode animation
Change-Id: I6c089460f55b8c2f75f4aa3153a5736f6f434b51
2017-07-18 15:06:46 -07:00
Keun-young Park
45ae1b2754 Do not umount /vendor, /system, and /oem even if they are R/W.
- /vendor, /system, /oem can be remounted to R/W for development
  purpose.

- In such case, umounting these partitions can lead into some processes
  not running properly during shutdown or blocking umount of fs.

- So skip them. As it is dev feature, it is up to each developer to
  understand the risk. But for normal adb sync - reboot should be ok
  as shutdown involves sync operations.

bug: 37737296
Test: adb remount,reboot, and check last kmsg

(cherry picked from commit 6e12b3887e)

Change-Id: Ia92a20aa672e68f695818e451ba2ae53af8f5ab9
2017-07-18 10:32:27 -07:00
Jiyong Park
9d1e50b809 /data/nativetest[64] processes are running with the new ns config
Native tests under /data/nativetest[64] directory is now running with
the same linker namespace configuration as /system/bin/* processes.

This allows us to stop mimicing the linker namespace configuration of the
/system/bin/* processes using LD_LIBRARY_PATH.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Change-Id: If8e2ed0b8016e4e07bf6829735b8e02f952042d0
2017-07-18 16:45:05 +09:00
Mark Salyzyn
3ec9aa4a91 rootdir: record last build signature and kernel version
(cherry pick from commit 93394034a2)

Rotate /default.prop and /proc/version into /data/misc/recovery/
as an aid in determining the vintage of the LAST_LOGCAT and
LAST_DMESG in the bugreport collection.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: manually confirm content rotation through reboots
Bug: 62793047
Change-Id: Ibbe546c76041f20e308e58e5548939afac75db97
2017-07-14 14:49:50 -07:00
Wei Wang
cea7028cf4 Merge "init: Support custom shutdown actions" into oc-dr1-dev 2017-07-06 22:36:47 +00:00
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
Wei Wang
5d4d6f7269 init: Support custom shutdown actions
We have been seeing panics and errors during shutdown sequence in
some vendor's platform, and it is required to disable error handling
during shutdown.

This CL separates the shutdown request to execute another "shutdown"
trigger at the beginning of shutdown stage. And vendor can use this
trigger to add custom commands needed for shutting down gracefully.

Bug: 38203024
Bug: 62084631
Test: device reboot/shutdown
Change-Id: I3fac4ed59f06667d86e477ee55ed391cf113717f
(cherry picked from commit eeab491efd)
2017-07-06 02:30:14 +00: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