Commit graph

1678 commits

Author SHA1 Message Date
Tom Cherry
a2e2281896 Merge "Move restorecon() of /sys from init to ueventd." into oc-dev-plus-aosp
am: a3598113ad

Change-Id: I3ec4d5957fddcf04e4a82bc00fc418b2327354e5
2017-06-19 19:44:20 +00:00
TreeHugger Robot
a3598113ad Merge "Move restorecon() of /sys from init to ueventd." into oc-dev-plus-aosp 2017-06-19 19:36:56 +00:00
Tom Marshall
2d9293954c Merge "init: Run restorecon_recursive asynchronously" am: ad4aa9e169 am: 0329b8d03e
am: ebd6a64694

Change-Id: Id6ff385d4421af87834abe431c11bddd98583fe1
2017-06-19 18:11:43 +00:00
Tom Marshall
ebd6a64694 Merge "init: Run restorecon_recursive asynchronously" am: ad4aa9e169
am: 0329b8d03e

Change-Id: I1cd56fc9521451742b04d7f56bc0b657a0672314
2017-06-19 18:06:14 +00:00
Tom Cherry
c3e955123c Move restorecon() of /sys from init to ueventd.
ueventd already does restorecon() for /sys/{block,class,devices}, so
instead of duplicating this effort with init, move the restorecon()
that init does for all of /sys to ueventd.

Bug: 62420036
Change-Id: I6125f8ff5316a0cf45872d1100d089d71802958f
Test: Boot sailfish, bullhead
2017-06-19 10:59:06 -07:00
Tom Marshall
62696908ff init: Run restorecon_recursive asynchronously
restorecon_recursive may take a long time if there are a lot of files on
the volume.  This can trigger a watchdog timeout in any process that
tries to set a property while it is running.  Fix this by running
restorecon_recursive in its own process.

See https://jira.lineageos.org/browse/BUGBASH-555

Change-Id: I2ce26ff2b5bfc9a133ea42f4dbac50a3ac289c04
2017-06-16 18:00:08 -07:00
Chih-Hung Hsieh
f13c54c5ed Merge "Revert workaround of clang-tidy segmentation fault." am: 243ab9cc7e am: b547153143
am: 952005b1df

Change-Id: I1f168da658d44af26f121384f76a3d3246804560
2017-06-15 19:10:56 +00:00
Chih-Hung Hsieh
952005b1df Merge "Revert workaround of clang-tidy segmentation fault." am: 243ab9cc7e
am: b547153143

Change-Id: I59dea6f8aa2a6558594280efe07314070643642a
2017-06-15 19:08:30 +00:00
Treehugger Robot
243ab9cc7e Merge "Revert workaround of clang-tidy segmentation fault." 2017-06-15 18:57:51 +00:00
Tom Cherry
98dd8978aa Merge "init: move killing of process groups to libprocessgroup" am: fbbb3bd49a am: 8040f8eb82
am: 9f91d2692c

Change-Id: Ide2da0ed71dfa132425cddaf654b45b712da97f3
2017-06-15 17:30:19 +00:00
Tom Cherry
9f91d2692c Merge "init: move killing of process groups to libprocessgroup" am: fbbb3bd49a
am: 8040f8eb82

Change-Id: Ie63521a9114ca407c3c40aae3099cf3e94fdfac6
2017-06-15 17:27:55 +00:00
Tom Cherry
fbbb3bd49a Merge "init: move killing of process groups to libprocessgroup" 2017-06-15 17:17:22 +00:00
Chih-Hung Hsieh
47bd75701b Revert workaround of clang-tidy segmentation fault.
Problem was fixed in new rebased clang-tidy.
Bug: 38002385
Test: build with WITH_TIDY=1
Change-Id: Ic22d016fb2d402c3eee16226be507f5d4cfa2818
2017-06-15 10:05:04 -07:00
Bowgo Tsai
539518269d Merge "first stage mount: removing the restriction of mount points" am: 5218d69817 am: 7d491a0a7b
am: 7f6df5ddf9

Change-Id: I173bcf7f3989c38d4bf2b08d5cae627b5f47ffc4
2017-06-09 02:00:38 +00:00
Bowgo Tsai
7f6df5ddf9 Merge "first stage mount: removing the restriction of mount points" am: 5218d69817
am: 7d491a0a7b

