Commit Graph

2192 Commits

Author SHA1 Message Date
Tom Cherry e6d37cdbf9 init: clean up subcontext_test
subcontext_test had been failing due to setexeccon() failing to
transition to vendor_init context.  This is a good thing as nothing
other than init should be able to transition into this context.

I don't want to add code to skip the setexeccon() call only for the
tests, so I instead call setexeccon() with the return value of
getcon().  This works however only for root, so these tests are
skipped for non-root.

Test: init unit tests
Change-Id: I8a415599e0ec5506511202f7f5018c0e5265837d
2017-10-19 16:24:56 -07:00
Tom Cherry 7a23e13edb Merge "init: add extra std::move"
am: d72d92aee2

Change-Id: I928e6f60bd8ffb764ea5f25a81091242efd1f61d
2017-10-19 02:27:32 +00:00
Treehugger Robot d72d92aee2 Merge "init: add extra std::move" 2017-10-19 02:17:20 +00:00
Tom Cherry 4d4cc0920b Merge "init: wait_for_prop shouldn't run in a subcontext" am: 6e52973623 am: cadc34fd9a
am: fe08631fe8

Change-Id: I4fb910117150fecf4f61670be8d7ea1def235c61
2017-10-19 00:19:01 +00:00
Tom Cherry cadc34fd9a Merge "init: wait_for_prop shouldn't run in a subcontext"
am: 6e52973623

Change-Id: I160bedcb91668ccf2b663c36835871d21be2db8b
2017-10-19 00:14:21 +00:00
Tom Cherry 5d7b55bc69 init: add extra std::move
This is meant to be copy-and-move, but I forgot the move.

Test: build
Change-Id: I755ad0d99624dc0ae419ad9ed3ae6d0e017b27c5
2017-10-18 14:52:33 -07:00
Tom Cherry fa3e52c64a init: wait_for_prop shouldn't run in a subcontext
wait_for_prop sets a flag that prevents the action queue from
continuing while otherwise allowing init's main loop to continue
executing.  This cannot be done from a subcontext, so it's moved to
normal init.

All property functions need work in any case, particularly once
property_service is moved out of init.

Bug: 62875318
Test: boot sailfish and see that the previous failure related to this
      is fixed

Change-Id: Ib9e0d0bdbd0ff22ab0e5c3fe6db620700af266c6
2017-10-18 14:42:27 -07:00
Tom Cherry 486dc4a497 Merge "Only allow UTF8 encoded property values" am: 4ff2607ef7 am: 9c767212eb
am: fccffc8645

Change-Id: I0957c2c71a4deb72a0e41db971a416369c9d03b4
2017-10-17 16:20:58 +00:00
Tom Cherry 9c767212eb Merge "Only allow UTF8 encoded property values"
am: 4ff2607ef7

Change-Id: Ib83ef796bfaaa30dfda36937dfe6be4dac878346
2017-10-17 16:17:21 +00:00
Tom Cherry 8702dcb992 Only allow UTF8 encoded property values
Java already restricts properties to only UTF8 valid strings, and
this change makes this restriction also apply to all native code.

Bug: 63177684
Test: new unit tests
Change-Id: I9fa0ecc0da066b0a026db3497c0f0cbf3f5c2d5a
2017-10-16 22:35:33 +00:00
Tom Cherry ea696c71bc Merge "Allow setting read-only properties with value length > 92 characters" am: 96e8042e41 am: 5d40a3372f
am: 854dfedc90

Change-Id: I1bc483ec7cc96afe3a607965a051dd1d6af693fd
2017-10-12 16:23:27 +00:00
Tom Cherry 5d40a3372f Merge "Allow setting read-only properties with value length > 92 characters"
am: 96e8042e41

