Commit graph

1606 commits

Author SHA1 Message Date
William Roberts
02e4d8eac7 Merge "init: cleanup exec_service documentation" am: 61559e491e am: b46b61049b am: bd633d8e2a
am: 1b9708bc54

Change-Id: Ibca7920b0d46e322c366a4322d45e77a75f907bd
2017-05-04 20:19:53 +00:00
William Roberts
1b9708bc54 Merge "init: cleanup exec_service documentation" am: 61559e491e am: b46b61049b
am: bd633d8e2a

Change-Id: I531326d860dae9d80a02b6f322553b9b38bcbfec
2017-05-04 20:14:32 +00:00
Treehugger Robot
61559e491e Merge "init: cleanup exec_service documentation" 2017-05-04 19:54:17 +00:00
William Roberts
323d5791b4 init: cleanup exec_service documentation
The exec_service documentation was difficult to read, clarify it.

Tests:
Run grip.py to verify that the markdown still works correctly.
Run aspell to verify spelling.

Change-Id: I29bdd456f3d3ea2a91c9d4772bd09a5a195f97a9
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-05-04 11:14:23 -07:00
Jin Qian
1e59ce40e3 Merge "init: manually restorecon mke2fs tools on ramdisk" am: e2629c5682 am: 06c1500a14 am: 2ce5eb91c0
am: 6cfade736d

Change-Id: Ibeaad1051f46537debb696b69c12acdd460cb336
2017-05-04 02:20:13 +00:00
Jin Qian
6cfade736d Merge "init: manually restorecon mke2fs tools on ramdisk" am: e2629c5682 am: 06c1500a14
am: 2ce5eb91c0

Change-Id: I401394f4569ee0783b8bac17a1187634558cf553
2017-05-04 02:17:50 +00:00
Treehugger Robot
e2629c5682 Merge "init: manually restorecon mke2fs tools on ramdisk" 2017-05-04 02:07:02 +00:00
Mark Salyzyn
b3d51c164a Merge changes Ieb44fa8f,I01b26fe5 am: e1e3e20337 am: d8dc29df8e am: b519cb5e14
am: b48c99a93d

Change-Id: I600b81d4e0ddcb7cf2114d0899291906c1138408
2017-05-03 23:52:16 +00:00
Mark Salyzyn
b48c99a93d Merge changes Ieb44fa8f,I01b26fe5 am: e1e3e20337 am: d8dc29df8e
am: b519cb5e14

Change-Id: I0154f15f4b8b0dc7216ee16bc3f9eeb79fc90458
2017-05-03 23:38:40 +00:00
Treehugger Robot
e1e3e20337 Merge changes Ieb44fa8f,I01b26fe5
* changes:
  init: setup keyring before ueventd starts
  logd: refine permissions to access /data/system/packages.list
2017-05-03 23:24:14 +00:00
Jin Qian
2d019f859b init: manually restorecon mke2fs tools on ramdisk
Files in the ramdisk by default have the rootfs label and must be
manually restoreconed.

Bug: 35219933
Change-Id: I2a749f128dc3a609907101ce703747f8990b4386
2017-05-03 16:15:45 -07:00
Tom Cherry
fd9ffbb917 Merge "init: use do_exec() for init_user0" am: 5ad06cbb1c am: 577c75e78c am: bc8a4ad7aa
am: 10cdd5bbf1

Change-Id: I3fa46dc57426738550beffb71932e06a0407c68c
2017-05-03 22:35:58 +00:00
Tom Cherry
10cdd5bbf1 Merge "init: use do_exec() for init_user0" am: 5ad06cbb1c am: 577c75e78c
am: bc8a4ad7aa

