Comment 1 for bug 48752

Revision history for this message
Colin Watson (cjwatson) wrote :

This is how prebaseconfig works out whether it's running on a serial console:

# 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 | cut -d" " -f1)
rawconsole=$(readlink /proc/${inst_pid}/fd/0)
console=$(mapdevfs "$rawconsole")
rawconsole=${rawconsole#/dev/}
console=${console#/dev/}

case "$console" in
ttyS*)

Do you have any ideas on how to improve this?