flatcar-scripts/mod_for_factory_scripts/200patchInitScript
Nick Sanders 1bec876896 Clean upstart for factory test
* Leave ui.conf there, not run by default.
* dump autotest log into /dev/tty1
* Don't let tty1 eat keayboard events.

Review URL: http://codereview.chromium.org/1742018
2010-04-29 21:51:25 -07:00

104 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) 2010 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."
pushd ${ROOT_FS_DIR}
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
@@ -5,7 +5,7 @@
description "Chrome OS user interface"
author "chromium-os-dev@googlegroups.com"
-start on stopping startup
+start on never
stop on starting halt or starting reboot
respawn
EOF
patch -d ${ROOT_FS_DIR} -Np1 <<EOF
diff -Naur old/etc/init/dump-boot-stats.conf new/etc/init/dump-boot-stats.conf
--- old/etc/init/dump-boot-stats.conf 2010-04-28 21:35:33.785340000 -0700
+++ new/etc/init/dump-boot-stats.conf 2010-04-28 21:36:28.819984000 -0700
@@ -7,7 +7,7 @@
# when login-prompt-ready is received, grabs the current uptime and
# disk stats. Also sends uptime to metrics client for perf dashboard
-start on login-prompt-ready
+start on stopping startup
# This is run-once rather than a service.
task
EOF
cat > ${ROOT_FS_DIR}/etc/init/factory.conf <<EOF
# Copyright (c) 2010 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.
description "Chrome OS factory startup stub"
author "chromium-os-dev@googlegroups.com"
start on started udev
script
cd /usr/local/autotest
date >> /var/log/factory.log
if [ ! -e factory_started ]; then
touch factory_started
cp -f site_tests/suite_Factory/control.full control
./bin/autotest control >> /var/log/factory.log 2>&1
else
./tools/autotest >> /var/log/factory.log 2>&1
fi
end script
EOF
cat > ${ROOT_FS_DIR}/etc/init/factorylog.conf <<EOF
# Copyright (c) 2010 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.
start on started factory
stop on starting halt or starting reboot
respawn
script
tail -n 48 -F /var/log/factory.log > /dev/tty1
end script
EOF
patch -d ${ROOT_FS_DIR} -Np1 <<EOF
diff -Naur old/sbin/chromeos_startup new/sbin/chromeos_startup
--- old/sbin/chromeos_startup 2010-04-05 21:33:52.000000000 -0700
+++ new/sbin/chromeos_startup 2010-04-05 21:38:02.000000000 -0700
@@ -20,18 +20,12 @@
# Moblin trick: Disable blinking cursor. Without this a splash screen
# will show a distinct cursor shape even when the cursor is set to none.
-echo 0 > /sys/devices/virtual/graphics/fbcon/cursor_blink
+# echo 0 > /sys/devices/virtual/graphics/fbcon/cursor_blink
# Since we defer udev until later in the boot process, we pre-populate /dev
# with the set of devices needed for X and other early services to run.
cp -a -f /lib/chromiumos/devices/* /dev
-# Splash screen!
-if [ -x /usr/bin/ply-image ]
-then
- /usr/bin/ply-image /usr/share/chromeos-assets/images/login_splash.png &
-fi
-
mount -n -t tmpfs tmp /tmp
mount -n -t tmpfs -onosuid,nodev shmfs /dev/shm
mount -n -t devpts -onoexec,nosuid,gid=5,mode=0620 devpts /dev/pts
EOF
popd