OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # boot-complete | 5 description "Send boot stats after login prompt is visible" |
6 # | 6 author "chromium-os-dev@chromium.org" |
7 # Processing required during boot after login prompt is displayed. | |
8 # Primarily, this means calculating boot time statistics. | |
9 | 7 |
| 8 # This script is primarily responsible for sending boot time statistics |
| 9 # after we finish booting. Note that many other jobs also start on |
| 10 # "stopped boot-complete", though. |
10 | 11 |
11 # Note, this line is modified by chromeos-factoryinstall.ebuild | 12 # Note, this line is modified by chromeos-factoryinstall.ebuild |
12 # and mod_for_factory. Please do not change without also changing | 13 # and mod_for_factory. Please do not change without also changing |
13 # those references. | 14 # those references. |
14 start on login-prompt-ready | 15 start on login-prompt-visible |
15 | 16 |
16 task | 17 task |
17 | 18 |
18 script | 19 script |
19 # The login-prompt-ready signal is emitted every time the login | 20 # The login-prompt-visible signal is emitted every time the login |
20 # screen is displayed so the check below makes sure boot stats are | 21 # screen is displayed. The check below makes sure boot stats are |
21 # generated only once per boot. | 22 # reported only once per boot. |
22 if [ -n "$(bootstat_last login-prompt-ready)" ]; then | 23 if [ -n "$(bootstat_get_last boot-complete)" ]; then |
23 exit 0 | 24 exit 0 |
24 fi | 25 fi |
25 | 26 |
26 bootstat login-prompt-ready | 27 bootstat boot-complete |
27 | 28 |
28 # If ureadahead is still running, then presumably it's performing | 29 # If ureadahead is still running, then presumably it's performing |
29 # a boot trace. We only care about tracing until login prompt, so | 30 # a boot trace. We only care about tracing until login prompt, so |
30 # stop the process now. | 31 # stop the process now. |
31 # | 32 # |
32 # We have to ignore the return status in case ureadahead has | 33 # We have to ignore the return status in case ureadahead has |
33 # already completed, because pkill helpfully exits with a non-zero | 34 # already completed, because pkill helpfully exits with a non-zero |
34 # status when no process was found. | 35 # status when no process was found. |
35 pkill '^ureadahead$' || true | 36 pkill '^ureadahead$' || true |
36 | 37 |
37 # Report boot time and disk usage metrics to UMA. | 38 # Report boot time and disk usage metrics to UMA. |
38 send_boot_metrics & | 39 send_boot_metrics & |
39 end script | 40 end script |
OLD | NEW |