Change-Id: I538a1e415f4a80df29ba7129af479c061948d36f
2017-10-12 16:19:15 +00:00
Tom Cherry 1cf8d699a4 Allow setting read-only properties with value length > 92 characters
Bug: 23102347
Bug: 34954705
Test: read and write properties with value length > 92 characters
Change-Id: Ie196c1fdacc0489508c633e98fe9f4ad7a27dc6e
2017-10-12 02:52:28 +00:00
Mark Salyzyn c0edd4a633 Merge "init+bootstat: reduce last reboot reason to canonical alias" am: 613a5a97e0 am: cfed5e795a
am: 75374ba1d2

Change-Id: I2de7cd7c894a7c26a59221aa20efc1f7226cebeb
2017-10-10 19:40:53 +00:00
Mark Salyzyn cfed5e795a Merge "init+bootstat: reduce last reboot reason to canonical alias"
am: 613a5a97e0

Change-Id: I3217fe94b0b3637521ef3a9f455124155001dd0d
2017-10-10 19:26:14 +00:00
Mark Salyzyn 6290982ee3 init+bootstat: reduce last reboot reason to canonical alias
To make parsing easier for last reboot reason.  This also ensures that
last boot reason matches the content that is typically returned by the
bootloader or in turn landed in the canonical system boot reason.

Simplify parsing in bootstat.  Adjust and fix boot_reason_test.sh for
new reality.  Allow boot reason tests battery and kernel_panic to pass
if device does not support pstore (empty before and after the test).
If device somehow landed in fastboot mode while waiting for the
display, issue a fastboot reboot to move the test along.  Some cleanup
and standardization changes to the test script.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 63736262
Change-Id: I97d5467c0b4a6d65df3525f1a2d0051db813d5ad
2017-10-10 09:37:59 -07:00
Jeffrey Vander Stoep e04a7757ac Merge "Allow redeclaring typeattributes" am: f8bc6cee3f am: ceb5dea905
am: b7559e571b

Change-Id: I093f8be7b4f8c810d4ffefab5461687bdc883ac7
2017-10-08 04:18:13 +00:00
Jeffrey Vander Stoep ceb5dea905 Merge "Allow redeclaring typeattributes"
am: f8bc6cee3f

Change-Id: I119e687a3aaf397ac38365728f6bf9e7c24c1067
2017-10-08 04:08:45 +00:00
Jeffrey Vander Stoep f8bc6cee3f Merge "Allow redeclaring typeattributes" 2017-10-08 04:02:55 +00:00
Jeff Vander Stoep 5e9ba3c50b Allow redeclaring typeattributes
Allows partners to add a new attribute definition to their public
policy without causing a compatibility failure with the AOSP system
image.

Bug: 67092827
Bug: 37915794
Test: build and boot aosp_sailfish with a new type declared in public
    policy.

Change-Id: I3899065affb6806ae9080e1a7dfa5a6f368370f0
2017-10-06 17:04:28 -07:00
Tom Cherry 3bcda2413c Merge "init: use ro.init.subcontexts_enabled to enable subcontexts" am: 99016bce92 am: 2f5b8bb3f0
am: 16d1488614

Change-Id: I7afef0bf95ca413593e6bf36f07432af3fa41614
2017-10-06 20:43:37 +00:00
Tom Cherry 2f5b8bb3f0 Merge "init: use ro.init.subcontexts_enabled to enable subcontexts"
am: 99016bce92

Change-Id: If410f650dd67577957d653ecd0b1a1e5a45dd14a
2017-10-06 20:27:05 +00:00
Tom Cherry 79193a42e7 init: use ro.init.subcontexts_enabled to enable subcontexts
As SEPolicy is developed, use this property to enable/disable
subcontexts.

Bug: 62875318
Test: boot device with/without subcontexts
Change-Id: Ieb879836a71c72d4de1bb16514d083d52480bf9a
2017-10-06 10:37:09 -07:00
Jaegeuk Kim fd1852728b Merge "init/reboot: call MNT_FORCE at the last umount(2)" am: 4e008547be am: eacc9cd637
am: 647a720ee1

