Commit graph

1805 commits

Author SHA1 Message Date
Tom Cherry
e0d1699487 Merge "init: add info logs in first stage mount if we have to poll" am: 6a9d56775f am: 11d5611ba5 am: 7b600f8012
am: 71ed340d1e

Change-Id: I722d6d71a9505d2b579a4bb9484221b73d71d50b
2017-07-06 04:55:40 +00:00
Tom Cherry
71ed340d1e Merge "init: add info logs in first stage mount if we have to poll" am: 6a9d56775f am: 11d5611ba5
am: 7b600f8012

Change-Id: I4abc2b23c0b86059d44965b0139256f7617f48dd
2017-07-06 04:53:38 +00:00
Tom Cherry
7b600f8012 Merge "init: add info logs in first stage mount if we have to poll" am: 6a9d56775f
am: 11d5611ba5

Change-Id: Ib08ea62f6fb13cfaed6bc894bcbc548ccd8c3d55
2017-07-06 04:51:08 +00:00
Tom Cherry
11d5611ba5 Merge "init: add info logs in first stage mount if we have to poll"
am: 6a9d56775f

Change-Id: I7948db4cf1d6af6f4e6d0ddb2a2788f62317126f
2017-07-06 04:48:38 +00:00
Treehugger Robot
6a9d56775f Merge "init: add info logs in first stage mount if we have to poll" 2017-07-06 04:46:05 +00:00
Tom Cherry
1b5db82fd9 Merge "ueventd: don't double fork firmware handlers" am: 0f4fb5497a am: e944b7e0a4 am: 1eee2122ca
am: 7c4b63be8c

Change-Id: I39c17229dd4043da3ed5824b7a13b2d2e8cede4a
2017-07-06 02:53:11 +00:00
Tom Cherry
7c4b63be8c Merge "ueventd: don't double fork firmware handlers" am: 0f4fb5497a am: e944b7e0a4
am: 1eee2122ca

Change-Id: I726a412b0b01c4f829847b8ebdef97be4df5abef
2017-07-06 02:33:52 +00:00
Tom Cherry
1eee2122ca Merge "ueventd: don't double fork firmware handlers" am: 0f4fb5497a
am: e944b7e0a4

Change-Id: Ifc8c586aa3b06ecb42bf20284c461b4b7c159bc7
2017-07-06 02:21:26 +00:00
Tom Cherry
e944b7e0a4 Merge "ueventd: don't double fork firmware handlers"
am: 0f4fb5497a

Change-Id: I2a40b76e937853fd2f1eed61cc0fe4f6fa465ba2
2017-07-06 02:10:57 +00:00
Tom Cherry
0f4fb5497a Merge "ueventd: don't double fork firmware handlers" 2017-07-06 02:02:33 +00:00
Keun-young Park
f5b616dabf Merge "add "shutdown critical" to service" am: b3915d113d am: a4ad5d0328 am: 19ec8e7bcf
am: bedc5faea7

Change-Id: I62cd1bc82531b88f5d8c8ac2dd637d5ec9d52572
2017-07-06 01:38:15 +00:00
Keun-young Park
bedc5faea7 Merge "add "shutdown critical" to service" am: b3915d113d am: a4ad5d0328
am: 19ec8e7bcf

Change-Id: Ide84d7f87a9884068ebc1cc9680c997507727af3
2017-07-06 01:13:19 +00:00
Keun-young Park
19ec8e7bcf Merge "add "shutdown critical" to service" am: b3915d113d
am: a4ad5d0328

Change-Id: I6467657616371e84468975e56ac086855a298efb
2017-07-06 00:56:18 +00:00
Keun-young Park
a4ad5d0328 Merge "add "shutdown critical" to service"
am: b3915d113d

