=== modified file 'debian/changelog' --- debian/changelog 2007-06-18 21:16:09 +0000 +++ debian/changelog 2007-12-07 16:44:46 +0000 @@ -1,3 +1,15 @@ +finish-install (2.11ubuntu1) gutsy-proposed; urgency=low + + [ Frans Pop ] + * Backport from trunk (Frans Pop and myself; LP: #174689): + - 90console: add support for setting up a virtualized console via + onboard service processor (hvsi/hvc). Closes: #420820. + Many thanks to Rolf Brudeseth for providing the + needed info, for testing and for his patience. + - Add upstart support for hvc/hvsi consoles. + + -- Colin Watson Fri, 07 Dec 2007 16:44:44 +0000 + finish-install (2.11) unstable; urgency=low [ Otavio Salvador ] === modified file 'finish-install.d/90console' --- finish-install.d/90console 2007-03-21 23:53:45 +0000 +++ finish-install.d/90console 2007-12-07 16:39:01 +0000 @@ -15,6 +15,8 @@ rawconsole=${rawconsole#/dev/} console=${console#/dev/} +# Testing for hvc and hvsi here may be useless as they would normally be +# redirected to /dev/console, which is covered by the code section below. case "$console" in tty[A-Z]*|hvc*|hvsi*) log "Configuring init for serial console" @@ -45,3 +47,47 @@ fi ;; esac + +# Set up virtualized console via onboard service processor (hvsi/hvc) +DT_ROOT=/proc/device-tree +if [ -e $DT_ROOT/options/chosen/linux,stdout-path ]; then + chosen_dev=$(cat $DT_ROOT/chosen/linux,stdout-path) + case $chosen_dev in + /vdevice/vty@30000000) + case $(cat ${DT_ROOT}${chosen_dev}/compatible) in + hvterm-protocol) + console=hvsi0 ;; + hvterm|hvterm1) + console=hvc0 ;; + *) + log "Unable to determine type of virtualized console" + exit 1 + ;; + esac + ;; + /vdevice/vty@30000001) + console=hvsi1 ;; + *) + exit 0 ;; + esac + + log "Setting up virtualized serial console on /dev/$console" + if [ -f /target/etc/inittab ]; then + # Disable regular VTs + sed -i -e "s/^\([1-6]\):/#\1:/" /target/etc/inittab + + console_line="co:2345:respawn:/sbin/getty $console 9600 vt100" + if grep -q "^#\?co:" /target/etc/inittab; then + sed -i -e "s|^#\?co:.*$|$console_line|" \ + /target/etc/inittab + else + sedexp="/^#1:/i\\$console_line\\" + sed -i -e "$sedexp" /target/etc/inittab + fi + fi + if [ -f /target/etc/event.d/tty1 ]; then + sed -e "s/^\(exec.*getty \).*/\1-L $console 9600 vt100/" \ + -e "s/tty1/$console/g" \ + /target/etc/event.d/tty1 > /target/etc/event.d/$console + fi +fi