Commit graph

29296 commits

Author SHA1 Message Date
Keun-young Park
fac4b63eff add killProcessGroupOnce
- killProcessGroup retries if it fails while
  killProcessGroupOnce only tries once.
- useful for sending signal like SIGTERM once.

bug: 36696408
Test: will add usage to init
Change-Id: Ia1e3d4ec848e785a3238f262b02914695cded4c7
2017-03-29 16:33:15 -07:00
Sandeep Patil
7ef60b4ed4 init: consolidate restorecon after selinux initialization in single function
Test: Boot sailfish
Change-Id: I423028f12a84c4e0c12c9bdde52b6d795d45b620
(cherry picked from commit 74df5bab16)
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-03-29 16:01:31 -07:00
Keun-young Park
5579d46471 Merge "set zero shutdown timeout for eng build"
am: 6fb2ef1d03

Change-Id: Id9fbc2ad91d6e337be7e39ab747187427e69003f
2017-03-29 21:29:37 +00:00
Treehugger Robot
6fb2ef1d03 Merge "set zero shutdown timeout for eng build" 2017-03-29 21:25:19 +00:00
Keun-young Park
c4ffa5c47d set zero shutdown timeout for eng build
- still it will take time to kill services, < 3 secs in tested device.

bug: 36678028
Test: reboot
Change-Id: I3f3eb83aede8cd950da12e3fcc259eeaf8517c3b
2017-03-29 12:25:33 -07:00
Tom Cherry
571cb53797 Merge changes from topic 'exec-start-update-verifier'
am: 8772b3686e

Change-Id: Ifaa071b38d1e34075890fd28adc4a5ccee12de53
2017-03-29 18:45:21 +00:00
Tom Cherry
64cb3d5c62 init: add exec_start command
am: b27004aa05

Change-Id: I98ce17c11621eece46728aa94dc64f54273e5a99
2017-03-29 18:45:10 +00:00
Treehugger Robot
8772b3686e Merge changes from topic 'exec-start-update-verifier'
* changes:
  init.rc: launch update_verifier with exec_start
  init: add exec_start command
2017-03-29 18:39:32 +00:00
Tom Cherry
6ee34f0286 Merge "init: replace property_get with its android::base equivalent"
am: 7bcce1e3c0

Change-Id: I877b59339d1cfc3a8953b298f975365db55d3a22
2017-03-29 18:34:54 +00:00
Treehugger Robot
7bcce1e3c0 Merge "init: replace property_get with its android::base equivalent" 2017-03-29 18:28:51 +00:00
Tom Cherry
ccf23537ee init: replace property_get with its android::base equivalent
Slowly try to decouple property_service.cpp from the rest of init.

Test: Boot bullhead
Change-Id: I267ae0b057bca0bf657b97cb8bfbb18199282729
2017-03-29 10:07:54 -07:00
Neil Fuller
1fd9390f0b Merge "Update to support staging behavior"
am: ec16825cb8

Change-Id: Iee19b80e6b722cd87c70b48870e4040713f47fa2
2017-03-29 12:41:47 +00:00
Treehugger Robot
ec16825cb8 Merge "Update to support staging behavior" 2017-03-29 12:39:47 +00:00
Neil Fuller
ae52ab2acf Update to support staging behavior
The tzdatacheck binary is being modified to support
"staging" of an install / uninstall. tzdatacheck is now
responsible for making time zone distros "live" during
boot. It was previously the responsibility of the
TimeZoneDistroInstaller.

Bug: 31008728
Test: Manual testing
Test: CTS: run cts -m CtsHostTzDataTests

Change-Id: I1d390bf2b383a9505320e3455a20ae640bf83d7b
2017-03-29 10:56:45 +01:00
Bowgo Tsai
acc1c3c792 fs_mgr: removing fs_mgr_read_fstab_with_dt()
Currently there is no client requires fs_mgr_read_fstab_with_dt() so
remove this API. Devices with fstab entries in device tree should use
fs_mgr_read_fstab_default() to get default fstab, or just use
fs_mgr_read_fstab_dt() to get those in device tree.

Bug: 35811655
Test: normal boot sailfish
Test: run factory data reset in sailfish
Test: recovery boot sailfish
Test: adb sideload in sailfish

Change-Id: I1579d81cea7366cf3867cfe5ad56feb36cbb7246
2017-03-29 16:25:03 +08:00
Elliott Hughes
939cb2950f Merge "Make demangle work more like c++filt."
am: 58c1804653