Change-Id: Idd01e0c5ff4ee5c6f0b18525c7f140b4e0d2c086
2017-10-05 20:43:55 +00:00
Jaegeuk Kim eacc9cd637 Merge "init/reboot: call MNT_FORCE at the last umount(2)"
am: 4e008547be

Change-Id: Ief5e62e385cf83198ad3c9de65131dace0a7c4ae
2017-10-05 20:38:10 +00:00
Jaegeuk Kim 0f04f72c2d init/reboot: call MNT_FORCE at the last umount(2)
The last one will avoid errors=panic in ext4.

Test: Build
Bug: 63981945
Bug: 65481582
Change-Id: I9c86afcce441767e24fc43668ab1ff6230155a9f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-10-04 19:30:49 -07:00
Tom Cherry f85f4d6a28 Merge "init: log failures if a service cannot start during class_start" am: 533fbd62ab am: 5c00898944
am: d1721a9901

Change-Id: I5c3849ef95de0e68a0707b5ee3f259efc4966c8e
2017-10-03 22:54:50 +00:00
Tom Cherry 5c00898944 Merge "init: log failures if a service cannot start during class_start"
am: 533fbd62ab

Change-Id: I7a05ae9f806a23d04d649fb230e2875633b2caee
2017-10-03 22:42:51 +00:00
Treehugger Robot 533fbd62ab Merge "init: log failures if a service cannot start during class_start" 2017-10-03 22:03:33 +00:00
Tom Cherry 20acdef816 init: log failures if a service cannot start during class_start
Test: boot system with this logging and see appropriate failures
Change-Id: I312dca89f6215afe05b10b2539258a212a0c1ae2
2017-10-03 13:16:00 -07:00
Tom Cherry 5d809223dc Merge "init: fix subcontext SELinux strings" am: 60bd9ca592 am: 71b2c17ba7
am: 24bb332ea8

Change-Id: I994d102e583667bb1669beaf40cfd81a34baecbc
2017-10-03 02:10:31 +00:00
Tom Cherry 71b2c17ba7 Merge "init: fix subcontext SELinux strings"
am: 60bd9ca592

Change-Id: I084da99db1fdc90aa0db276dd5bc755179b83713
2017-10-03 02:05:50 +00:00
Tom Cherry ac7428b2f5 init: fix subcontext SELinux strings
'object_r' is supposed to be simply 'r'.

Test: boot sailfish with SELinux fully enabled and subcontexts enabled
Change-Id: I7eb8b2dd18e66f23c09863e8961da339f72d25c5
2017-10-02 16:59:02 -07:00
Tom Cherry ff2b501df2 Merge "init: run vendor commands in a separate SELinux context" am: 8e09b0b953 am: 821cb5e16c
am: 3933bf0912

Change-Id: I01871294cd1651c47105e08f34d738785817e041
2017-10-02 20:57:33 +00:00
Tom Cherry 821cb5e16c Merge "init: run vendor commands in a separate SELinux context"
am: 8e09b0b953

Change-Id: I7e0272f29bd8bab029a9f9c07aa413c9172f6f5a
2017-10-02 20:40:03 +00:00
Tom Cherry 8e09b0b953 Merge "init: run vendor commands in a separate SELinux context" 2017-10-02 19:48:58 +00:00
Tom Cherry cb0f9bbc85 init: run vendor commands in a separate SELinux context
One of the major aspects of treble is the compartmentalization of system
and vendor components, however init leaves a huge gap here, as vendor
init scripts run in the same context as system init scripts and thus can
access and modify the same properties, files, etc as the system can.

This change is meant to close that gap.  It forks a separate 'subcontext'
init that runs in a different SELinux context with permissions that match
what vendors should have access to.  Commands get sent over a socket to
this 'subcontext' init that then runs them in this SELinux context and
returns the result.

