Commit Graph

35927 Commits

Author SHA1 Message Date
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
Josh Gao 1d6c01b53d adbd: don't spin if file sync read fails.
Bug: http://b/64508974
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
2017-08-28 11:21:31 -07:00
Tom Cherry fb32e15da8 Merge "init: log all failures of Service::Start()" am: 9bde0dc769
am: 849b481786

Change-Id: Ia6fc0b0917d6b35dda5270c9fa416fb46a6743ed
2017-08-28 17:36:00 +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
Tom Cherry 9bde0dc769 Merge "init: log all failures of Service::Start()" 2017-08-28 17:22:11 +00:00
Tom Cherry 7ac013de7e init: support setting rlimits per service
Add a new service option, `rlimit` that allows a given rlimit to be
set for a specific service instead of globally.

Use the same parsing, now allowing text such as 'cpu' or 'rtprio'
instead of relying on the enum value for the `setrlimit` builtin
command as well.

Bug: 63882119
Bug: 64894637

Test: boot bullhead, run a test app that attempts to set its rtprio to
      95, see that the priority set fails normally but passes when
      `rlimit rtprio 99 99` is used as its service option.
      See that this fails when `rlimit rtprio 50 50` is used as well.
Test: new unit tests

Change-Id: I4a13ca20e8529937d8b4bc11718ffaaf77523a52
2017-08-28 10:19:50 -07:00
Christopher Ferris 4c4b8edb19 Merge "Add missing include for readv." am: 1f6a807bac
am: 831140358d

Change-Id: I06445320fb9ec382af117612cb64e9c35949ef00
2017-08-26 15:22:14 +00:00
Christopher Ferris 831140358d Merge "Add missing include for readv."
am: 1f6a807bac

Change-Id: Ib0530b4e3ea1a9fdc779c87cdd12489859a35bff
2017-08-26 15:19:14 +00:00
Christopher Ferris 1f6a807bac Merge "Add missing include for readv." 2017-08-26 15:12:14 +00:00
Christopher Ferris 5d6a0325ef Add missing include for readv.
Test: Builds.
Change-Id: Ia8511dcec6f49d3f6016a4dac88ccf343495349b
2017-08-25 17:33:38 -07:00
Josh Gao dca8180110 Merge "libunwindstack: make machine type a property of Regs." am: 75a40988c0
am: 310f3e114a

Change-Id: I319cbb0ca2bbb569f7c8e989764243825a0cdeea
2017-08-26 00:19:10 +00:00
Josh Gao 310f3e114a Merge "libunwindstack: make machine type a property of Regs."
am: 75a40988c0

Change-Id: I237904de44d478b03b74dda42f1b6a6ce5c36aa0
2017-08-26 00:15:22 +00:00
Treehugger Robot 75a40988c0 Merge "libunwindstack: make machine type a property of Regs." 2017-08-26 00:02:46 +00:00
Nick Kralevich 787b5038f4 Merge "Clarify SELinux service error message" am: 54a28300b7
am: 706a898cd0

Change-Id: I3ab507e09016b94efb1440a4ad77a03918d361a5
2017-08-25 23:18:46 +00:00
Nick Kralevich 706a898cd0 Merge "Clarify SELinux service error message"
am: 54a28300b7

Change-Id: I638bad81212c20b1c0065eab98ab2e043b643aac
2017-08-25 23:16:47 +00:00
Treehugger Robot 54a28300b7 Merge "Clarify SELinux service error message" 2017-08-25 23:10:06 +00:00
Tom Cherry 1ca83249a1 init: fix signal handling and LOG(FATAL) in child processes
Child processes inherit the signal handlers and the 'Aborter' for
logging from their parent process.  In the case of init, fork()'ed
processes, will attempt to reboot the system if they receive a fatal
signal or if they call LOG(FATAL).  This is not the correct behavior;
these processes should terminate due to the provided signal like other
processes on the system.

This is particularly important as there are multiple LOG(FATAL) calls
in service.cpp for failures after fork() but before execv() when a
service is started.

Note, that pthread_atfork() is not a viable solution since clone() is
used in some cases instead of fork() and atfork handlers are not
called with clone().

Test: LOG(FATAL) from a child process of init and see that it
      terminates due to a signal correctly
Test: LOG(FATAL) from init proper and see that it reboots to the
      bootloader

Change-Id: I875ebd7a5f6b3f5e3e2c028af3306917c4409db3
2017-08-25 15:10:48 -07:00
Josh Gao 0953ecd03a libunwindstack: make machine type a property of Regs.
There are no actual users of the machine type output parameter to
Regs::RemoteGet. The concrete implementations of Regs know what machine
type they represent anyway, so provide an accessor to query.

