Commit graph

950 commits

Author SHA1 Message Date
Yasuhiro Matsuda
91e1b0135d resolved conflicts for merge of 70ab38a5 to master
Change-Id: I7092ecb87f4020add5fe8843f188955a5579c284
2015-07-30 19:07:23 +09:00
Yasuhiro Matsuda
70ab38a570 am 102ead3a: am b10e562b: Merge "Introduce a mechanism to trace boot sequence."
* commit '102ead3ae187a007b8a90b61ea243197927b6ae2':
  Introduce a mechanism to trace boot sequence.
2015-07-30 08:05:46 +00:00
Yasuhiro Matsuda
f93db4b827 Introduce a mechanism to trace boot sequence.
This CL adds a trigger and a service so that Systrace can be used
for tracing events during boot.
persist.debug.atrace.boottrace property is used for switching on
and off tracing during boot. /data/misc/boottrace/categories
file is used for specifying the categories to be traced.
These property and file are rewritten by Systrace when the newly
added option --boot is specified.

Here is an example of tracing events of am and wm catetories
during boot.

$ external/chromium-trace/systrace am wm --boot

This command will cause the device to reboot. Once the device has
booted up, the trace report is created by hitting Ctrl+C.

As written in readme.txt, this mechanism relies on persistent
property, so tracing events that are emitted before that are not
recorded. This is enough for tracing events after zygote is
launched though.
This only works on userdebug or eng build for security reason.

BUG: 21739901
Change-Id: I03f2963d77a678f47eab5e3e29fc7e91bc9ca3a4
2015-07-29 12:53:05 +09:00
Jeffrey Vander Stoep
3fe84e009e am f05256b3: am 4b70dd4c: am 26f0f657: Merge "init.rc: add healthd to system group to allow write to /dev/cpuset" into mnc-dev
* commit 'f05256b32b815fc5d8be65e2fbc2e4a9f4da5ccd':
  init.rc: add healthd to system group to allow write to /dev/cpuset
2015-07-28 21:38:13 +00:00
Jeffrey Vander Stoep
f05256b32b am 4b70dd4c: am 26f0f657: Merge "init.rc: add healthd to system group to allow write to /dev/cpuset" into mnc-dev
* commit '4b70dd4c8f5c5c2baed8cb1f8436bf74971e20c6':
  init.rc: add healthd to system group to allow write to /dev/cpuset
2015-07-28 21:12:51 +00:00
Jeffrey Vander Stoep
4b70dd4c8f am 26f0f657: Merge "init.rc: add healthd to system group to allow write to /dev/cpuset" into mnc-dev
* commit '26f0f657ec027430bde7d2237890ba59b3fd174a':
  init.rc: add healthd to system group to allow write to /dev/cpuset
2015-07-28 20:07:55 +00:00
Jeffrey Vander Stoep
26f0f657ec Merge "init.rc: add healthd to system group to allow write to /dev/cpuset" into mnc-dev 2015-07-28 19:54:40 +00:00
Jeff Vander Stoep
a30a8e02dd init.rc: add healthd to system group to allow write to /dev/cpuset
Also add to root group to avoid introducting new bugs.

Bug: 22699101
Change-Id: I9da31e0cc955efd711df3f4c6b17e39d74c01549
2015-07-28 12:27:36 -07:00
Nick Kralevich
b4a5b3bac5 am b57ba047: am ba03cc95: am 5f3b05ad: Merge "init.rc: mkdir /data/anr 0775 system system"
* commit 'b57ba047805fd7a779927075be4581f03f3ad938':
  init.rc: mkdir /data/anr 0775 system system
2015-07-27 19:00:59 +00:00
Nick Kralevich
b57ba04780 am ba03cc95: am 5f3b05ad: Merge "init.rc: mkdir /data/anr 0775 system system"
* commit 'ba03cc953ff9076d5b01748912b102db43911f7f':
  init.rc: mkdir /data/anr 0775 system system
2015-07-27 18:50:31 +00:00
Nick Kralevich
c2ea70ae6e init.rc: mkdir /data/anr 0775 system system
Ensure that /data/anr always exists. This allows us to eliminate
some code in system_server and dumpstate. In addition, this change
solves a common problem where people would create the directory
manually but fail to set the SELinux label, which would cause
subsequent failures when they used the directory for ANRs.