Note that not all commands run in the subcontext; some commands such as
those dealing with services only make sense in the context of the main
init process.

Bug: 62875318
Test: init unit tests, boot bullhead, boot sailfish

Change-Id: Idf4a4ebf98842d27b8627f901f961ab9eb412aee
2017-09-29 13:06:26 -07:00
Tom Cherry 73a01e2ea4 Merge "init: remove non-protobuf single persistent property file" am: 61578ab50b am: aceda86059
am: 27c56990ce

Change-Id: I6284b97f0a23cd60d7d032e2285ad89c85de34cd
2017-09-27 20:44:29 +00:00
Tom Cherry aceda86059 Merge "init: remove non-protobuf single persistent property file"
am: 61578ab50b

Change-Id: Id4b622ebde1db431d5dcb8cc3edccc6843d4c72b
2017-09-27 20:38:29 +00:00
Tom Cherry 61578ab50b Merge "init: remove non-protobuf single persistent property file" 2017-09-27 20:35:09 +00:00
Mark Salyzyn 25964c7fd8 Merge "init: report shutdown,container for sigterm of init" am: d2b5a2417f am: 387dbf9ab0
am: a81e227284

Change-Id: Ie1a696d1b747cf90cb7f300bb2af454c10659ba5
2017-09-27 19:48:05 +00:00
Mark Salyzyn 387dbf9ab0 Merge "init: report shutdown,container for sigterm of init"
am: d2b5a2417f

Change-Id: Ifb4ab5fa166ee055838c5ad52d69e0d0c07c7e59
2017-09-27 19:40:16 +00:00
Mark Salyzyn d2b5a2417f Merge "init: report shutdown,container for sigterm of init" 2017-09-27 19:32:31 +00:00
Tom Cherry 9614e4d4d9 init: remove non-protobuf single persistent property file
This has moved to being serialized with libprotobuf.

Test: persistent properties work on bullhead
Test: init unit tests
Change-Id: I26ebe135e37d352f9c53612301bde703144853e7
2017-09-27 18:22:35 +00:00
Tom Cherry 242a6654b4 Merge "init: cleanup exit() uses" am: 9c568d0fc0 am: 531cd0f6d3
am: c0fcd21c05

Change-Id: I6b40c532f2a0d2289f701abd4e4d46339a5ecbc1
2017-09-27 17:18:36 +00:00
Tom Cherry 531cd0f6d3 Merge "init: cleanup exit() uses"
am: 9c568d0fc0

Change-Id: I52ee55a8717f60bbf47b0cbb2a3115c63a824f84
2017-09-27 17:14:17 +00:00
Tom Cherry 9c568d0fc0 Merge "init: cleanup exit() uses" 2017-09-27 17:10:31 +00:00
Mark Salyzyn 161b8626bd init: report shutdown,container for sigterm of init
Change HandleSigtermSignal() handler to report shutdown,container. Add
the new reason to bootstat.  Remove log stutter as
HandlPowerctlMessage will also do a LOG(INFO) reporting
shutdown,container as reason.

Sending SIGTERM to init is to allow a host OS to ask an Android
Container instance to shutdown.  The temptation is to report
shutdown,sigterm but that does not accurately describe the usage
scenario.

Test: compile
Bug: 63736262
Change-Id: I3c5798921bdbef5d2689ad22a2e8103741b570b4
2017-09-27 09:10:00 -07:00
Mark Salyzyn 7b736efe13 Merge "init: shutdown,thermal shut off display immediately" am: 82ee4060ed am: a27a48590a
am: 9c76b46e4e

Change-Id: I22c838b5183dae77f143cc45df52452c5f05915b
2017-09-27 15:04:23 +00:00
Mark Salyzyn a27a48590a Merge "init: shutdown,thermal shut off display immediately"
am: 82ee4060ed

