flatcar-scripts/mod_for_factory_scripts/200patchInitScript

109 lines
3.3 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
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-05 21:33:11.000000000 -0700
+++ new/etc/init/dump-boot-stats.conf 2010-04-05 21:00:48.000000000 -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 stopping autotest
script
cd /usr/local/autotest
if [ ! -e factory_started ]; then
touch factory_started
date >> /var/log/factory.log
cp -f site_tests/suite_Factory/control.full control
./bin/autotest control >> /var/log/factory.log 2>&1
fi
end script
EOF
cat > ${ROOT_FS_DIR}/etc/init/autotest.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 autotest startup stub"
author "chromium-os-dev@googlegroups.com"
start on started udev
script
# Sleep as the current upstart sequence gives no clear completion signal.
# TODO: investigate generating authoritative bootup finished event.
sleep 10
cd /usr/local/autotest
date >> /var/log/factory.log
./tools/autotest >> /var/log/factory.log 2>&1
end script
EOF
cat > ${ROOT_FS_DIR}/etc/init/tty1.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 startup
stop on starting halt or starting reboot
respawn
script
cd /
/sbin/agetty 38400 tty1 linux -l /bin/bash -n
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