Bug: 22385254
Change-Id: I29eb3deb21a0504aed07570fee3c2f87e41f53a0
2015-07-25 21:06:20 -07:00
Jeff Vander Stoep
9752a4696e am 552f23de: am 1d0fe13a: am 3f62a020: logd: allow logd to write to /dev/cpuset files
* commit '552f23deef9491f4e60b78f1ca6f89b7b60c5de2':
  logd: allow logd to write to /dev/cpuset files
2015-07-25 17:00:47 +00:00
Jeff Vander Stoep
552f23deef am 1d0fe13a: am 3f62a020: logd: allow logd to write to /dev/cpuset files
* commit '1d0fe13a9e720a88766b38070195670183274e30':
  logd: allow logd to write to /dev/cpuset files
2015-07-25 16:38:32 +00:00
Jeff Vander Stoep
1d0fe13a9e am 3f62a020: logd: allow logd to write to /dev/cpuset files
* commit '3f62a020c48d5d812fb2898759b93a59dc24d310':
  logd: allow logd to write to /dev/cpuset files
2015-07-25 00:59:33 +00:00
Jeff Vander Stoep
3f62a020c4 logd: allow logd to write to /dev/cpuset files
Required by logd on devices with USE_CPUSETS defined.

Make /dev/cpuset/background, /dev/cpuset/foreground and
/dev/cpuset/task writeable by system gid. Add logd to system
group for writing to cpuset files and to root group to avoid
regressions. When dropping privs, also drop supplementary groups.

Bug: 22699101
Change-Id: Icc01769b18b5e1f1649623da8325a8bfabc3a3f0
2015-07-24 16:22:06 +00:00
Riley Andrews
42525a1b24 am 7c1ae005: am e850f578: Disable scaling of the cfs tunables.
* commit '7c1ae0051d8492b12862f0983521883a1325bdd3':
  Disable scaling of the cfs tunables.
2015-07-21 21:44:03 +00:00
Riley Andrews
7c1ae0051d am e850f578: Disable scaling of the cfs tunables.
* commit 'e850f5786cdd4d3e4f1157db8785de3e6ff77eab':
  Disable scaling of the cfs tunables.
2015-07-21 21:15:37 +00:00
Riley Andrews
e850f5786c Disable scaling of the cfs tunables.
The cfs tunables auto-scale with the number of active cpus by default. Given
that the tunable settings are in device-independent code and it's not
known how many cores are currently active when the init.rc file runs,
the cfs tunables can vary pretty significantly across devices depending
on the state at boot. Disable scaling of the the tunables so that we
can get more consistent behavior of cfs across devices. If we want to
do per-device tuning of these values, we can override what's written
here in device specific files.

Bug: 22634118
Change-Id: Id19b24ef819fef762521e75af55e6d4378cfc949
2015-07-21 19:49:45 +00:00
Daniel Rosenberg
2a9e682c11 am b381f0a5: am 71ca82bf: am 8da23664: Merge "rootdir: Create cache folder in Android.mk"
* commit 'b381f0a5e11bf7a75ee0c06ddb4771a1312a1bea':
  rootdir: Create cache folder in Android.mk
2015-07-20 20:12:09 +00:00
Daniel Rosenberg
b381f0a5e1 am 71ca82bf: am 8da23664: Merge "rootdir: Create cache folder in Android.mk"
* commit '71ca82bf954c4bd5b8817eeabb78418fafde90ce':
  rootdir: Create cache folder in Android.mk
2015-07-20 19:58:51 +00:00
Daniel Rosenberg
8da23664e7 Merge "rootdir: Create cache folder in Android.mk" 2015-07-20 19:21:49 +00:00
Elliott Hughes
fc1a8c1d35 am 69b2c2a1: am 6657d224: am 069f62de: Merge "Fix N9 boot."
* commit '69b2c2a125f655a43f54a181d5ddbe714f4848ca':
  Fix N9 boot.
2015-07-18 18:15:57 +00:00
Elliott Hughes
69b2c2a125 am 6657d224: am 069f62de: Merge "Fix N9 boot."
* commit '6657d2248e902289476c4b937f5d6a1585c95ec2':
  Fix N9 boot.
2015-07-18 18:02:01 +00:00
Elliott Hughes
04b2022f7e Fix N9 boot.
Without this, sdcard fails to start because its mount point doesn't
exist.

