flatcar-scripts/mod_for_factory_scripts/200patchInitScript
Hung-Te Lin 9cac2869c7 cros mod_image_for_factory: don't enable update engine for factory test images
To get best factory test image performance, we should disable update engine.

BUG=chromium-os:13613
TEST=image_to_usb --factory --to=FACTORY
     then verified /etc/init/update-engine.conf is disabled.

Change-Id: Ifb7b6c821f434ee68625ffea0eb7907c38d77315

R=nsanders@chromium.org

Review URL: http://codereview.chromium.org/6759023
2011-03-30 18:42:43 +08:00

65 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
echo "Applying patch to init scripts."
touch "${ROOT_FS_DIR}/root/.factory_test"
patch -d "${ROOT_FS_DIR}" -Np1 <<EOF
--- old/etc/init/ui.conf 2010-04-28 21:28:38.886069000 -0700
+++ new/etc/init/ui.conf 2010-04-28 21:29:42.676163000 -0700
@@ -11 +11 @@
-start on stopping startup
+start on never
EOF
patch -d "${ROOT_FS_DIR}" -Np1 <<EOF
diff -Naur old/etc/init/boot-complete.conf new/etc/init/boot-complete.conf
--- old/etc/init/boot-complete.conf 2010-07-21 11:22:30.000000000 +0800
+++ new/etc/init/boot-complete.conf 2010-07-21 22:13:36.000000000 +0800
@@ -15 +15 @@
-start on login-prompt-visible
+start on started udev
EOF
if [ -r "${ROOT_FS_DIR}/etc/init/update-engine.conf" ]; then
patch -d "${ROOT_FS_DIR}" -Np1 <<EOF
diff -Na -U 0 old/etc/init/update-engine.conf new/etc/init/
--- old/etc/init/update-engine.conf 2010-08-05 16:32:55.000000000 -0700
+++ new/etc/init/update-engine.conf 2010-08-05 16:32:45.000000000 -0700
@@ -8 +8 @@
-start on starting system-services and started dbus
+start on never
EOF
fi
if [ -r "${ROOT_FS_DIR}/etc/init/chrontel.conf" ]; then
patch -d "${ROOT_FS_DIR}" -Np1 <<EOF
diff -Nau old/etc/init/chrontel.conf new/etc/init/
--- old/etc/init/chrontel.conf 2010-08-05 16:32:55.000000000 -0700
+++ new/etc/init/chrontel.conf 2010-08-05 16:32:45.000000000 -0700
@@ -7 +7 @@
-start on started udev
+start on never
EOF
fi
if [ -r "${ROOT_FS_DIR}/etc/init/nvrm.conf" ]; then
patch -d "${ROOT_FS_DIR}" -Np1 << EOF
--- old/etc/init/nvrm.conf 2010-11-19 14:57:16.000000000 -0800
+++ new/etc/init/nvrm.conf 2010-11-19 16:52:48.000000000 -0800
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-start on starting ui
+start on starting factory
respawn
EOF
fi