#!/bin/sh ## live-config(7) - System Configuration Scripts ## Copyright (C) 2006-2011 Daniel Baumann ## ## live-config comes with ABSOLUTELY NO WARRANTY; for details see COPYING. ## This is free software, and you are welcome to redistribute it ## under certain conditions; see COPYING for details. Upstart () { # Checking if package is installed or already configured if [ ! -e /var/lib/dpkg/info/upstart.list ] || \ [ -e /var/lib/live/config/upstart ] then return fi echo -n " upstart" Configure_upstart } Configure_upstart () { for _FILE in /etc/init/tty* do _TTY="$(basename ${_FILE} .conf)" # mingetty has autologin support if [ -e /sbin/mingetty ] || grep -qs '^exec.*mingetty' "${_FILE}" then sed -i -e 's|^\(exec.*getty\) *\(--autologin *[^ ]* *\)*.*$|exec /sbin/mingetty --autologin '"${LIVE_USERNAME} ${_TTY}|g" "${_FILE}" else # substitute getty with a direct login sed -i -e 's|^exec.*getty.*$|exec /bin/login -f '"${LIVE_USERNAME} /dev/${_TTY} 2>\&1|" "${_FILE}" fi done init q for _FILE in /etc/init/tty* do _TTY="$(basename ${_FILE} .conf)" # Try reloading if stop ${_TTY}; then start ${_TTY} fi done # Creating state file touch /var/lib/live/config/upstart } Upstart