diff -Nru finish-install-2.46ubuntu3/debian/changelog finish-install-2.46ubuntu4/debian/changelog --- finish-install-2.46ubuntu3/debian/changelog 2014-07-11 21:18:35.000000000 +0000 +++ finish-install-2.46ubuntu4/debian/changelog 2015-08-03 21:53:41.000000000 +0000 @@ -1,3 +1,9 @@ +finish-install (2.46ubuntu4) trusty; urgency=medium + + * Always set up hvc0 on KVM-emulated pSeries guests (LP: #1391919) + + -- Adam Conrad Mon, 03 Aug 2015 15:51:01 -0600 + finish-install (2.46ubuntu3) trusty; urgency=medium * Add support for serial consoles with hardware flow control, diff -Nru finish-install-2.46ubuntu3/finish-install.d/90console finish-install-2.46ubuntu4/finish-install.d/90console --- finish-install-2.46ubuntu3/finish-install.d/90console 2014-07-11 21:18:35.000000000 +0000 +++ finish-install-2.46ubuntu4/finish-install.d/90console 2015-08-03 21:50:58.000000000 +0000 @@ -109,7 +109,34 @@ # Set up virtualized console via onboard service processor (hvsi/hvc) DT_ROOT=/proc/device-tree -if [ -e $DT_ROOT/chosen/linux,stdout-path ]; then +if grep -q "IBM pSeries (emulated by qemu)" /proc/cpuinfo; then + # Unconditionally use hvc0 for KVM-emulated pSeries guests + console=hvc0 + + log "Setting up virtualized serial console on /dev/$console" + if [ -f /target/etc/inittab ]; then + # Disable regular VTs + if [ -z "$KEEP_VT" ]; then + sed -i -e "s/^\([1-6]\):/#\1:/" /target/etc/inittab + fi + + 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 + sed -i -e "s/^\(co:.*\) -8/\1/" /target/etc/inittab + fi + if [ "$upstart_tty1" ]; then + sed -e "s/^\(exec.*getty \).*/\1-L $console 9600 vt100/" \ + -e "s/tty1/$console/g" \ + "$upstart_tty1" > "$(upstart_console "$console")" + sed -i -e "s/^\(exec.*\) -8/\1/" "$(upstart_console "$console")" + fi +elif [ -e $DT_ROOT/chosen/linux,stdout-path ]; then chosen_dev=$(cat $DT_ROOT/chosen/linux,stdout-path) case $chosen_dev in /vdevice/vty@30000000|/vdevice/vty@71000000)