Change-Id: I7c81548a3bbfefa8fadbe27d168708b2cb1d125a
2017-09-27 15:00:00 +00:00
Tom Cherry 4a679454d7 init: cleanup exit() uses
Primarily, this fixes a bug where a forked child of property service
uses exit() instead of _exit, which has the unintended consequences of
running the global destructors of init proper, which leads to
unintended cleanup.

Secondly, this replaces the remaining calls of exit() that really
should be LOG(FATAL).

Test: boot sailfish
Change-Id: I779228e7d44a73186bc7685bb723c4b9278a0a2d
2017-09-26 16:30:03 -07:00
Mark Salyzyn bfd05b69a5 init: shutdown,thermal shut off display immediately
Remove a source of heat.

Test: manual
Change-Id: I9a7391ddb121b6748a4f49f4b5bfb77453ca1514
2017-09-26 14:06:51 -07:00
Tom Cherry 242f47d544 Merge "init: fix typo" am: 15a14d1ad9 am: 00a15fc9bf
am: 707a5ad27a

Change-Id: I3ae60ec3703ae653929d5e5bfb6f3cefd300b28a
2017-09-20 00:48:32 +00:00
Tom Cherry 00a15fc9bf Merge "init: fix typo"
am: 15a14d1ad9

Change-Id: I3805f03671f0ed09320df88b96b5cd958a9f742d
2017-09-20 00:45:07 +00:00
Tom Cherry a141907ecf init: fix typo
Test: build
Change-Id: I2f6ff60356087f9fd6c6f24e3923d70b9e93dcf8
2017-09-19 13:13:17 -07:00
Tom Cherry 8b4315330e Merge "init: use protobuf for serialization of persistent properties" am: f5dba11085 am: 61b81a0341
am: 74c45a41cc

Change-Id: I517f2cbd9c0c2bde93ccb65afe8933e8294ff1ae
2017-09-19 17:20:29 +00:00
Tom Cherry 61b81a0341 Merge "init: use protobuf for serialization of persistent properties"
am: f5dba11085

Change-Id: I6177b5b86290a50884f6212d45a09604b69cffd6
2017-09-19 17:16:59 +00:00
Tom Cherry f5dba11085 Merge "init: use protobuf for serialization of persistent properties" 2017-09-19 17:07:00 +00:00
Tom Cherry a97faba653 init: use protobuf for serialization of persistent properties
I probably should have done this from the start...  There's a shim to
convert my manually serialized format to protobuf, and since that has
not yet shipped, it'll be reverted in a short period of time.

Test: init unit tests
Test: upgrade from legacy and intermediate property formats successfully
Change-Id: Iad25f6c30d0b44d294230a53dd6876222d1c785b
2017-09-19 09:56:31 -07:00
Tom Cherry 6a842f9883 Merge "init: add exec_background command" am: 424ed42fb4 am: a6d75117e2
am: a53db4220f

Change-Id: I8e718e5647908c7dc98bf8ca7e398f73808a7d43
2017-09-18 21:42:08 +00:00
Tom Cherry a6d75117e2 Merge "init: add exec_background command"
am: 424ed42fb4

Change-Id: I9529146ea9b29b2fb2e2c92f3533efc4e3106943
2017-09-18 21:37:38 +00:00
Tom Cherry 424ed42fb4 Merge "init: add exec_background command" 2017-09-18 21:33:26 +00:00
Tom Cherry 3631c545b8 init: add exec_background command
This command functions similarly to `exec` except that it does not
cause init to halt executing commands until the process has
terminated.  It is useful for launching simple one time background
tasks.

Bug: 65736247
Test: create an exec_background service and see it function properly
Change-Id: I719c8b85479b65201770aedc0a13191303007c11
2017-09-18 12:19:47 -07:00
Tom Cherry 845a91d6b7 Merge "init: fix crash when reboot is triggered by a builtin" am: b92415cee2 am: 171587d10e
am: e50fd398ef

