~ # cat /usr/lib/finish-install.d/90console
#!/bin/sh
set -e
set -x

log() {
        logger -t finish-install "$@"
}

# Since this script is running with debconf, 'tty' does
# not give reliable answers about what sort of terminal
# we have.  The stdin of /sbin/debian-installer seems
# to tell the truth.
inst_pid=$(pidof debian-installer | sed "s/ /\n/g" | sort -n | head -n 1)
rawconsole=$(readlink /proc/${inst_pid}/fd/0)
console=$(mapdevfs "$rawconsole")
rawconsole=${rawconsole#/dev/}
console=${console#/dev/}

case "$console" in
    tty[A-Z]*|hvc*|hvsi*)
        log "Configuring /etc/inittab for serial console"
        consoletype=${console%%[0-9]*}
        ttyline=${console#$consoletype}
        ttyspeed=$(chroot /target stty --file /dev/$console speed)
        ttyterm="$TERM"
        ;;
esac
~ #


~ # /usr/lib/finish-install.d/90console
+ pidof debian-installer
+ sed s/ /\n/g
+ sort -n
+ head -n 1
+ inst_pid=1560
+ readlink /proc/1560/fd/0
+ rawconsole=/dev/console
+ mapdevfs /dev/console
+ console=/dev/console
+ rawconsole=console
+ console=console
~ #

Reply via email to