Change-Id: I9a1ae42f7808b63a6b3e3fa204b8e60d57920c93
2017-03-29 05:08:07 +00:00
Treehugger Robot
58c1804653 Merge "Make demangle work more like c++filt." 2017-03-29 05:02:42 +00:00
Tom Cherry
375cc20455 Merge "init: remove unused cutils includes"
am: 20e43a2f2c

Change-Id: I6c4e89c9b0ce39669ca6914cc134e28f005e4d55
2017-03-29 01:31:23 +00:00
Treehugger Robot
20e43a2f2c Merge "init: remove unused cutils includes" 2017-03-29 01:27:19 +00:00
Elliott Hughes
102183ee66 Make demangle work more like c++filt.
Also tweak the help output to fit the toybox style.

Bug: N/A
Test: readelf -aW | demangle
Change-Id: I110b9e385f583d5047c785364c8a5a33575d8357
2017-03-28 17:38:01 -07:00
Tom Cherry
1ec1bd918c init: remove unused cutils includes
Test: Boot bullhead
Change-Id: I629f9c3863f00fa38f87a68442c2380d28764718
2017-03-28 16:22:33 -07:00
Tom Cherry
1e2d8c7fce init.rc: launch update_verifier with exec_start
This allows update_verifier to raise it's priority and ioprio.

Bug: 36511808
Bug: 36102163
Test: Boot bullhead
Test: Verify boottime decrease on sailfish
Change-Id: I5710c6a98dc7acee9063d1fa1d1c80668f0f1528
2017-03-28 15:54:45 -07:00
Wei Wang
446cfa74ef Merge "libcutils: remove sched_set/getscheduler"
am: e0bec6b11e

Change-Id: I3f9a133401ac8a85ba3c6fd220875066df99271a
2017-03-28 22:39:56 +00:00
Treehugger Robot
e0bec6b11e Merge "libcutils: remove sched_set/getscheduler" 2017-03-28 22:32:29 +00:00
Christopher Ferris
8726529e3e Merge "Only allow short functions in class definitions."
am: e3b27d22bf

Change-Id: Id56de01fede79702bc1942abcd4baf147968141f
2017-03-28 21:34:47 +00:00
Christopher Ferris
e3b27d22bf Merge "Only allow short functions in class definitions." 2017-03-28 21:20:17 +00:00
Tom Cherry
f30abecf3c Merge "Fix timeouts for android::base::WaitForProperty*"
am: 57d78354d6

Change-Id: Ic755f2a42dcbc271aa7271da1988f035f4c18a6b
2017-03-28 20:43:50 +00:00
Tom Cherry
57d78354d6 Merge "Fix timeouts for android::base::WaitForProperty*" 2017-03-28 20:38:24 +00:00
Wei Wang
a8d59faa75 libcutils: remove sched_set/getscheduler
Bug: 36667354
Test: angler taking video
Change-Id: Ie7fbcccbd02314468c03317319574ee7e433561d
2017-03-28 13:01:20 -07:00
Christopher Ferris
a11c814d3d Only allow short functions in class definitions.
The previous rules would force short functions to be on a single line.
This change only allows single function lines in class definitions.

Test: Ran on a CL and verified single line functions only allowed in
Test: class defintions.
Change-Id: I5422543fdbb39da842bbd799c19fe2c443ff483c
2017-03-28 12:31:37 -07:00
Mark Salyzyn
621ae033a4 Merge "libcutils: handle root directory empty path"
am: 6105dbd01b

Change-Id: I48f4607f72c56ffb8bbf63682a70954995d48a28
2017-03-28 17:19:16 +00:00
Mark Salyzyn
6105dbd01b Merge "libcutils: handle root directory empty path" 2017-03-28 17:09:15 +00:00
Bowgo Tsai
c30261f266 Merge "fs_mgr: change the log level in fs_mgr_get_boot_config()"
am: c8c3e61eeb

Change-Id: Ia5e4c77d45652c8b6d4e147175db99e44fecc0d5
2017-03-28 15:49:18 +00:00
Treehugger Robot
c8c3e61eeb Merge "fs_mgr: change the log level in fs_mgr_get_boot_config()" 2017-03-28 15:43:56 +00:00
Mark Salyzyn
d749a054ff Merge "logd: strip out empty trailing iovec"
am: 6b11faeb42