Change-Id: I9985eb2751d14c6562b7559ffa6d0c72253df591
2017-05-03 22:30:41 +00:00
Mark Salyzyn
4599627492 init: setup keyring before ueventd starts
Invent keyutils.h to supply capability to set session keyring.
The keyring will hold things like the FBE encryption keys.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics
Bug: 37751120
Bug: 36645158
Change-Id: Ieb44fa8f53dda6cf506a6243498c72d7f7f3cde7
2017-05-03 21:51:04 +00:00
Tom Cherry
5a86cb7694 init: use do_exec() for init_user0
Similar to what installkey used to do, init_user0 forks and
synchronously waits for vdc to return.  This is dangerous to do in
init however as init also processes properties from a single thread.

I'm not aware of any specific issues that this is currently causing,
but it's a good preventative measure to match what installkey does and
use do_exec().

Test: Boot bullhead, see that init_user0 still happens
Change-Id: I853c61594fe3d97e91bbb2319ebddf2bbe80d457
2017-05-03 13:25:08 -07:00
Tom Cherry
d2c9acddd0 Merge "ueventd: do not reference init's sehandle" am: 672dd970f4 am: e4988c9a34 am: 4c664d8c5c
am: 214e45a5a7

Change-Id: I9e73d1849df48dffd886f47c2b358f36309918c0
2017-05-03 18:41:59 +00:00
Tom Cherry
214e45a5a7 Merge "ueventd: do not reference init's sehandle" am: 672dd970f4 am: e4988c9a34
am: 4c664d8c5c

Change-Id: I7da9e9417afcd8a2cfa9d7ac75d58c75cc39f21d
2017-05-03 18:25:46 +00:00
Tom Cherry
672dd970f4 Merge "ueventd: do not reference init's sehandle" 2017-05-03 18:14:38 +00:00
Bowgo Tsai
b6ef944a86 Merge "init: fix first stage mount failure due to /dev/device-mapper not found" am: 0447a3e5d1 am: ad7c7fe1aa am: fd13c70104
am: ec0d2ce60e

Change-Id: Id5d27476aee25c6019adb4f2ccee9dee580da497
2017-05-03 01:44:41 +00:00
Bowgo Tsai
ec0d2ce60e Merge "init: fix first stage mount failure due to /dev/device-mapper not found" am: 0447a3e5d1 am: ad7c7fe1aa
am: fd13c70104

Change-Id: Ia9da2e7f83350a955ee7ec9c920b2b7eabc87ead
2017-05-03 01:42:09 +00:00
Bowgo Tsai
ea5fca4cd0 init: fix first stage mount failure due to /dev/device-mapper not found
It has been reported that fs_mgr failed to open /dev/device-mapper
during the first stage mount. It's because other uevent (e.g., i2c
charger device) happens to be sent at the same time we're triggering
the device-mapper uevent to be sent. Current implementation returns
COLDBOOT_STOP unconditionally so it will only process the first received
uevent, leaving device-mapper uevent unhandled when the race happens.

Fix this by only returning COLDBOOT_STOP when the received uevent->path
matches that of device mapper.

Bug: 37745254

Test: first stage mount /vendor with vboot 2.0 (avb) on bullhead
Test: first stage mount /vendor with vboot 1.0 on sailfish
Change-Id: I4a77093ec8f90a5ca981a088f34d082d0270533b
2017-05-03 00:38:43 +08:00
Tom Cherry
29da2ad7a0 Merge "init: add an initializer for keychord_id_" am: 7c3f147070 am: e2865c0f54 am: ea3434e0dd
am: 67dfc3e691

Change-Id: Ia6cba845dff02ef112eabcf8f0236e08b89167b8
2017-05-02 00:41:01 +00:00
Tom Cherry
67dfc3e691 Merge "init: add an initializer for keychord_id_" am: 7c3f147070 am: e2865c0f54
am: ea3434e0dd

Change-Id: Ib640d4e04f223d353e6dd8f762acf57792532150
2017-05-02 00:38:32 +00:00
Tom Cherry
7c3f147070 Merge "init: add an initializer for keychord_id_" 2017-05-02 00:30:17 +00:00
Tom Cherry
e7656b7200 ueventd: do not reference init's sehandle
Init exposes a global 'sehandle' that ueventd references as part of
devices.cpp and util.cpp.  This is particularly dangerous in
device_init() in which both uevent and init write to this global.

