~ubuntu-branches/ubuntu/hardy/casper/hardy-proposed

« back to all changes in this revision

Viewing changes to scripts/casper-bottom/25configure_init

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2007-10-02 15:12:57 UTC
  • Revision ID: james.westby@ubuntu.com-20071002151257-4dgvwx19r9d35c73
Tags: 1.107
* Fix gconf keys for suspend and hibernate (thanks, Oliver Grawert;
  LP: #144790).
* Enable suspend again since as far as I can see we no longer need to
  probe DMI while figuring out whether to enable it (see #61535).
* Add a 'textonly' boot option to disable X (LP: #65818).
* Write the please-remove-CD message to /dev/console so that it works even
  if usplash isn't running, and make sure to set /dev/console into a sane
  state so that pressing Enter doesn't just result in ^M being displayed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# Arrange for shells on virtual consoles, rather than login prompts
24
24
 
25
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
 
        for x in $(cat /proc/cmdline); do
34
 
                case $x in
35
 
                        noninteractive)
36
 
                                sed -i -e "s|^exec.*|exec /usr/bin/ubiquity noninteractive </dev/tty1 > /dev/tty1 2>\&1|" /root/etc/event.d/tty1
37
 
                                rm -f /root/etc/rc?.d/[SK]??gdm
38
 
                                rm -f /root/etc/rc?.d/[SK]??kdm
39
 
                                ;;
40
 
                esac
41
 
        done
42
 
    fi
 
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
                for x in $(cat /proc/cmdline); do
 
34
                        case $x in
 
35
                                noninteractive)
 
36
                                        sed -i -e "s|^exec.*|exec /usr/bin/ubiquity noninteractive </dev/tty1 > /dev/tty1 2>\&1|" /root/etc/event.d/tty1
 
37
                                        rm -f /root/etc/rc?.d/[SK]??[gkx]dm
 
38
                                        ;;
 
39
                                textonly)
 
40
                                        rm -f /root/etc/rc?.d/[SK]??[gkx]dm
 
41
                                        ;;
 
42
                        esac
 
43
                done
 
44
        fi
43
45
 
44
 
    # Since we use autologin, lastlog doesn't make sense on the console.
45
 
    sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login
 
46
        # Since we use autologin, lastlog doesn't make sense on the console.
 
47
        sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login
46
48
fi
47
49
 
48
50
# This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
49
51
# /etc/crontab remaining disabled, yet also not run by anacron
50
52
if [ -x /root/usr/sbin/anacron ]; then
51
 
    chroot /root dpkg-divert --add --rename --quiet /usr/sbin/anacron
52
 
    ln -s /bin/true /usr/sbin/anacron
 
53
        chroot /root dpkg-divert --add --rename --quiet /usr/sbin/anacron
 
54
        ln -s /bin/true /usr/sbin/anacron
53
55
fi
54
56
 
55
57
# No point, really
61
63
# Disable readahead since it doesn't play well with squashfs + unionfs
62
64
# use chmod instead of mv to not trigger unionfs bugs.
63
65
if [ -e /root/sbin/readahead-list ]; then
64
 
    chmod -x /root/sbin/readahead-list
 
66
        chmod -x /root/sbin/readahead-list
65
67
fi
66
68
 
67
69
log_end_msg