Change-Id: I5b8cb44b4d93049d844738468f8755dce4916e86
2017-09-15 21:21:24 +00:00
Tom Cherry 171587d10e Merge "init: fix crash when reboot is triggered by a builtin"
am: b92415cee2

Change-Id: I4137679d88e58c706f14adeeaf84b41426079de4
2017-09-15 21:14:08 +00:00
Tom Cherry b92415cee2 Merge "init: fix crash when reboot is triggered by a builtin" 2017-09-15 21:08:52 +00:00
Tom Cherry 3633a4014a init: fix crash when reboot is triggered by a builtin
Builtin commands may set the sys.powerctl property, which causes
reboot to be immediately processed.  Unfortunately, part of the reboot
processing involves clearing the action queue, so when this scenario
happens, ActionManager::ExecuteOneCommand() can abort due to its state
being unexpectedly changed.

Longer term, the real fix here is to split init and property service.
In this case, the property sets will be sent to property service and
the reboot will only be processed once property service responds back
to init that the property has been set.  Since that will not happen
within the action queue, there will be no risk of failure.

Short term, this change sets a flag in init to shutdown the device
before the next action is run, which defers the shutdown enough to fix
the crash, but continues to prevent any further commands from running.

Bug: 65374456
Test: force bullhead into the repro case and observe that it no longer
      repros

Change-Id: I89c73dad8d7912a845d694b095cab061b8dcc05e
2017-09-15 21:07:41 +00:00
Tom Cherry 27d73e9105 Merge "init: fix hiding of move constructors of Result<T>" am: db7b8f5e28 am: 6213ce0dc1
am: 9c374424ae

Change-Id: Ia0f4171d84e484084cc043e64ade4dfa28e88254
2017-09-15 20:34:24 +00:00
Tom Cherry 6213ce0dc1 Merge "init: fix hiding of move constructors of Result<T>"
am: db7b8f5e28

Change-Id: I933df61a6d5a523b7872ae0d8af091722f7c0e90
2017-09-15 20:29:05 +00:00
Tom Cherry d1c9cd0499 init: fix hiding of move constructors of Result<T>
This is needed to have Result<Result<T>> work correctly.

Test: init unit tests
Change-Id: If7d23d1ea13f3727b567d3baf0eee1d8d0e5a196
2017-09-15 20:17:38 +00:00
Tom Cherry 32be6da555 Merge "init: fix variable scope issue with ExpandArgs()" am: 1973110355 am: 698981df84
am: 7954cc1324

Change-Id: I708fa1135b8426b8741a0235e58230928609fc2a
2017-09-12 16:43:25 +00:00
Tom Cherry 698981df84 Merge "init: fix variable scope issue with ExpandArgs()"
am: 1973110355

Change-Id: I6a257ae81ee2b4a3c128f5d4f4724cf1534670c7
2017-09-12 16:37:34 +00:00
Tom Cherry 1973110355 Merge "init: fix variable scope issue with ExpandArgs()" 2017-09-12 16:31:13 +00:00
Tom Cherry 5e405cacb1 init: fix variable scope issue with ExpandArgs()
ExpandArgs() was factored out of Service::Start() to clean up init,
however this introduced a bug: the scope of expanded_args ends when
ExpandArgs() returns, yet pointers to the c strings contained within
those std::strings are returned from the function.  These pointers are
invalid and have been seen to cause failures on real devices.

This change moves the execv() into ExpandArgs() and renames it
ExpandArgsAndExecv() to keep the clean separation of Service::Start()
but fix the variable scope issue.

Bug: 65303004
Test: boot fugu
Change-Id: I612128631f5b58d040bffcbc2220593ad16cd450
2017-09-11 16:08:54 -07:00
Luis Hector Chavez 056283e86e Merge "init: Allow clean system shutdown upon SIGTERM" am: 61cb88add2 am: 721b2d6035
am: 69596c2d00