This change creates a separate local copy for devices.cpp and puts
restrictions on where init.h can be included to make sure the global
used by init is not reference by non-init code.  Future changes to
init should remove this global.

Test: Boot bullhead

Change-Id: Ifefa9e1932e9d647d06cca2618f5c8e5a7a85460
2017-05-01 17:22:49 -07:00
Tom Cherry
cec3b93f35 Merge "ueventd: remove leftovers of the SELinux policy update mechanism" am: 6a8314c8bf am: c2c8f5e0dc am: e1977a3afb
am: 31c0221c04

Change-Id: I49d606f6a453b48476432bc235d953c80962d3a9
2017-05-01 23:08:44 +00:00
Tom Cherry
99c2d7550d Merge "ueventd: fix typo from previous patchset" am: c8877530c7 am: 4be091d588 am: 977f21e7bc
am: d5b743c3f3

Change-Id: I0226d894dd0c4891c386deb77edef6e43abf1551
2017-05-01 23:08:23 +00:00
Tom Cherry
31c0221c04 Merge "ueventd: remove leftovers of the SELinux policy update mechanism" am: 6a8314c8bf am: c2c8f5e0dc
am: e1977a3afb

Change-Id: I9f1df3427e3b3c7f1fa62d86f9b6996d86e21b22
2017-05-01 22:59:29 +00:00
Tom Cherry
d5b743c3f3 Merge "ueventd: fix typo from previous patchset" am: c8877530c7 am: 4be091d588
am: 977f21e7bc

Change-Id: I8823eb8f73249424ebc57d7d3551b21e01e8badf
2017-05-01 22:51:21 +00:00
Tom Cherry
6a8314c8bf Merge "ueventd: remove leftovers of the SELinux policy update mechanism" 2017-05-01 22:48:29 +00:00
Tom Cherry
7da548578c init: add an initializer for keychord_id_
Add unit test to ensure all POD types of Service are initialized.

Bug: 37855222
Test: Ensure bugreport is triggered via keychord properly.
Test: New unit tests
Change-Id: If2cfea15a74ab417a7b909a60c264cb8eb990de7
2017-05-01 15:35:07 -07:00
Tom Cherry
f51c66b23b ueventd: fix typo from previous patchset
An forward declaration for a function that was removed in later
patchsets was merged anyway.  Since it's not used anywhere, this CL
removes it.

Test: build bullhead
Change-Id: Ie7223f7d23305b71438cb063b64a574ce32f96bb
2017-05-01 10:53:39 -07:00
Tom Cherry
6daf514448 ueventd: remove leftovers of the SELinux policy update mechanism
Reloading sepolicy has been removed from the system, so this support
code can also now be removed.

Bug: 26544104
Test: Boot bullhead
Change-Id: If9dbc9d540d9a69340c1dd6a483c1f8fe5feb287
2017-05-01 10:39:03 -07:00
Keun-young Park
9483be8a00 Merge "combine wait for exec log with service exit log" am: 483d2f9a59 am: 010efc6a1c am: b85523e64e
am: 58689cb421

Change-Id: If8e7055ef4f98c256a30d0719bcb157af0010e85
2017-04-28 20:55:13 +00:00
Keun-young Park
58689cb421 Merge "combine wait for exec log with service exit log" am: 483d2f9a59 am: 010efc6a1c
am: b85523e64e

Change-Id: If4e052913653de1feebde4799d19c282255f5ede
2017-04-28 20:40:13 +00:00
Keun-young Park
4de31e1481 combine wait for exec log with service exit log
- allows easier tracking of wait time from monitoring tools
- this change also reduces unnecessary log spam
- service exit log looks like this:
  init: Service 'exec 4 (/system/bin/otapreopt_slot)' (pid 611) exited with status 0 waiting took 0.060771 seconds