Change-Id: Ib6244cf3cd089c44dd71524e09f6d4a2227c65bd
2017-03-28 15:08:15 +00:00
Mark Salyzyn
6b11faeb42 Merge "logd: strip out empty trailing iovec" 2017-03-28 15:00:38 +00:00
Jeremy Compostella
3d642d48e2 libcutils: handle root directory empty path
Usually, the canned paths lack the leading '/' which means that the
root directory is an empty path.  This patch makes
load_canned_fs_config() handle this empty path as the root directory.
It also make it flexible enough to handle an optional leading '/'.

Original-Author: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
Change-Id: Ice759ef37d1df23a54df1158ec0d3ad7f577a069
2017-03-28 14:57:22 +00:00
Bowgo Tsai
0f34094a17 fs_mgr: change the log level in fs_mgr_get_boot_config()
fs_mgr might try to get a non-existing config through fs_mgr_get_boot_config()
on a device (e.g., for backward compatibility). Lower the log level to INFO
so it won't appear on the recovery screen.

Bug: 35811655
Test: recovery boot sailfish
Change-Id: I81497259aff3691740170abeef932d363b52be35
2017-03-28 18:52:04 +08:00
Steven Moreland
ee7137208e Merge "init: add class_restart"
am: 8678872a00

Change-Id: I92e6669b0e0a9b87fffc400f8a1ee2699bdda7fc
2017-03-28 04:27:40 +00:00
Treehugger Robot
8678872a00 Merge "init: add class_restart" 2017-03-28 04:22:47 +00:00
Josh Gao
6340d91308 Merge "debuggerd_client: properly wait for completion."
am: 372d8a2931

Change-Id: I16cc3b9538e9b9b0ca3662b0a2f64b55aa38100a
2017-03-28 03:24:35 +00:00
Treehugger Robot
372d8a2931 Merge "debuggerd_client: properly wait for completion." 2017-03-28 03:21:39 +00:00
Tom Cherry
256c8f5076 Merge "init: remove superfluous forward definitions"
am: deb23ba2c1

Change-Id: Ic8126b783cf8083a64cc0955074f586420685cdd
2017-03-28 02:32:10 +00:00
Treehugger Robot
deb23ba2c1 Merge "init: remove superfluous forward definitions" 2017-03-28 02:22:51 +00:00
Tom Cherry
dc597affcc Merge "init: Fix README.md for writepid"
am: 88d6b4af16

Change-Id: Ic65adea2c9fc69118890f0be79f45152be307bcf
2017-03-28 01:13:57 +00:00
Treehugger Robot
88d6b4af16 Merge "init: Fix README.md for writepid" 2017-03-28 01:07:50 +00:00
Tom Cherry
3d5729402e Fix timeouts for android::base::WaitForProperty*
std::chrono doesn't handle integer overflow, so using
std::chrono::milliseconds::max() to indicate an infinite timeout is
not handled well in the current code.  It causes an 'absolute_timeout'
earlier in time than 'now' and causes the associated WaitForProperty*
functions to return immediately.

Also, any duration_cast from relative_timeout to nanoseconds would
cause the same issue, as it would overflow in the conversion and
result in an invalid results.

This change prevents any duration_casts of relative_timeout to
nanoseconds and replaces the logic to wait on an absolute timeout with
logic that compares the time elapsed to the provided relative timeout.

This change also includes a test that std::chrono::milliseconds::max()
does not return immediately and that negative values do return immediately.

Test: Boot bullhead + libbase_test

Change-Id: I335bfa7ba71e86c20119a0ed46014cad44361162
2017-03-27 18:05:58 -07:00
Tom Cherry
46b6c43b7c init: remove superfluous forward definitions
Test: Boot bullhead
Change-Id: I4a005616a825529bc2ad1b413e51b501f6407cbd
2017-03-27 17:55:37 -07:00
Wei Wang
fd450bb95a Merge "init: add support of multiple class names"
am: 3c1568aa13

Change-Id: Ib018fc301449ab8f2d1db8550724c11d5df0430e
2017-03-28 00:47:55 +00:00
Tom Cherry
b27004aa05 init: add exec_start command
Exec services may also want to set other service flags such as
priority.  Instead of expanding the exec syntax to handle this, create
a new command, exec_start, that will treat an existing service
definition as an exec service.  The new exec_start command will start
the service then halt init from executing further commands until the
service has exited.

This change additionally encapsulates the waiting_for_exec logic into
ServiceManager and removes the ambiguous 'bool' return value from
Reap() which previously indicated if a Reaped service was an exec
service or not.

Bug: 36511808
Bug: 36102163
Test: Bullhead boots, services run with exec_start as they do exec.

Change-Id: I44f775cf1c1dd81d5c715f44fdc150c651a2c80a
2017-03-27 17:41:27 -07:00