Change-Id: I4a54c3c076401ebda1623a6e1880f60fb5695c8c
2017-09-07 20:11:29 +00:00
Luis Hector Chavez 721b2d6035 Merge "init: Allow clean system shutdown upon SIGTERM"
am: 61cb88add2

Change-Id: If0a495fa067440f0b59969ac0dbc010b4687b52f
2017-09-07 20:06:58 +00:00
Treehugger Robot 61cb88add2 Merge "init: Allow clean system shutdown upon SIGTERM" 2017-09-07 19:59:29 +00:00
Luis Hector Chavez 9f97f47940 init: Allow clean system shutdown upon SIGTERM
This allows Android to cleanly shutdown when running in a PID namespace
in a way that does not rely on adbd running. This is useful to allow
Android to be running in a container and its lifetime managed by an
OCI-compliant tool.

Bug: 65415372
Test: `kill -TERM 1` as root is correctly dropped.
Test: `kill -TERM 1` from the init PID namespace causes init to cleanly shutdown.
Change-Id: Ia66ebdb436221919081bc4723337c0c7f1e53b09
2017-09-07 10:47:04 -07:00
Tom Cherry e4dcb98e49 Merge "Log pid for writes to sys.powerctl" am: 2827106d7d am: c1968fb0c9
am: 17b2996743

Change-Id: I418f732c92e8ae8effe2645e6b2703976fbcd316
2017-09-06 17:14:55 +00:00
Tom Cherry c1968fb0c9 Merge "Log pid for writes to sys.powerctl"
am: 2827106d7d

Change-Id: I2fb780c5809d4c18950c114c07a7363723aa121a
2017-09-06 17:09:08 +00:00
Tom Cherry a84e14da1e Log pid for writes to sys.powerctl
Unless a process logs that it is requesting a device to reboot, there
are no logs to show which process triggered a reboot.  This change
introduces such a log in property service such that system initiated
reboots can be clearly blamed back to a calling process.

Bug: 64214361
Test: reboot and check kernel log for reboot string
Change-Id: I18de33d2a0933d20bdb581025b78020c88c5c6eb
2017-09-05 12:47:08 -07:00
kaichieh 84fb623f64 Merge "Add odm sepolicy support to selinux.cpp" am: f899548cdb am: 1aecf73b43
am: a4d04e1f26

Change-Id: Iba1cb0c66fffe8d59bf9056bd9a6e6932518d4e4
2017-09-04 05:12:57 +00:00
kaichieh 1aecf73b43 Merge "Add odm sepolicy support to selinux.cpp"
am: f899548cdb

Change-Id: I33f7ded656fa2e61e130f158a2d8915f68524b91
2017-09-04 04:55:58 +00:00
Treehugger Robot f899548cdb Merge "Add odm sepolicy support to selinux.cpp" 2017-09-04 04:45:33 +00:00
Wei Wang d51d09bf38 Merge "init: add option to read file fully on readahead" am: d97a1710b8 am: df9ac65c75
am: cd2d1faea2

Change-Id: I0614738843369e5c7ee4e39792969d7cc9e516d8
2017-09-02 03:13:16 +00:00
Wei Wang df9ac65c75 Merge "init: add option to read file fully on readahead"
am: d97a1710b8

Change-Id: I2a49bd384b1fe621314916c1f325c03b7fa43162
2017-09-02 03:01:14 +00:00
Wei Wang 02628f3b23 init: add option to read file fully on readahead
Bug: 62413151
Test: boottime, dumpcache
Change-Id: I1a7b69f0619428e4db31c5a7639c5d895c89ecdb
2017-09-01 15:15:51 -07:00
kaichieh eef4cd7d08 Add odm sepolicy support to selinux.cpp
init: support loading odm sepolicy

Currently init merges two sepolicy cil files:
    - /system/etc/selinux/plat_sepolicy.cil
    - /vendor/etc/selinux/nonplat_sepolicy.cil