Bug: http://b/22568628
Change-Id: Ic6a2f51fc74c5bd1f23d97592049495ac3822bb3
2015-07-18 10:34:53 -07:00
Daniel Rosenberg
86b151cbe8 rootdir: Create cache folder in Android.mk
system.img may contain the root directory as well. In that case, we
need to create some folders init.rc would during the build.

Change-Id: I312104ff926fb08d98ac8256b76d01b0a90ea5e5
2015-07-14 17:18:52 -07:00
Daniel Rosenberg
6e1fd8dde7 am 1c45c0ff: Merge "resolved conflicts for merge of 074ee014 to mnc-dr-dev-plus-aosp" into mnc-dr-dev-plus-aosp
* commit '1c45c0ff5d1cbd49d2d77fa837e1be0724fa77b3':
  Remove creation of root directory folders
2015-07-14 20:41:38 +00:00
Daniel Rosenberg
cfda5bb47a resolved conflicts for merge of 074ee014 to mnc-dr-dev-plus-aosp
Change-Id: I346583851035950350433136599f73ab2bedba4b
2015-07-14 13:12:48 -07:00
Daniel Rosenberg
6158942f27 am 26a81c1d: am f3cd170c: am 3470855e: Merge "rootdir: Create folders in Android.mk"
* commit '26a81c1d1a8f7c40cd79648edff0585bfc94e281':
  rootdir: Create folders in Android.mk
2015-07-14 15:50:15 +00:00
Daniel Rosenberg
26a81c1d1a am f3cd170c: am 3470855e: Merge "rootdir: Create folders in Android.mk"
* commit 'f3cd170cdbc1950a9c5efffb5c41c346c4cba298':
  rootdir: Create folders in Android.mk
2015-07-14 15:21:13 +00:00
Paul Crowley
b7f1f61fbc am ee923139: Merge "Set up user directory crypto in init." into mnc-dr-dev
* commit 'ee923139c346e6751203fc7d2a341388e01c7b19':
  Set up user directory crypto in init.
  logd: switch to unordered_map from BasicHashtable
  rootdir: make sure the /oem mountpoint is always available
2015-07-14 00:27:56 +00:00
Paul Lawrence
f3fbfaef22 am c1fa34b9: am d5ef9841: Merge "Change init sequence to support file level encryption" into mnc-dr-dev
* commit 'c1fa34b9f600c827769b4401d8b12e7c587b68f4':
  Change init sequence to support file level encryption
2015-07-13 22:39:08 +00:00
Paul Crowley
ee923139c3 Merge "Set up user directory crypto in init." into mnc-dr-dev 2015-07-13 20:52:45 +00:00
Paul Lawrence
c1fa34b9f6 am d5ef9841: Merge "Change init sequence to support file level encryption" into mnc-dr-dev
* commit 'd5ef984195779aa9e27d7baabdd751d641eea1a0':
  Change init sequence to support file level encryption
2015-07-13 17:53:08 +00:00
Daniel Rosenberg
64dffd3975 Remove creation of root directory folders
Folders in the root directory are now created during the build,
as we may be building without a ramdisk, and when we do that,
the root directory will be read-only.  With those changes,
these mkdirs will never need to run.

Change-Id: I49c63e8bfc71d28e3f938ed41f81d108359fa57a
2015-07-08 16:37:13 -07:00
Daniel Rosenberg
58458b66d4 rootdir: Create folders in Android.mk
system.img may contain the root directory as well. In that case, we
need to create some folders init.rc would during the build.

Change-Id: I157ccbebf36bee9916f3f584551704ec481ae1d1
2015-07-08 16:37:13 -07:00
Paul Lawrence
2ed2e30120 am e8308f85: am 81046166: Merge "Revert "Change init sequence to support file level encryption"" into mnc-dev
* commit 'e8308f852c867bc676e71875ea57de022464ea09':
  Revert "Change init sequence to support file level encryption"
2015-07-07 20:36:19 +00:00
Paul Lawrence
948410a493 Change init sequence to support file level encryption
File level encryption must get the key between mounting userdata and
calling post_fs_data when the directories are created. This requires
access to keymaster, which in turn is found from a system property.

Split property loaded into system and data, and load in right order.

Bug: 22233063
2015-07-07 13:23:19 -07:00
Paul Lawrence
e8308f852c am 81046166: Merge "Revert "Change init sequence to support file level encryption"" into mnc-dev
* commit '8104616696ac5e806b16a393ea02c4f5d8efc328':
  Revert "Change init sequence to support file level encryption"
