23
23
# Arrange for shells on virtual consoles, rather than login prompts
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
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
33
for x in $(cat /proc/cmdline); do
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
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
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
33
for x in $(cat /proc/cmdline); do
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
40
rm -f /root/etc/rc?.d/[SK]??[gkx]dm
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
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
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