Change-Id: Idd5dc13632631de213aa341ddcfca9186c2f8510
2017-06-09 01:58:10 +00:00
Bowgo Tsai
06ed613e73 first stage mount: removing the restriction of mount points
Current first stage mount only allows three mount points: system, vendor
and/or odm. This was introduced by project Treble to mount those
verified partitions early. However, there might be some other custom
partitions needs to be mounted early as well. This CL removes the
restriction and does first stage mount for whatever specified in
fstab-dt.

Bug: 62423887
Test: first stage mount /vendor with vboot 1.0
Test: first stage mount /vendor with vboot 2.0 (AVB)

Change-Id: I6c146c64e673c35c2823523ccbde193590430c48
2017-06-08 11:30:12 +08:00
Tom Cherry
70a5ed49ef init: move killing of process groups to libprocessgroup
libprocessgroup kills the cgroup associated with a given pid and uid,
but not the POSIX process group associated with it.  This means that
to kill both, two of the same signals must be sent, which may cause
some issues.

This change kills all POSIX process groups whose group leaders are
found within a cgroup.  It only then kills processes in the cgroup
that are not part of the POSIX process groups that have been killed.

Bug: 37853905
Bug: 62418791
Test: Boot, kill zygote, reboot
Change-Id: Id1d96935745899b4c454c36c351ec16a0b1d3827
2017-06-07 13:20:21 -07:00
Tom Cherry
2d707e0955 Merge "ueventd: parallelize uevent handling" am: 70431b1f22 am: ed75c00f72 am: 27fc35ace4
am: 573287de3a

Change-Id: I3e5917ff58df1d59ae8ed7bf75bf5fa01eb7f137
2017-06-02 22:06:07 +00:00
Tom Cherry
573287de3a Merge "ueventd: parallelize uevent handling" am: 70431b1f22 am: ed75c00f72
am: 27fc35ace4

Change-Id: Ib243f67c5be0822805c457106f5b8ab7cd013989
2017-06-02 22:02:42 +00:00
Tom Cherry
c583305ed7 ueventd: parallelize uevent handling
fork() subprocesses to handle uevents in parallel.

This reduces coldboot time on bullhead from ~446ms to ~230ms.
This reduces coldboot time on sailfish from ~690ms to ~360ms.
This reduces coldboot time on ryu from ~187ms to ~122ms.

Bug: 33785894

Test: boot bullhead x40, observe no major differences in /dev and /sys
Test: boot sailfish x40, observe no major differences in /dev and /sys
Test: boot ryu x40, observe no major differences in /dev and /sys
Test: boottime tests on bullhead and sailfish
Test: init unit tests

Change-Id: Ie2f63e000b8af78d187477d31fe109f20304d749
2017-06-02 21:45:56 +00:00
Tom Cherry
f53603bf73 Merge "init: allow ':' in property names" am: af95ecdb04 am: 6d2a27768d am: 3d2aa93e1d
am: 6eac551c34

Change-Id: I5b12c6e69f2ac1e124b48eaca32a6800a37f64d6
2017-05-31 00:08:41 +00:00
Tom Cherry
6eac551c34 Merge "init: allow ':' in property names" am: af95ecdb04 am: 6d2a27768d
am: 3d2aa93e1d

Change-Id: I7082ab0c50b7eda1e32b241c2408460c15b7e936
2017-05-31 00:01:39 +00:00
Tom Cherry
1369379e33 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
2017-05-30 13:45:28 -07:00
Tom Cherry
17b0eeb732 Merge "ueventd: Break devices.cpp into discrete classes" am: c495e059b7 am: 18d0144e6c am: cc0e43c8dd
am: c3579f0b06

Change-Id: I13665c1c9a4d66f50fd3c993e2bcd7d8765cdb8e
2017-05-26 00:25:36 +00:00
Tom Cherry
c3579f0b06 Merge "ueventd: Break devices.cpp into discrete classes" am: c495e059b7 am: 18d0144e6c
am: cc0e43c8dd

