Commit graph

1661 commits

Author SHA1 Message Date
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
Elliott Hughes
1eeee96676 Add libkeyutils.
Also move init over to it.

Bug: http://b/37991155
Test: builds+boots
Change-Id: I5113a9d96a5ce0a0f3bad71134d6cc4f7b41a57e
2017-05-10 14:53:28 -07:00
Elliott Hughes
f8627cea7f Add libkeyutils.
Also move init over to it.

Bug: http://b/37991155
Test: builds+boots
Change-Id: I5113a9d96a5ce0a0f3bad71134d6cc4f7b41a57e
2017-05-10 10:40:11 -07:00
Bowgo Tsai
8301fcfcf5 Merge "first stage mount: removing the requirement of by-name prefix for AVB" am: cdad92fdad am: c82235ebbd am: fec0b13902
am: acef4a9a09

Change-Id: I51e8a7df3db76a7cd626ee2ad2960abc5ec2256d
2017-05-10 03:20:12 +00:00
Bowgo Tsai
acef4a9a09 Merge "first stage mount: removing the requirement of by-name prefix for AVB" am: cdad92fdad am: c82235ebbd
am: fec0b13902

Change-Id: I7dec7f517b5b1c601b4372a431789aba1375fbee
2017-05-10 02:11:06 +00:00
Treehugger Robot
cdad92fdad Merge "first stage mount: removing the requirement of by-name prefix for AVB" 2017-05-10 01:37:28 +00:00
Tom Cherry
1863fe56d7 Merge changes I172acf0f,I97b6e17a am: 4963b42d7b am: 09b0da7b10 am: 7c0f21074e
am: 795b3296ed

Change-Id: I6c101b2ce7d43cb692aebefbd3411bd0e81728dd
2017-05-09 19:24:52 +00:00
Tom Cherry
795b3296ed Merge changes I172acf0f,I97b6e17a am: 4963b42d7b am: 09b0da7b10
am: 7c0f21074e

Change-Id: I5c261b9cd4ac7a3e4f10b7c39af057d93f3c74c1
2017-05-09 18:49:39 +00:00
Tom Cherry
4963b42d7b Merge changes I172acf0f,I97b6e17a
* changes:
  init: change kill order and fix error reporting in KillProcessGroup()
  Better logging in libprocessgroup and make resources clean up themselves
2017-05-09 17:45:48 +00:00
Bowgo Tsai
20651f62d0 first stage mount: removing the requirement of by-name prefix for AVB
Current first stage mount for AVB requires specifying a common prefix of
by-name symlink for all AVB partitions. It limits all AVB partitions to be on
the same block device.

firmware {
    android {
        compatible = "android,firmware";
        vbmeta {
            compatible = "android,vbmeta";
            parts = "vbmeta,boot,system,vendor";
            by_name_prefix="/dev/block/platform/soc.0/f9824900.sdhci/by-name"  <-- *removing this*
        };
        fstab {
            compatible = "android,fstab";
            vendor {
                compatible = "android,vendor";
                dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor";
                type = "ext4";
                mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
                fsmgr_flags = "wait,avb";
            };
        };
    };
};

For normal mount with AVB, it extracts the by-name prefix of /misc
partition and use it as the prefix for all other partitions:
    - /dev/block/platform/soc.0/f9824900.sdhci/by-name/misc ->
    - /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor_a

Fix this by adding an internal map in FsManagerAvbOps to record the mapping
from partition name to its by-name symlink:

    ByNameSymlinkMap["vendor_a"] = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor_a"

Two overloaded factory methods are then provided for FsManagerAvbUniquePtr:
    - FsManagerAvbUniquePtr Open(ByNameSymlinkMap&& by_name_symlink_map):
      for first stage mount, where the by-name symlink map will be
      constructed externally, from the uevents processed by init, before
      invoking this factory method.

    - FsManagerAvbUniquePtr Open(const fstab& fstab): for normal mount,
      where the by-name symlink map will be constructed from the input fstab
      internally.

Bug: 37552224
Test: first stage mount /vendor with vboot 1.0
Test: first stage mount /vendor with vboot 2.0 (AVB)
Test: normal mount /vendor with vboot 2.0 (AVB)
Change-Id: Id17e8566da87ea22b8923fcd6e47db8d45bc7d6a
2017-05-09 11:03:49 +08:00
Tom Cherry
482f36cf74 init: remove restorecon() from util.cpp
restorecon() has become nothing more than a small wrapper around
selinux_android_restore().  This itself isn't super problematic, but
it is an obstacle for compiling util.cpp on the host as that function
is not available on the host.

Bug: 36970783
Test: Boot bullhead
Merged-In: I7e209ece6898f9a0d5eb9e5d5d8155c2f1ba9faf
Change-Id: I7e209ece6898f9a0d5eb9e5d5d8155c2f1ba9faf
2017-05-09 02:25:32 +00:00
Tom Cherry
d71154268d Merge "init: remove restorecon() from util.cpp" into oc-dev-plus-aosp
am: 2813d87484

Change-Id: Ib6619f696fb08b99410b3a33221fe8eacebf89d6
2017-05-09 01:20:35 +00:00
Tom Cherry
c2ef2f0d8d init: remove restorecon() from util.cpp
restorecon() has become nothing more than a small wrapper around
selinux_android_restore().  This itself isn't super problematic, but
it is an obstacle for compiling util.cpp on the host as that function
is not available on the host.

Bug: 36970783
Test: Boot bullhead
Change-Id: I7e209ece6898f9a0d5eb9e5d5d8155c2f1ba9faf
2017-05-08 16:41:13 -07:00
Mark Salyzyn
1136ebe74d Merge "init: add "+passcred" for socket to set SO_PASSCRED" am: 9811cd33ac am: 00d97b2327 am: a650c328f1
am: 1a830d5daa

Change-Id: I285fce8204b44b6e14494ff14b140088ba4e7a88
2017-05-08 23:30:36 +00:00
Mark Salyzyn
1a830d5daa Merge "init: add "+passcred" for socket to set SO_PASSCRED" am: 9811cd33ac am: 00d97b2327
am: a650c328f1

Change-Id: Id14c1e3c3aa3fdbf6e927d08720d2524d2e9b800
2017-05-08 23:27:27 +00:00
Mark Salyzyn
b066fccc5c init: add "+passcred" for socket to set SO_PASSCRED
In the init scripts for socket, the type can have a suffix of
"+passcred" to request that the socket be bound to report SO_PASSCRED
credentials as part of socket transactions.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics right after boot
      (fails without logd.rc change)
Bug: 37985222
Change-Id: Ie5b50e99fb92fa9bec9a32463a0e6df26a968bfd
2017-05-08 14:04:13 -07:00
Tom Cherry
3decb98f75 Merge changes I46690d1c,I84c11aa5 am: 0dda322d4a am: 18b23afa4b am: 3f9ba91d8f
am: 756ee8ded9

Change-Id: Ib005ef875bfc8116c320007acc10e7cf9accdc10
2017-05-08 16:27:47 +00:00
Tom Cherry
756ee8ded9 Merge changes I46690d1c,I84c11aa5 am: 0dda322d4a am: 18b23afa4b
am: 3f9ba91d8f

Change-Id: Ied40226f25303091aad079cf4e8ea1f9ca0379a7
2017-05-08 16:21:15 +00:00