2015-07-07 18:20:27 +00:00
Paul Lawrence
8104616696 Merge "Revert "Change init sequence to support file level encryption"" into mnc-dev 2015-07-07 17:29:00 +00:00
Paul Lawrence
437bc5dcec Revert "Change init sequence to support file level encryption"
This reverts commit d815178b75.

Change-Id: I7e3f55d3092fcd04ea9f62f1971c9d42570f096c
2015-07-07 17:05:58 +00:00
Andres Morales
d80e243411 am 722d4a54: am 833f142d: Merge "[init] start gatekeeperd after device decryption" into mnc-dev
* commit '722d4a54d9fa49581931e7c88fee5aa0c1f3c5f8':
  [init] start gatekeeperd after device decryption
2015-07-07 01:09:04 +00:00
Paul Lawrence
1c875cc40f am 22d0ee6a: am a65e402b: Merge "Change init sequence to support file level encryption" into mnc-dev
* commit '22d0ee6a25b3bedd6c3cd52473df1404fce8615f':
  Change init sequence to support file level encryption
2015-07-07 00:32:17 +00:00
Andres Morales
722d4a54d9 am 833f142d: Merge "[init] start gatekeeperd after device decryption" into mnc-dev
* commit '833f142d201a4b682885ff9d95c6b3ab32fd0618':
  [init] start gatekeeperd after device decryption
2015-07-06 23:57:49 +00:00
Andres Morales
833f142d20 Merge "[init] start gatekeeperd after device decryption" into mnc-dev 2015-07-06 23:00:09 +00:00
Paul Lawrence
22d0ee6a25 am a65e402b: Merge "Change init sequence to support file level encryption" into mnc-dev
* commit 'a65e402b613e927697d35e7936c6d80908d77e88':
  Change init sequence to support file level encryption
2015-07-06 20:34:05 +00:00
Andres Morales
4dd2982dd3 [init] start gatekeeperd after device decryption
gatekeeperd depends on having /data to determine whether
to call setup routines for qcom HALs.

Bug: 22298552
Change-Id: I6c552016dc863bbb04bd5a949a2317a720c8263f
2015-07-06 12:00:22 -07:00
Paul Lawrence
d815178b75 Change init sequence to support file level encryption
File level encryption must get the key between mounting userdata and
calling post_fs_data when the directories are created. This requires
access to keymaster, which in turn is found from a system property.

Split property loaded into system and data, and load in right order.

Bug: 22233063
Change-Id: I8a6c40d44e17de386417a443c9dfc3b4e7fe59a5
2015-07-06 07:52:06 -07:00
Jeff Sharkey
35e0cc552c am 96835733: am f38f29c8: Let\'s reinvent storage, yet again!
* commit '96835733b397da908c86e2a1190b8c8baf06a441':
  Let's reinvent storage, yet again!
2015-06-26 16:18:13 +00:00
Jeff Sharkey
96835733b3 am f38f29c8: Let\'s reinvent storage, yet again!
* commit 'f38f29c87d97cea45d04b783bddbd969234b1030':
  Let's reinvent storage, yet again!
2015-06-26 16:05:20 +00:00
Jeff Sharkey
f38f29c87d Let's reinvent storage, yet again!
Now that we're treating storage as a runtime permission, we need to
grant read/write access without killing the app.  This is really
tricky, since we had been using GIDs for access control, and they're
set in stone once Zygote drops privileges.

The only thing left that can change dynamically is the filesystem
itself, so let's do that.  This means changing the FUSE daemon to
present itself as three different views:

/mnt/runtime_default/foo - view for apps with no access
/mnt/runtime_read/foo - view for apps with read access
/mnt/runtime_write/foo - view for apps with write access

There is still a single location for all the backing files, and
filesystem permissions are derived the same way for each view, but
the file modes are masked off differently for each mountpoint.

During Zygote fork, it wires up the appropriate storage access into
an isolated mount namespace based on the current app permissions.  When
the app is granted permissions dynamically at runtime, the system
asks vold to jump into the existing mount namespace and bind mount
the newly granted access model into place.

Bug: 21858077
Change-Id: I5a016f0958a92fd390c02b5ae159f8008bd4f4b7
2015-06-25 22:27:04 -07:00