Change-Id: I91dd47dcc55093a79a4b87f992191bcabe19f6bc
2017-05-26 00:22:10 +00:00
Tom Cherry
ed506f7356 ueventd: Break devices.cpp into discrete classes
devices.cpp handles too many things for creating one class.  This
change breaks it up into various files and classes.

* Parsing is moved to ueventd_parser.cpp
* Reading from the uevent socket and Cold booting is moved to a
  UeventListener class, in uevent_listener.cpp
* Firmware handling is moved to firmware_handler.cpp
* The remaining contents form a DeviceHandler class within devices.cpp

Bug: 33785894

Test: boot bullhead x40, observe no major differences in /dev and /sys
Test: boot sailfish x40, observe no major differences in /dev and /sys
Test: init unit tests

Change-Id: I846a2e5995fbb344c7a8e349065c18a934fa6aba
2017-05-25 16:17:19 -07:00
Elliott Hughes
99f28f61c2 Merge "Revert "Load {default,build}.prop from /{system,vendor,odm}/etc/"" am: f9259b59e8 am: b2f12e42ca am: 22cdddecba
am: 3e9223f460

Change-Id: Icedc316c4b33a94cc19683213dbdd76e787362bb
2017-05-25 18:21:13 +00:00
Elliott Hughes
3e9223f460 Merge "Revert "Load {default,build}.prop from /{system,vendor,odm}/etc/"" am: f9259b59e8 am: b2f12e42ca
am: 22cdddecba

Change-Id: I6e41d84c76a0d1f31e54d5422638817905f202f4
2017-05-25 18:18:40 +00:00
Hung-ying Tyan
3346338919 Revert "Load {default,build}.prop from /{system,vendor,odm}/etc/"
This reverts commit 723f1a2b31.

Bug: 62075509
2017-05-25 19:18:17 +08:00
Hung-ying Tyan
b1211e9368 Merge "Load {default,build}.prop from /{system,vendor,odm}/etc/" am: a9aa77d259 am: 26c4bcfadd am: 0cd0d52147
am: a22e004f57

Change-Id: Ife17941907dd35507b95c56fe587f83003341684
2017-05-25 02:49:11 +00:00
Hung-ying Tyan
a22e004f57 Merge "Load {default,build}.prop from /{system,vendor,odm}/etc/" am: a9aa77d259 am: 26c4bcfadd
am: 0cd0d52147

Change-Id: Ide638286886cef323e8bb049f5baf4bbe659c47a
2017-05-25 02:46:10 +00:00
Treehugger Robot
a9aa77d259 Merge "Load {default,build}.prop from /{system,vendor,odm}/etc/" 2017-05-25 02:32:37 +00:00
Hung-ying Tyan
723f1a2b31 Load {default,build}.prop from /{system,vendor,odm}/etc/
/default.prop may be moved to /system/etc/ and renamed as prop.default.
/{system,vendor,odm}/build.prop may be moved to /{system,vendor,odm}/etc/
and renamed as prop.build.
This patch makes property_service load prop.* from the new locations
first. Also replaces NULL with nullptr for C++ cleanup.

Bug: 37815285
Test: Booted pixel phones, checked the locations of prop.*, verified
      symlinks, checked a few properties (via adb shell getprop)
      and manually tested a few apps (Camera, Maps etc).
      ODM is not tested as it does not exist on the tested device.
Change-Id: Id8eeb3c1a5728dd04005dfad4733b8e6336f9093
2017-05-25 08:41:08 +08:00
Tom Cherry
7343f9e306 Merge "init: start move to Android.bp" am: 276f765984 am: 062657cf2b am: b37cabbfef
am: ed7c02aadf

Change-Id: I57621ed582c6e82f0ecc07b1da566ce19b9faeda
2017-05-23 02:32:15 +00:00
Tom Cherry
ed7c02aadf Merge "init: start move to Android.bp" am: 276f765984 am: 062657cf2b
am: b37cabbfef

Change-Id: Id1960b4bfb537719e52023edc4c3f808d47996ab
2017-05-23 02:29:04 +00:00
Tom Cherry
14fc01301d init: start move to Android.bp
Move libinit, init_tests, and test_service to Android.bp
Leave init in Android.mk as it has unfulfilled dependencies, but
create a comment in Android.bp for future use.
Remove libinit_parser and init_parser_tests as that code was never
used in init.