Test: treehugger
Test: libunwindstack tests on 32/64-bit host, hikey960
Change-Id: Ia25910531d36c41b2b6919f154cfa914aae63117
2017-08-25 14:48:09 -07:00
Nick Kralevich 1ea19eb44d Clarify SELinux service error message
1) Attempt to make the error message associated with a missing service
better.
2) Provide a link to more in-depth documentation.

Bug: 65023716
Test: code compiles.
Change-Id: Ie0f1896fb41d5afd11501f046cb51d4c8afe0a62
2017-08-25 14:01:06 -07:00
Christopher Ferris bd048209b4 Merge "Speed up map creation." am: df3e89be94
am: 2bf9cbf233

Change-Id: I1298f1c8b9e7ee6abad624513be5c365389804f7
2017-08-25 19:16:30 +00:00
Christopher Ferris 2bf9cbf233 Merge "Speed up map creation."
am: df3e89be94

Change-Id: Iba6f292a4448f065dcf64c6f3e40107b5042a62d
2017-08-25 19:12:29 +00:00
Christopher Ferris df3e89be94 Merge "Speed up map creation." 2017-08-25 19:04:14 +00:00
Tom Cherry 702ca9ada2 init: log all failures of Service::Start()
The move to returning Result from Service::Start() for better context
when starting process through init's builtins stops Service::Start()
failures from being logged from other contexts.  This change adds
those logs along with their context.

Test: boot bullhead, fail to start services via `setprop ctl.start`,
      see the expected error in dmesg

Change-Id: I45294f6abf00852f3d4c549a32eaf4920a51e6f0
2017-08-25 11:01:52 -07:00
Max Bires c564cb0bec Merge "Add a feature to show which bugs are tracking which se denials" am: 06e0c704d7
am: 08e66e7796

Change-Id: I13bca0fe36876dc680fdaddd9d65a40cf209a688
2017-08-25 17:05:14 +00:00
Max Bires 08e66e7796 Merge "Add a feature to show which bugs are tracking which se denials"
am: 06e0c704d7

Change-Id: I67dab1bfe2e400189669dfe48e8683ec15591c34
2017-08-25 17:01:14 +00:00
Max Bires 06e0c704d7 Merge "Add a feature to show which bugs are tracking which se denials" 2017-08-25 16:54:19 +00:00
Tom Cherry ec9aa8ce7c Merge "init: do not load persistent properties from temporary /data" am: b1d93a8136
am: b916f49bd7

Change-Id: Id3706892e6d34ca97ac2824099d7830b2340e78c
2017-08-25 16:46:58 +00:00
Alan Stokes 32636f0f4c Merge "Small liblog test fixes & readability improvements." am: 332370d14d
am: 511cc67633

Change-Id: I9495eb03997b7759786f02d24b92657381053f2f
2017-08-25 16:46:22 +00:00
Tom Cherry b916f49bd7 Merge "init: do not load persistent properties from temporary /data"
am: b1d93a8136

Change-Id: I3dd6423db9bf9e799e438f2e5f50dfc77a0d78f8
2017-08-25 16:43:22 +00:00
Alan Stokes 511cc67633 Merge "Small liblog test fixes & readability improvements."
am: 332370d14d

Change-Id: Id3ba8e43ac60fdfe33b40e0f78629ae3312afb50
2017-08-25 16:42:37 +00:00
Tom Cherry b1d93a8136 Merge "init: do not load persistent properties from temporary /data" 2017-08-25 16:37:20 +00:00
Alan Stokes 332370d14d Merge "Small liblog test fixes & readability improvements." 2017-08-25 16:35:55 +00:00
Alan Stokes 50289204e5 Merge "Reading from logd in WRAP mode is expected to take a long time, don't abort it after 30s." am: 974ab46561
am: 9181fe6427

Change-Id: I4d151187abe53d6c6094521436ddd86129c3cb24
2017-08-25 14:45:09 +00:00
Mark Salyzyn a0641b5c13 Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" am: 13cb599536
am: 37c6015d9d

Change-Id: Ie884649d96ed020696a2ae6ba5bc46cf0d7ad92d
2017-08-25 14:37:44 +00:00
Alan Stokes 9181fe6427 Merge "Reading from logd in WRAP mode is expected to take a long time, don't abort it after 30s."
am: 974ab46561

