Commit Graph

2271 Commits

Author SHA1 Message Date
Ryan Prichard bef4ec28c4 Merge "init: use signalfd to catch SIGCHLD" am: 07de83831f
am: 5739bf412f

Change-Id: I5a65a3ec20fd5c14b8cbd5843dabc376124b86b5
2018-04-12 16:07:25 -07:00
Tom Cherry 9223bfdabe Merge "init: do not impose vendor_init restrictions on old vendor images" am: 4396bb85da
am: 1aea110cad

Change-Id: I337819da9e62377a3f47acda0772fa20cb676931
2018-04-12 15:51:22 -07:00
Treehugger Robot 07de83831f Merge "init: use signalfd to catch SIGCHLD" 2018-04-12 22:49:27 +00:00
Treehugger Robot ee1b5a605e Merge "Allow vendor-init-actionable for vold-related properties" 2018-04-12 22:33:03 +00:00
Tom Cherry 4396bb85da Merge "init: do not impose vendor_init restrictions on old vendor images" 2018-04-12 22:31:02 +00:00
Ryan Prichard 1325ec8cfb init: use signalfd to catch SIGCHLD
Previously, if init received too many SIGCHLD signals, then the write to
signal_write_fd could fail with EAGAIN. The handler tried to log the
EAGAIN error, and init deadlocked if the interrupted init process had
already acquired a logging-related lock.

Bug: b/77867680
Test: manual
Change-Id: Ief0b5e94d8517827a5a7d03773391ba3ba9447c4
2018-04-12 14:15:26 -07:00
Tom Cherry a1dbeb8d33 init: do not impose vendor_init restrictions on old vendor images
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
2018-04-12 10:17:45 -07:00
Jaekyun Seok 00ef7d560c Allow vendor-init-actionable for vold-related properties
Bug: 75987246
Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ifec879f07705a52501757b58b1562a97c668b8b0
Merged-In: Ifec879f07705a52501757b58b1562a97c668b8b0
(cherry picked from commit 65ce3b2cd8)
2018-04-12 12:51:09 +09:00
Jaekyun Seok d82e926917 Allow vendor-init-actionable for vold-related properties
am: 65ce3b2cd8

Change-Id: I42838c531f79d01283538fe2cd4f68368947368f
2018-04-11 20:38:42 -07:00
Jaekyun Seok 65ce3b2cd8 Allow vendor-init-actionable for vold-related properties
Bug: 75987246
Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ifec879f07705a52501757b58b1562a97c668b8b0
2018-04-12 08:17:43 +09:00
Jaekyun Seok d082acf3d2 Merge "Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger" am: 5e5509e8fc
am: fb031e37a0

Change-Id: I03d3018bd416cd3dbac237768b1f441223e39238
2018-04-05 14:43:04 -07:00
Jaekyun Seok 66797804c6 Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger
They are being used as action triggers in some devices including Pixels.
So vendor-init-actionable should be allowed for them.

Bug: 74266614
Test: building succeeded and tested on a Pixel with
PRODUCT_COMPATIBLE_PROPERTY=true

Change-Id: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
Merged-In: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
(cherry picked from commit 167ec7f1d2)
2018-04-05 23:08:39 +09:00
Jaekyun Seok 167ec7f1d2 Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger
They are being used as action triggers in some devices including Pixels.
So vendor-init-actionable should be allowed for them.

Bug: 74266614
Test: building succeeded and tested on a Pixel with
PRODUCT_COMPATIBLE_PROPERTY=true

Change-Id: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
2018-04-05 21:20:59 +09:00
Jayant Chowdhary f4bda9a188 Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Merged-In: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-04-02 17:32:23 -07:00
Tao Bao 88161a7a2e Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." am: b7ba61ffc5
am: 30dcecc170

Change-Id: I51c465647fcc705064eb76146557fd9afdafebe9
2018-03-31 17:22:29 +00:00
Tao Bao b7ba61ffc5 Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." 2018-03-31 17:03:25 +00:00
Jayant Chowdhary 478c7c1eaf Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-03-31 07:13:33 -07:00
Jaekyun Seok 401313f8f7 Merge "Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode" am: a5bf7bad2c
am: 63e16c228e

Change-Id: I1f53688bc49fbc0c43bc98a6c0829dd23e7966cf
2018-03-29 22:29:51 +00:00
Jaekyun Seok f328b0d935 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
Merged-In: I140a8f7ef3fa9823ceced94b00a413800518c240
(cherry picked from commit 1f90ccefb6)
2018-03-30 06:13:12 +09:00
Jaekyun Seok 1f90ccefb6 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
2018-03-29 14:54:51 +09:00
Jaekyun Seok da4b0a27fb Merge "Allow vendor-init-actionable for ro.debuggable" am: 5e7de48f03
am: 000e274f9a

Change-Id: I266c01a444a76b2de3378399a5b6c0fc154b901f
2018-03-28 21:27:23 +00:00
Jaekyun Seok fce960cdf4 Allow vendor-init-actionable for ro.debuggable
Some partners are using ro.debuggable as action trigger to config a
product differently according to its value.