bug: 37752410
Test: reboot and check log
Change-Id: I122902538697f33939eede548e39f155ec419e03
2017-04-28 11:20:12 -07:00
Tom Cherry
ffc791f045 Merge "init: fix last_reboot_reason string" am: 59c74a3bd1 am: 2be5884903 am: 8705f89826
am: 07ea1a8833

Change-Id: I8a0cacba81809ad93c118d28a3adf8e15514c3c9
2017-04-27 20:59:06 +00:00
Tom Cherry
07ea1a8833 Merge "init: fix last_reboot_reason string" am: 59c74a3bd1 am: 2be5884903
am: 8705f89826

Change-Id: Idaf8218594f50b860fdd9e5d12b8e6f7a4fe0e68
2017-04-27 20:29:32 +00:00
Treehugger Robot
59c74a3bd1 Merge "init: fix last_reboot_reason string" 2017-04-27 19:39:53 +00:00
Keun-young Park
29f4ee9d36 Merge "set default shutdown timeout to 6 secs" am: 47d15ed5b9 am: 0020d4c076 am: 09c780db3a
am: 6c61e087e4

Change-Id: I5ed4c11b86d3976c383f0b16b4b96ffd141830ef
2017-04-26 22:55:32 +00:00
Keun-young Park
6c61e087e4 Merge "set default shutdown timeout to 6 secs" am: 47d15ed5b9 am: 0020d4c076
am: 09c780db3a

Change-Id: I38ec920f5034b2adc9ab8354144cae1fe554d753
2017-04-26 22:49:02 +00:00
Keun-young Park
47d15ed5b9 Merge "set default shutdown timeout to 6 secs" 2017-04-26 22:35:26 +00:00
Keun-young Park
8b6d2e5709 Merge "do not start shutdown animation from init" am: 84d43c8df7 am: 76a3b3ce5c am: a15436569f
am: b549370bf3

Change-Id: I96c9073b313a4f8ef372d879ef20473b1c3beda9
2017-04-26 21:43:44 +00:00
Keun-young Park
8f30907d6f Merge "add additional dump for timeout" am: 8cde09064e am: fadad58262 am: 606df0e2cb
am: 5b1300c154

Change-Id: Idc66e41d351ac05614e8e3184005981faf755012
2017-04-26 21:43:28 +00:00
Keun-young Park
b549370bf3 Merge "do not start shutdown animation from init" am: 84d43c8df7 am: 76a3b3ce5c
am: a15436569f

Change-Id: I5fea05ff1c4d5cfb2d50b9aab7805d229c43d89b
2017-04-26 21:27:01 +00:00
Keun-young Park
5b1300c154 Merge "add additional dump for timeout" am: 8cde09064e am: fadad58262
am: 606df0e2cb

Change-Id: I386ee368f2fd08575b69cc776ea2ccee55bdd225
2017-04-26 21:26:43 +00:00
Treehugger Robot
84d43c8df7 Merge "do not start shutdown animation from init" 2017-04-26 20:59:56 +00:00
Keun-young Park
7feab68238 set default shutdown timeout to 6 secs
- Test data shows that most shutdown finishes in 6 secs.
- The original 10 secs is too long wih no shutdown animation
  running in screen.

bug: 36657139
Test: check time with reboot
Change-Id: I9a805ddfde8156b066485902048d0cd01365c453
2017-04-26 13:58:31 -07:00
Keun-young Park
8cde09064e Merge "add additional dump for timeout" 2017-04-26 20:53:21 +00:00
Tom Cherry
f7ae77097c Merge changes Ibe91fd2d,I59e2bd9e am: b0a14f8feb am: 4ba72d9b73 am: 9ef76bdc72
am: a52ce58d2e

Change-Id: I94cfb446fbb3db2c90f8bc6e8bbfe6d0a7336bdd
2017-04-26 20:06:02 +00:00