4 DESCRIPTION="Setting up init..."
21 log_begin_msg "$DESCRIPTION"
23 # Arrange for shells on virtual consoles, rather than login prompts
25 if [ -n "$USERNAME" ]; then
26 if [ -z "${CASPERGETTY}" ]; then
27 sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9].*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
29 sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/casper-getty%' /root/etc/inittab
30 # AUTOMATIC SERIAL CONSOLE #
31 defconsole=$(sed -e 's%.*console=%console=%' /proc/cmdline)
32 if echo "${defconsole}" | grep -qs console=ttyS; then
33 PORT=$(echo "${defconsole}" | \
34 sed -e's%^console=%%' -e's%,.*%%')
35 SPEED=$(echo "${defconsole}" | \
36 sed -e 's%^console=ttyS[0-9]\+,%%' \
37 -e's%\([0-9]\+\).*%\1%')
38 if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" ) ; then
39 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"
43 if ! grep "^${ID}:" /etc/inittab ; then
44 #make sure it is not already in use
49 echo "${ID}:2345:respawn:/sbin/casper-getty -L ${PORT} ${SPEED} vt100" \
56 # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
57 # /etc/crontab remaining disabled, yet also not run by anacron
58 if [ -x /root/etc/init.d/anacron ]; then
59 for f in /root/etc/rc?.d/S??anacron; do
60 mv ${f} ${f%/*}/K00anacron
65 rm -f /root/etc/rc?.d/[SK]??postfix
67 # Avoid clobbering the user's clock
68 rm -f /root/etc/rc?.d/K??hwclock.sh
70 # Disable readahead since it doesn't play well with squashfs + unionfs
71 # use chmod instead of mv to not trigger unionfs bugs.
72 if [ -e /root/sbin/readahead-list ]; then
73 chmod -x /root/sbin/readahead-list