Bug: 75987246
Test: succeeded building and tested taimen
Change-Id: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
Merged-In: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
(cherry picked from commit 4f214c5179)
2018-03-29 04:21:22 +09:00
Jaekyun Seok 4f214c5179 Allow vendor-init-actionable for ro.debuggable
Some partners are using ro.debuggable as action trigger to config a
product differently according to its value.

Bug: 75987246
Test: succeeded building and tested taimen
Change-Id: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
2018-03-28 12:21:03 +09:00
Tom Cherry 16e2e9d4da Merge "Revert "init: Reboot after timeout passes during reboot"" into pi-dev 2018-03-20 18:42:43 +00:00
Tom Cherry 6d0ec82c04 Merge "Revert "init: Reboot after timeout passes during reboot"" am: 92d55b6c07
am: e48dfe91ca

Change-Id: Ibf0db3721894cf78ba3f67b1e364833ffe1a9b82
2018-03-20 13:55:19 +00:00
Tom Cherry ea31ac2514 Revert "init: Reboot after timeout passes during reboot"
This reverts commit c9fec9d2be.

Looks like ext4 can't handle a system reboot happening in the middle
of an unmount.  We'll have to find another way to handle this.

Bug: 74817735
Bug: 75310371
Test: reboot device
Merged-In: Ib4f7f7fd29988a31a99f146c40f6d987c1fef15e
Change-Id: I7c097ba5734e2e4ff320c8b02fb58324d9380513
2018-03-20 13:39:00 +00:00
Jaekyun Seok 977abec8a6 Merge "Allow vendor_init_actionable to persist.sys.usb.usbradio.config" into pi-dev
am: bfb490e3e8

Change-Id: I3bd2e532c3a1c09a3ea8f80bfb633d237b85dc0f
2018-03-20 05:06:06 +00:00
Tom Cherry 0a72e6cb72 Revert "init: Reboot after timeout passes during reboot"
This reverts commit c9fec9d2be.

Looks like ext4 can't handle a system reboot happening in the middle
of an unmount.  We'll have to find another way to handle this.

Bug: 74817735
Bug: 75310371
Test: reboot device
Change-Id: Ib4f7f7fd29988a31a99f146c40f6d987c1fef15e
2018-03-19 16:37:02 -07:00
Jaekyun Seok 56f832e561 Allow vendor_init_actionable to persist.sys.usb.usbradio.config
persist.sys.usb.usbradio.config can be used as an action trigger in
vendor init scripts.

Bug: 75202311
Bug: 74266614
Test: succeeded building and tested on pixels
Change-Id: I123b5ebce4bbf33f41222c2e11137d52e38ff9f8
2018-03-20 07:40:16 +09:00
Tom Cherry 1f9d5406b3 init: add timers around sync() during shutdown
It seems that these sync() calls may take a long time in some
occasions, so we add these logs to check.

Bug: 74817735
Test: tree hugger
Change-Id: Id3635f6c7a6618b20c7caf93b05e50cc50ef99de
2018-03-15 10:24:00 -07:00
Jaekyun Seok 3b613ccedc Export init.svc.console as an actionable property
The state of console can be used to set up a device for debugging.

Bug: 74266614
Test: succeeded building and tested with Pixels
Change-Id: I3691fa2819594a521e05dad150550ab309a78c68
Merged-In: I3691fa2819594a521e05dad150550ab309a78c68
(cherry picked from commit cba467eeda)
2018-03-14 06:12:43 +09:00
Daniel Mentz bd93ad50ac ueventd: Increase uevent buffer size to 2MB
Let's increase the receive buffer size for the NETLINK_KOBJECT_UEVENT
socket to 2MB. Unless a large number of uevents queue up, that memory is
not allocated anyways. The receive buffer size serves only as an upper
limit for the total amount of memory consumed by all skbs queued to a
specific socket.

We experienced situations where ueventd got blocked for multiple seconds
while writing to /dev/kmsg, and the receive buffer overflowed in the
meantime.

Bug: 72648767
Change-Id: Ice6d7b9c5ed9c83efbad6111086ce95ac6432561
2018-03-13 05:35:44 +00:00
Treehugger Robot 9f5e6dbe85 Merge "Export init.svc.console as an actionable property" 2018-03-12 22:47:29 +00:00
Daniel Mentz 636ed5fc72 ueventd: Increase uevent buffer size to 2MB
Let's increase the receive buffer size for the NETLINK_KOBJECT_UEVENT
socket to 2MB. Unless a large number of uevents queue up, that memory is
not allocated anyways. The receive buffer size serves only as an upper
limit for the total amount of memory consumed by all skbs queued to a
specific socket.

We experienced situations where ueventd got blocked for multiple seconds
while writing to /dev/kmsg, and the receive buffer overflowed in the
meantime.

