OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 echo "Applying patch to init scripts." | 7 echo "Applying patch to init scripts." |
8 | 8 |
9 touch "${ROOT_FS_DIR}/root/.factory_test" | 9 touch "${ROOT_FS_DIR}/root/.factory_test" |
10 | 10 |
11 patch -d "${ROOT_FS_DIR}" -Np1 <<EOF | 11 patch -d "${ROOT_FS_DIR}" -Np1 <<EOF |
12 --- old/etc/init/ui.conf 2010-04-28 21:28:38.886069000 -0700 | 12 --- old/etc/init/ui.conf 2010-04-28 21:28:38.886069000 -0700 |
13 +++ new/etc/init/ui.conf 2010-04-28 21:29:42.676163000 -0700 | 13 +++ new/etc/init/ui.conf 2010-04-28 21:29:42.676163000 -0700 |
14 @@ -11 +11 @@ | 14 @@ -11 +11 @@ |
15 -start on stopping startup | 15 -start on stopping startup |
16 +start on never | 16 +start on never |
17 EOF | 17 EOF |
18 | 18 |
19 patch -d "${ROOT_FS_DIR}" -Np1 <<EOF | 19 patch -d "${ROOT_FS_DIR}" -Np1 <<EOF |
20 diff -Naur old/etc/init/boot-complete.conf new/etc/init/boot-complete.conf | 20 diff -Naur old/etc/init/boot-complete.conf new/etc/init/boot-complete.conf |
21 --- old/etc/init/boot-complete.conf 2010-07-21 11:22:30.000000000 +0800 | 21 --- old/etc/init/boot-complete.conf 2010-07-21 11:22:30.000000000 +0800 |
22 +++ new/etc/init/boot-complete.conf 2010-07-21 22:13:36.000000000 +0800 | 22 +++ new/etc/init/boot-complete.conf 2010-07-21 22:13:36.000000000 +0800 |
23 @@ -15 +15 @@ | 23 @@ -15 +15 @@ |
24 -start on login-prompt-visible | 24 -start on login-prompt-visible |
25 +start on started udev | 25 +start on started udev |
26 EOF | 26 EOF |
27 | 27 |
28 cat >"${ROOT_FS_DIR}/etc/init/factory.conf" <<EOF | |
29 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | |
30 # Use of this source code is governed by a BSD-style license that can be | |
31 # found in the LICENSE file. | |
32 | |
33 description "Chrome OS factory startup stub" | |
34 author "chromium-os-dev@chromium.org" | |
35 | |
36 start on stopped udev-addon | |
37 stop on starting halt or starting reboot | |
38 | |
39 script | |
40 /sbin/modprobe i2c-dev | |
41 cd /usr/local/autotest | |
42 eval \$(./site_tests/suite_Factory/startx.sh) | |
43 date >>/var/log/factory.log | |
44 if [ ! -e factory_started ]; then | |
45 touch factory_started | |
46 cp -f site_tests/suite_Factory/control . | |
47 ./bin/autotest -t factory control >>/var/log/factory.log 2>&1 | |
48 else | |
49 ./bin/autotest -t factory -c control >>/var/log/factory.log 2>&1 | |
50 fi | |
51 end script | |
52 | |
53 pre-stop script | |
54 pkill python | |
55 pkill X | |
56 end script | |
57 EOF | |
58 | |
59 cat >"${ROOT_FS_DIR}/etc/init/factorylog.conf" <<EOF | |
60 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | |
61 # Use of this source code is governed by a BSD-style license that can be | |
62 # found in the LICENSE file. | |
63 | |
64 description "Print Chrome OS factory log to tty3" | |
65 author "chromium-os-dev@chromium.org" | |
66 | |
67 start on started factory | |
68 stop on starting halt or starting reboot | |
69 | |
70 respawn | |
71 script | |
72 tail -n 48 -F /var/log/factory.log >/dev/tty3 | |
73 end script | |
74 EOF | |
75 | |
76 if [ -r "${ROOT_FS_DIR}/etc/init/chrontel.conf" ]; then | 28 if [ -r "${ROOT_FS_DIR}/etc/init/chrontel.conf" ]; then |
77 patch -d "${ROOT_FS_DIR}" -Np1 <<EOF | 29 patch -d "${ROOT_FS_DIR}" -Np1 <<EOF |
78 diff -Nau old/etc/init/chrontel.conf new/etc/init/ | 30 diff -Nau old/etc/init/chrontel.conf new/etc/init/ |
79 --- old/etc/init/chrontel.conf 2010-08-05 16:32:55.000000000 -0700 | 31 --- old/etc/init/chrontel.conf 2010-08-05 16:32:55.000000000 -0700 |
80 +++ new/etc/init/chrontel.conf 2010-08-05 16:32:45.000000000 -0700 | 32 +++ new/etc/init/chrontel.conf 2010-08-05 16:32:45.000000000 -0700 |
81 @@ -7 +7 @@ | 33 @@ -7 +7 @@ |
82 -start on started udev | 34 -start on started udev |
83 +start on never | 35 +start on never |
84 EOF | 36 EOF |
85 fi | 37 fi |
86 | 38 |
87 if [ -r "${ROOT_FS_DIR}/etc/init/nvrm.conf" ]; then | 39 if [ -r "${ROOT_FS_DIR}/etc/init/nvrm.conf" ]; then |
88 patch -d "${ROOT_FS_DIR}" -Np1 << EOF | 40 patch -d "${ROOT_FS_DIR}" -Np1 << EOF |
89 --- old/etc/init/nvrm.conf 2010-11-19 14:57:16.000000000 -0800 | 41 --- old/etc/init/nvrm.conf 2010-11-19 14:57:16.000000000 -0800 |
90 +++ new/etc/init/nvrm.conf 2010-11-19 16:52:48.000000000 -0800 | 42 +++ new/etc/init/nvrm.conf 2010-11-19 16:52:48.000000000 -0800 |
91 @@ -2,7 +2,7 @@ | 43 @@ -2,7 +2,7 @@ |
92 # Use of this source code is governed by a BSD-style license that can be | 44 # Use of this source code is governed by a BSD-style license that can be |
93 # found in the LICENSE file. | 45 # found in the LICENSE file. |
94 | 46 |
95 -start on starting ui | 47 -start on starting ui |
96 +start on starting factory | 48 +start on starting factory |
97 | 49 |
98 respawn | 50 respawn |
99 | 51 |
100 EOF | 52 EOF |
101 fi | 53 fi |
OLD | NEW |