This change replaces nonplat_sepolicy.cil with the following two files:
    - /vendor/etc/selinux/declaration/nonplat_declaration.cil
    - /vendor/etc/selinux/vender_sepolicy.cil

And support merging another default (but optional):
    - /odm/etc/selinux/odm_sepolicy.cil.

Bug: 64240127
Test: boot sailfish normally without odm.cil
Test: boot another device having odm.cil
Change-Id: I0b7f8c656c73ddb0fd46f2af3c625d7c81566f2f
2017-09-01 18:13:29 +08:00
Tom Cherry b5d7e00815 Merge "use a single file for storing persistent properties" am: e1f9a58c86 am: 39088d35ee
am: f8d36679bf

Change-Id: Id6b9812de8f7cc774fe7300d0b9e13a0d2b3b248
2017-08-30 19:55:39 +00:00
Tom Cherry 39088d35ee Merge "use a single file for storing persistent properties"
am: e1f9a58c86

Change-Id: Iea9d022eee79e3a4ccf9f5ebc6739d565b6e51b1
2017-08-30 19:42:08 +00:00
Tom Cherry e1f9a58c86 Merge "use a single file for storing persistent properties" 2017-08-30 19:30:18 +00:00
Tom Cherry 16fad42007 use a single file for storing persistent properties
We have seen that storing persistent properties in separate files
causes increased boot latency compared to if they were stored in a
single contiguous file.

This change creates a simple format for a contiguously stored property
file, and adds the support for arbitrary characters in the names of
persistent properties, which previously had been restricted.  It has a
mechanism for converting older devices to the new format as well.

Bug: 64392887
Test: boot bullhead with new properties
Test: boot bullhead and verify old properties are converted to the new
      property file
Test: corrupt property file and ensure that it gets recovered from memory
Test: new unit tests
Change-Id: I60d8201d655ce5c97b33faae81d5ca8dbbb21a14
2017-08-29 17:45:06 -07:00
Tom Cherry 2235fa414f Merge "init: fix signal handling and LOG(FATAL) in child processes" am: 30bf4b7500 am: 43e92299e9
am: 5727a169c1

Change-Id: I7dd7729df2b1073946b7a9a350e528a95eed72fd
2017-08-28 22:05:17 +00:00
Tom Cherry 43e92299e9 Merge "init: fix signal handling and LOG(FATAL) in child processes"
am: 30bf4b7500

Change-Id: I9147d02a9e710f9e8068a9b3b061768daf2648e9
2017-08-28 21:55:45 +00:00
Tom Cherry 30bf4b7500 Merge "init: fix signal handling and LOG(FATAL) in child processes" 2017-08-28 21:45:38 +00:00
Tom Cherry d0f3e414a0 Merge "init: support setting rlimits per service" am: 459aa1cac6 am: c39a5082dc
am: d47ccf8277

Change-Id: I29a5baea3ba8193724fc94a57cf1d770a9a46d62
2017-08-28 19:52:07 +00:00
Tom Cherry c39a5082dc Merge "init: support setting rlimits per service"
am: 459aa1cac6

Change-Id: I4ef5abc3371ce52783bfb14669bcffe33febb73e
2017-08-28 19:39:08 +00:00
Treehugger Robot 459aa1cac6 Merge "init: support setting rlimits per service" 2017-08-28 19:27:08 +00:00
Tom Cherry 487378ae14 Merge "init: log all failures of Service::Start()" am: 9bde0dc769 am: 849b481786
am: fb32e15da8

Change-Id: Ie658e3036ea452e4d93a8e947d860040fc7cce5d
2017-08-28 17:40:29 +00:00
Tom Cherry 849b481786 Merge "init: log all failures of Service::Start()"
am: 9bde0dc769

Change-Id: Ibb27338bb694482108ffc558b2823c583a9701d3
2017-08-28 17:30:28 +00:00