Change-Id: I25b6f42478efda7077e00141042a427245393d28
2017-07-06 00:46:31 +00:00
Treehugger Robot
b3915d113d Merge "add "shutdown critical" to service" 2017-07-06 00:40:55 +00:00
Wei Wang
a89b61ad99 Merge "init: Support custom shutdown actions" am: c1bc4241f8 am: 5b89535442 am: b39890048c
am: 2a38e6d119

Change-Id: I6776039ebf9f87b41193cc24a9786dc80db99e43
2017-07-06 00:22:45 +00:00
Tom Cherry
38728d6ca8 Merge "Merge "ueventd: remove character device symlinks (/dev/usb/*)" am: f3ae82f57f am: 6e0b51825b am: bef2bbdf62" into oc-dr1-dev-plus-aosp
am: 93e81d4775

Change-Id: Ie1cdea248765cf8a3ab96deb59d27016a181b1f6
2017-07-06 00:21:01 +00:00
Tom Cherry
2afdb6d526 Merge "init: reap zombies only after kill(-pid, ...)" am: a51c40ce35 am: 0924b32c1f am: 419a9ef8f1
am: fc479afbb6

Change-Id: Id45511f512fce014de32cc4d642df4cdcf5634c3
2017-07-06 00:20:08 +00:00
Wei Wang
2a38e6d119 Merge "init: Support custom shutdown actions" am: c1bc4241f8 am: 5b89535442
am: b39890048c

Change-Id: I57a0422f47094cc061163510138e9562648fdd98
2017-07-05 23:58:51 +00:00
Wei Wang
b39890048c Merge "init: Support custom shutdown actions" am: c1bc4241f8
am: 5b89535442

Change-Id: I57b87dac016b4d7d6f982ee0057823eb1119bab7
2017-07-05 23:56:50 +00:00
Wei Wang
5b89535442 Merge "init: Support custom shutdown actions"
am: c1bc4241f8

Change-Id: I6bb1789dbc5edbb10f2f4d712e9ca83e6302fdf4
2017-07-05 23:54:56 +00:00
Treehugger Robot
c1bc4241f8 Merge "init: Support custom shutdown actions" 2017-07-05 23:49:41 +00:00
Tom Cherry
0f296e06d6 ueventd: don't double fork firmware handlers
ueventd may be asked to handle firmware during the time critical
coldboot process.  If we double fork to avoid needing to reap the
firmware handler, then we may add significant delay to this process,
as the first child may not get scheduled quickly enough for waitpid()
to complete without delay.

Bug: 63081260
Test: boot bullhead and sailfish, check that firmwares are loaded,
      no zombie ueventd processes remain, and no new errors are shown
Change-Id: I2bac3b1fbc3a58557a00326e491c104656db27ae
2017-07-05 16:41:11 -07:00
Tom Cherry
07999f8677 Merge "ueventd: remove character device symlinks (/dev/usb/*)" am: f3ae82f57f am: 6e0b51825b
am: bef2bbdf62

Change-Id: Ice5ec0702cbdae53d7a78bceb7a24e923a488319
2017-07-05 23:37:46 +00:00
Tom Cherry
fc479afbb6 Merge "init: reap zombies only after kill(-pid, ...)" am: a51c40ce35 am: 0924b32c1f
am: 419a9ef8f1

Change-Id: I0f2e6b2b2dfed4dab480acf2562df78da8d2f65e
2017-07-05 23:37:21 +00:00
Tom Cherry
bef2bbdf62 Merge "ueventd: remove character device symlinks (/dev/usb/*)" am: f3ae82f57f
am: 6e0b51825b

Change-Id: Ic31e720cd9014de76f0fd999af44ce3c3ffcd482
2017-07-05 23:01:53 +00:00
Tom Cherry
419a9ef8f1 Merge "init: reap zombies only after kill(-pid, ...)" am: a51c40ce35
am: 0924b32c1f

Change-Id: I18a3c9a9a96a2488c7714113175f3e8115bd697f
2017-07-05 23:01:35 +00:00
Tom Cherry
6e0b51825b Merge "ueventd: remove character device symlinks (/dev/usb/*)"
am: f3ae82f57f

Change-Id: Ib601af84ed3b186705caaed05706d6b1f3c5746c
2017-07-05 22:50:35 +00:00
Tom Cherry
0924b32c1f Merge "init: reap zombies only after kill(-pid, ...)"
am: a51c40ce35

Change-Id: I4f1b7a05cdff1fe7851b528d0bdeda354011b599
2017-07-05 22:50:17 +00:00
Tom Cherry
f3ae82f57f Merge "ueventd: remove character device symlinks (/dev/usb/*)" 2017-07-05 22:41:55 +00:00
Jin Qian
3ca00a3c98 Merge "init: rename mke2fs tools with _static suffix" into oc-dr1-dev
am: 5c5c544e80

Change-Id: Ifee5b6516fe3aee03df845a46421753295cbc740
2017-07-05 22:40:42 +00:00
Tom Cherry
a51c40ce35 Merge "init: reap zombies only after kill(-pid, ...)" 2017-07-05 22:39:51 +00:00
TreeHugger Robot
5c5c544e80 Merge "init: rename mke2fs tools with _static suffix" into oc-dr1-dev 2017-07-05 22:33:35 +00:00
Keun-young Park
cccb34fce8 add "shutdown critical" to service
- "shutdown critical" prevents killing the service during
  shutdown. And the service will be started if not running.
- Without it, services will be killed by SIGTERM / SIGKILL during shutdown.
- Even services with "shutdown critical" will be killed if shutdown
  times out.
- Removes ueventd and vold from hard coded list. Each service's rc will
  be updated to add "shutdown critical". watchdogd is still kept in the list.

bug: 37626581
Test: reboot and check last kmsg

Change-Id: Ie8cc699d1efbc59b9a2561bdd40fec64aed5a4bb
2017-07-05 14:55:22 -07:00
Wei Wang
eeab491efd init: Support custom shutdown actions
We have been seeing panics and errors during shutdown sequence in
some vendor's platform, and it is required to disable error handling
during shutdown.

This CL separates the shutdown request to execute another "shutdown"
trigger at the beginning of shutdown stage. And vendor can use this
trigger to add custom commands needed for shutting down gracefully.

Bug: 38203024
Bug: 62084631
Test: device reboot/shutdown
Change-Id: I3fac4ed59f06667d86e477ee55ed391cf113717f
2017-07-05 14:49:57 -07:00
Tom Cherry
322e176f6a init: add info logs in first stage mount if we have to poll
It's not a error case if we do not find a device that we're attempting
to regenerate uevents for during first stage mount, but it is likely
to increase boot time, so we log a message to attribute this delay.

Bug: 63327193
Test: Boot bullhead, sailfish

Change-Id: I97c2e5aefd218bbdd87717ff3c375381f725de08
2017-07-05 14:05:03 -07:00
Nick Kralevich
1d4647b4ce Merge "Remove unnecessary SELinux dependencies" am: 22de50d351 am: e9b9b10c58 am: 0056e6bccc
am: 4192d74a83

Change-Id: I6d1cfcbfa98881fb24a516646f030d451fa357ee
2017-07-01 16:54:36 +00:00
Nick Kralevich
4192d74a83 Merge "Remove unnecessary SELinux dependencies" am: 22de50d351 am: e9b9b10c58
am: 0056e6bccc

Change-Id: Id160e23a6bd53238ad279bb5b28e7ca8a08c0805
2017-07-01 16:49:35 +00:00
Nick Kralevich
0056e6bccc Merge "Remove unnecessary SELinux dependencies" am: 22de50d351
am: e9b9b10c58

Change-Id: Ifead418ceb9fe806d76102d9068a32539a8b99d0
2017-07-01 16:44:36 +00:00
Nick Kralevich
e9b9b10c58 Merge "Remove unnecessary SELinux dependencies"
am: 22de50d351

Change-Id: Icbd6b0df4378980eb2a7878bab1896f6ecefb6a8
2017-07-01 16:39:37 +00:00
Nick Kralevich
33391dad15 Remove unnecessary SELinux dependencies
These are unused.

Test: code compiles.
Change-Id: Idd707dfcc8f6daac3a489c791ecc364841cf31f9
2017-07-01 07:41:48 -07:00
Luis Hector Chavez
9ba4038c79 Merge "init: Read previous state of securebits before modifying" am: c10e14110a am: 19f32317b3 am: 9dabbbaa6a
am: dd79958ecb

Change-Id: Ic053669c2e3c576a27b1ee4748c635c338068105
2017-07-01 00:45:12 +00:00
Luis Hector Chavez
dd79958ecb Merge "init: Read previous state of securebits before modifying" am: c10e14110a am: 19f32317b3
am: 9dabbbaa6a

Change-Id: Id5cdc260c7f6800e493c0f3b4e0da08ddca34b63
2017-07-01 00:39:42 +00:00
Luis Hector Chavez
9dabbbaa6a Merge "init: Read previous state of securebits before modifying" am: c10e14110a
am: 19f32317b3

Change-Id: I87084032373a71b507ed0604c7ff38ec076fc74a
2017-07-01 00:35:11 +00:00
Luis Hector Chavez
19f32317b3 Merge "init: Read previous state of securebits before modifying"
am: c10e14110a

Change-Id: I0a9b2dc97ebbc449288de2ce3e2745a1f60a4372
2017-07-01 00:30:42 +00:00
Luis Hector Chavez
f5965519d1 init: Read previous state of securebits before modifying
When Android is running in a container, some of the securebits might be
locked, which makes prctl(PR_SET_SECUREBITS) fail.

This change gets the previous state of the process' securebits and adds
the desired bits.

Bug: 62388055
Test: aosp_bullhead-eng boots
Test: If init has non-zero securebits, it can also boot
Change-Id: Ie03bf2538f9dca40955bc58314d269246f5731bd
2017-06-30 14:42:46 -07:00
Tom Cherry
8d13d808a5 init: reap zombies only after kill(-pid, ...)
When init gets SIGCHLD, it uses waitpid() to get the pid of an exited
process.  It then calls kill(-pid, ...) to ensure that all processes
in the process group started by that process are killed as well.

There is a bug here however as waitpid() reaps the pid when it
returns, meaning that the call to kill(-pid, ...) may fail with ESRCH
as there are no remaining references to that pid.  Or worse, if the
pid is reused, the wrong processes may get the signal.

This fixes the bug by using waitid() with WNOWAIT to get the pid of an
exited process, which does not reap the pid.  It then uses waitpid()
with the returned pid to do the reap only after the above kill(-pid,
...) and other operations have completed.

Bug: 38164998
Test: kill surfaceflinger and see that processes exit and are reaped
      appropriately
Test: `adb reboot` and observe that the extraneous kill() failed
      messages do not appear

Change-Id: Ic0213e1c97e0141e6c13129dc2abbfed86de138b
2017-06-30 13:52:48 -07:00
Luis Hector Chavez
ea8ac69141 Merge changes I0a95f87a,I36b22986 am: a703202093 am: 835d259e7a am: 40e88b22f2
am: 1b42dbf22c

Change-Id: Icf60412199db65e686c2f3b38087d0fc66cad7f6
2017-06-30 04:38:03 +00:00
Luis Hector Chavez
1b42dbf22c Merge changes I0a95f87a,I36b22986 am: a703202093 am: 835d259e7a
am: 40e88b22f2

Change-Id: I04e3d91d34d2c50d15ab2357db175b1f69796af1
2017-06-30 04:33:30 +00:00
Luis Hector Chavez
40e88b22f2 Merge changes I0a95f87a,I36b22986 am: a703202093
am: 835d259e7a

Change-Id: I329bddc9b470da86d07bde3ce3ab8a69c37a38e2
2017-06-30 04:29:28 +00:00