4 DESCRIPTION="Setting up init..."
6 . /scripts/live-functions
21 log_begin_msg "$DESCRIPTION"
23 # Arrange for shells on virtual consoles, rather than login prompts
25 if [ -n "$USERNAME" ]; then
26 if [ ! -z "${LIVE_GETTY}" ]; then
27 if echo "${DEFCONSOLE}" | grep -qs ttyS; then
28 # AUTOMATIC SERIAL CONSOLE #
29 PORT=$(echo "${DEFCONSOLE}" | \
31 SPEED=$(echo "${DEFCONSOLE}" | \
32 sed -e 's%ttyS[0-9]\+,%%' \
33 -e's%\([0-9]\+\).*%\1%')
34 if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" ) ; then
35 IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9"
39 if ! grep "^${ID}:" /etc/inittab ; then
40 #make sure it is not already in use
45 echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" \
49 if [ -f /root/etc/inittab ]; then
50 sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/live-getty%' /root/etc/inittab
53 if [ -f /root/etc/inittab ]; then
54 sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
56 if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]; then
57 for f in /root/etc/event.d/tty*; do
58 sed -i -e "s|^respawn.*|respawn /bin/login -f $USERNAME </dev/$(basename $f) > /dev/$(basename $f) 2>\&1|" $f
64 # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
65 # /etc/crontab remaining disabled, yet also not run by anacron
66 if [ -x /root/etc/init.d/anacron ]; then
67 for f in /root/etc/rc?.d/S??anacron; do
68 mv ${f} ${f%/*}/K00anacron
73 rm -f /root/etc/rc?.d/[SK]??postfix
75 # Avoid clobbering the user's clock
76 rm -f /root/etc/rc?.d/K??hwclock.sh
78 # Disable readahead since it doesn't play well with squashfs + unionfs
79 # use chmod instead of mv to not trigger unionfs bugs.
80 if [ -e /root/sbin/readahead-list ]; then
81 chmod -x /root/sbin/readahead-list