Bug: 36970783
Bug: 37512442
Test: Build, boot bullhead, init unit tests
Change-Id: Id81cd10ea09453a5fd762ba9189276aad79d5444
2017-05-22 13:30:04 -07:00
Tom Cherry
fe6e19cbeb Revert "Add test config to init_tests"
This reverts commit bdfd395e47.

We want to keep AOSP and internal master in sync and since this isn't
being used, instead of cherry-picking to AOSP, we'll revert from internal.

Test: Build
Change-Id: I161b4c7187ec260841605149b7eee7df64434246
2017-05-22 13:27:17 -07:00
Elliott Hughes
7826f29f86 Merge "Merge "init should #include <sys/sysmacros.h>" am: 64e3f88d69 am: 29b41dce6d am: 8cdef644b3" into oc-dev-plus-aosp
am: 22c5e80458

Change-Id: I74601341eca56298c0404e05e098f40ea05b80da
2017-05-18 23:08:35 +00:00
Elliott Hughes
f42957f907 Merge "init should #include <sys/sysmacros.h>" am: 64e3f88d69 am: 29b41dce6d
am: 8cdef644b3

Change-Id: I57cbaa68240c2c0127a246f7536e0dc8d9cd4f80
2017-05-18 23:03:32 +00:00
Treehugger Robot
64e3f88d69 Merge "init should #include <sys/sysmacros.h>" 2017-05-18 22:47:59 +00:00
Keun-young Park
84f262b3f3 Merge "add ueventd to shutdown critial process" am: 7fe28d9d9a am: aa3c4e9def am: 939f0b03e8
am: 39f7c6b296

Change-Id: I23eff785c507587c47a557b27b2d9b2129c66462
2017-05-18 21:19:22 +00:00
Keun-young Park
39f7c6b296 Merge "add ueventd to shutdown critial process" am: 7fe28d9d9a am: aa3c4e9def
am: 939f0b03e8

Change-Id: I77544ec21c3db09edc515af79f329bc6d44116e9
2017-05-18 21:14:51 +00:00
Keun-young Park
7264bee975 add ueventd to shutdown critial process
- In some devices, some drivers still try to load firmware while shutting
  down, and crashes the kernel. So keep ueventd to prevent such case.

bug: 38203024
Test: reboots
Change-Id: I4f1910723254ccb69f8e9c78e8727fbd8c7eed3e
2017-05-18 20:58:10 +00:00
Elliott Hughes
51056c49d2 init should #include <sys/sysmacros.h>
Bug: https://github.com/android-ndk/ndk/issues/398
Test: builds
Change-Id: I6428a6344a3ce649bd03ff9e9b0f156425c67f0c
2017-05-18 09:13:15 -07:00
Elliott Hughes
62ee93d7a8 Merge "Add libkeyutils." am: 81824ebf1f am: dce08d5572
am: 971e77c5c0

Change-Id: Ibe5aa5bfca03727c3c1d1dbee8941c451d76885f
2017-05-13 00:44:29 +00:00
Elliott Hughes
81824ebf1f Merge "Add libkeyutils." 2017-05-13 00:28:28 +00:00
Elliott Hughes
8fc5f81efe Merge "Add libkeyutils." 2017-05-11 17:38:17 +00:00
Chih-Hung Hsieh
64dbdb53d4 Merge "Work around clang-tidy segmentation fault." am: d761dd747e am: 4a926efc49 am: 3f9923cf7f
am: 0d1879dd8c

Change-Id: I97b1f3f49cafe5e4beeb10ddb76fc47b7cc54850
2017-05-11 01:07:17 +00:00
Chih-Hung Hsieh
0d1879dd8c Merge "Work around clang-tidy segmentation fault." am: d761dd747e am: 4a926efc49
am: 3f9923cf7f

Change-Id: I5207bb2b06902b248137edeef6be3ac167ee62de
2017-05-11 00:23:21 +00:00
Treehugger Robot
d761dd747e Merge "Work around clang-tidy segmentation fault." 2017-05-10 23:11:19 +00:00