Change-Id: I2d4b1b14a981a496ab7750fce25ce11858dee0b0
2017-08-25 14:31:51 +00:00
Mark Salyzyn 37c6015d9d Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property"
am: 13cb599536

Change-Id: Ib6c1b51668b892288db931b09b099bf5ed28fbae
2017-08-25 14:24:21 +00:00
Treehugger Robot 974ab46561 Merge "Reading from logd in WRAP mode is expected to take a long time, don't abort it after 30s." 2017-08-25 14:18:29 +00:00
Mark Salyzyn 13cb599536 Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" 2017-08-25 14:16:12 +00:00
Alan Stokes 81e63d0515 Small liblog test fixes & readability improvements.
liblog concurrent printf tests now check every write succeeds.
logd timeout_negative tests exits as soon as one run succeeds.

Test: CTS tests till pass.
Change-Id: I9a166a0abcb8b9aa5c055c35c5dccf30616a4e24
2017-08-25 14:53:21 +01:00
Alan Stokes 64acdf77d6 Reading from logd in WRAP mode is expected to take a long time,
don't abort it after 30s.

Adds a new CTS test to verify the behaviour.

Bug: 64143705
Test: New and existing CTS tests pass. Manual testing with logcat.
Change-Id: Ia67175701ed8c462083e14e26123ce8ddcb226bc
2017-08-25 11:40:49 +01:00
Mark Salyzyn 73e6b49c0c Switch /data/misc/reboot/last_reboot_reason to persistent property
Switch from /data/misc/reboot/last_reboot_reason to persistent
Android property persist.sys.boot.reason for indicating why the
device is rebooted or shutdown.

persist.sys.boot.reason has a standard as outlined in b/63736262 and
the associated investigation. Made adjustments to the values so that
we did not create a problem even before we started. Compliance is
part of the tests in boot_reason_test.sh.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 64687998
Change-Id: I812c55a12faf7cb7ff92101009be058ad9958d07
2017-08-24 15:13:48 -07:00
Tom Cherry 9951b792b1 init: do not load persistent properties from temporary /data
With full disk encryption, a temporary /data partition is mounted to
start a minimum subset of the frameworks.  Later, once /data can be
decrypted it is mounted again.  load_persist_props is called both when
the temporary /data partition is mounted and again after the real
/data is mounted; this is a mistake.

This change checks to see if we're a FDE device and if so, returns the
first time load_persist_props is called.

Test: boot bullhead (FDE) with and without boot pin and check that
      persistent properties are loaded
Test: boot sailfish (FBE) and check that persistent properties are loaded
Change-Id: I6ed725072bdb27d80bfa6575d0a4876b08c6a4bc
2017-08-24 14:24:59 -07:00
Dimitry Ivanov 1eafe1b47c Merge "Define current ABI string in android-base/macros.h" am: 2732a7e023
am: d98e5fc543

Change-Id: Ic2832ccb89ad438d5af03024161d85a0d400c90f
2017-08-24 09:46:01 +00:00
Dimitry Ivanov d98e5fc543 Merge "Define current ABI string in android-base/macros.h"
am: 2732a7e023

Change-Id: I23b96f14ce8e05a3ab36b7c32a29026f4f08ef60
2017-08-24 09:42:07 +00:00
Dimitry Ivanov 2732a7e023 Merge "Define current ABI string in android-base/macros.h" 2017-08-24 09:38:34 +00:00
Bowgo Tsai 7b9a4d5bcd Move adbd from root to system
Bug: 63910933
Test: normal boot sailfish, checks adb works
Test: recovery boot sailfish, checks adb works
Test: normal boot bullhead, checks adb works
Test: recovery boot bullhead, checks adb works

Change-Id: I1b27910c06a4172ca718b3344736ec8e3429f477
Merged-In: I1b27910c06a4172ca718b3344736ec8e3429f477
(cherry picked from commit 93defc17f3)
2017-08-24 14:22:07 +08:00
Dmitry Shmidt 14a60d2e19 Merge "init: Fix -DUSER_MODE_LINUX compilation" am: 9a38df3f5f
am: d1821522aa

Change-Id: Ic34bcb0be554736edd6c293820ab1fc9ff79bf34
2017-08-24 01:29:29 +00:00
Dmitry Shmidt d1821522aa Merge "init: Fix -DUSER_MODE_LINUX compilation"
am: 9a38df3f5f

Change-Id: I26d86100bb8f76325b46ba2c2d066e856d910396
2017-08-24 01:23:01 +00:00
Treehugger Robot 9a38df3f5f Merge "init: Fix -DUSER_MODE_LINUX compilation" 2017-08-24 01:14:36 +00:00