Test: compile
Bug: 72648767
Change-Id: Ice6d7b9c5ed9c83efbad6111086ce95ac6432561
2018-03-12 11:35:02 -07:00
Jaekyun Seok cba467eeda Export init.svc.console as an actionable property
The state of console can be used to set up a device for debugging.

Bug: 74266614
Test: succeeded building and tested with Pixels
Change-Id: I3691fa2819594a521e05dad150550ab309a78c68
2018-03-12 10:53:32 +09:00
Tom Cherry c602f5ab60 Merge changes I443e733f,If1e89a67,I0481d87a
* changes:
  init: document previously undocumentary service options
  init: alphabetize service options in README.md
  init: alphabetize service options
2018-03-09 02:08:27 +00:00
Tom Cherry cb336eef48 init: document previously undocumentary service options
These all should have been documented previously but haven't been.

Test: n/a
Change-Id: I443e733f06584bb09b68b404608c8a611bb2baa0
2018-03-08 14:41:20 -08:00
Tom Cherry bbbfed6083 init: alphabetize service options in README.md
Test: n/a
Change-Id: If1e89a67a41279cab6acf3e38ff8eb5b77a274c1
2018-03-08 14:40:18 -08:00
Tom Cherry e2f341e8ce init: alphabetize service options
Lists should always be alphabetized...

Test: treehugger
Change-Id: I0481d87ac62b59bbe8f328eeaaac1a84a05f20a9
2018-03-08 13:51:10 -08:00
Steven Moreland 422367b97f init: use FQName parse
FQName::FQName(string) could leave the FQName in an
invalid state, and so this constructor is being removed
and the mValid member is being removed.

Bug: 73774955
Test: boots + interface_start control messages received by init
Change-Id: I58d4a089c0a0f1c2cc5129c5e87321e7f6663b72
2018-03-07 19:00:15 +00:00
Treehugger Robot b9ee9abebe Merge "Revert "If enablefilecrypto or init_user0 fails, reboot into recovery."" 2018-03-02 01:26:32 +00:00
Paul Crowley e242a97db5 Revert "If enablefilecrypto or init_user0 fails, reboot into recovery."
This reverts commit 959b055535.

Reason for revert: b/73968735
Bug: 73968735
Test: b/73968735#comment5

Change-Id: Ifce4c029bab7380c60e20cc2b2885beb4a097456
2018-03-01 23:24:20 +00:00
Tom Cherry dc375869ab Restrict setting platform properties from vendor .prop files
We should only allow vendor-init-settable properties to be set from
.prop files on /vendor and /odm.

Bug: 73905119
Test: test on walleye that disallowed properties are rejected
Change-Id: I2a5d244fdc71060ddda3e3d87442e831e6b97831
2018-03-01 11:17:07 -08:00
Tom Cherry 69d47aa829 Clean up property set error handling
Currently we only report why a property set call has failed but drop
the context of what was trying to set the property.  This change
adds information about why a property was trying to be set when it
fails.

It also unifies property_set() within init to go through the same
HandlePropertySet() function as normal processes do, removing unneeded
special cases.

Test: boot bullhead
Test: attempt to set invalid properties and see better error messages
Change-Id: I5cd3a40086fd3b226e9c8a5e3a84cb3b31399c0d
2018-03-01 11:14:02 -08:00
Tom Cherry 547f7318c2 Don't build host_init_verifier on Android either
Also fixes another mac build issue...

Test: linux builds still work...
Change-Id: I549891c7e38729bd5fbe79f79b7345dabd9b4b28
2018-02-28 21:43:59 -08:00
Tom Cherry 96ff0fed82 Don't build host_init_verifier for darwin
And therefore fix the mac build break.

Test: none
Change-Id: Ice28780abc62fc3e46119497d23bcbc124354159
2018-02-28 17:21:14 -08:00
Tom Cherry de6bd50d42 init: add host side parser for init
Create a host side parser for init such that init rc files can be
verified for syntax correctness before being used on the device.

Bug: 36970783
Test: run the parser on init files on host

Change-Id: I7e8772e278ebaff727057308596ebacf28b6fdda
2018-02-28 10:45:45 -08:00
Tom Cherry 89063827b1 Merge "init: Reboot after timeout passes during reboot" 2018-02-26 17:41:11 +00:00
Treehugger Robot a4644c9bc4 Merge "Document property expansion." 2018-02-23 20:41:36 +00:00
Tom Cherry c9fec9d2be init: Reboot after timeout passes during reboot
There is currently a timeout for reboot, however if the system gets
stuck, particularly during file system operations, there is no safety
mechanism that guarantees the system will still reboot.

This change does all of the optional reboot steps in a separate thread
and waits for this thread with a timeout, such that if the reboot
steps get hung, the system is guaranteed to still reboot.

This is specific to 'reboot'.  Shutdown continues to run unbounded to
run fsck.

Bug: 72781711
Test: Reboot devices hitting and not hitting this timeout
Change-Id: Id5e1b3693bab00602177e28b9b662e1499c32961
2018-02-23 11:03:01 -08:00