Adding live-initramfs 1.87.1-1.
[live-boot-grml.git] / scripts / casper-bottom / 25configure_init
1 #!/bin/sh
2
3 PREREQ=""
4 DESCRIPTION="Setting up init..."
5
6 . /scripts/casper-functions
7
8 prereqs()
9 {
10        echo "$PREREQ"
11 }
12
13 case $1 in
14 # get pre-requisites
15 prereqs)
16        prereqs
17        exit 0
18        ;;
19 esac
20
21 log_begin_msg "$DESCRIPTION"
22
23 # Arrange for shells on virtual consoles, rather than login prompts
24
25 if [ -n "$USERNAME" ]; then
26     if [ -f /root/etc/inittab ]; then
27         sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
28     fi
29     if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]; then
30         for f in /root/etc/event.d/tty*; do
31             sed -i -e "s|^exec.*|exec /bin/login -f $USERNAME </dev/$(basename $f) > /dev/$(basename $f) 2>\&1|" $f
32         done
33     fi
34 fi
35
36 # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
37 # /etc/crontab remaining disabled, yet also not run by anacron
38 if [ -x /root/etc/init.d/anacron ]; then
39     for f in /root/etc/rc?.d/S??anacron; do
40         mv ${f} ${f%/*}/K00anacron
41     done
42 fi
43
44 # No point, really
45 rm -f /root/etc/rc?.d/[SK]??postfix
46
47 # Avoid clobbering the user's clock
48 rm -f /root/etc/rc?.d/K??hwclock.sh
49
50 # Disable readahead since it doesn't play well with squashfs + unionfs
51 # use chmod instead of mv to not trigger unionfs bugs.
52 if [ -e /root/sbin/readahead-list ]; then
53     chmod -x /root/sbin/readahead-list
54 fi
55
56 log_end_msg
57
58 exit 0