Bug#394970: finish-install: [powerpc64] Add support for IBM serial consoles (hvc and hvsi)
Package: finish-install
Version: 2.4
Severity: normal
Tags: patch
Add support for hvsi and hvc IBM POWER serial consoles.
This patch is currently untested, but i don't want to lose it again, so i
submit it. I expect to test it nextly, but i can only do so for hvc as i have
no longer access to a non-virtualized pserver, and can only do so within the
constraints of my free time. Others are welcome to test it by themselves.
Also, i don't believe this is the most efficient way to do this, and that the
ttyS|hvc|hvsi could be factorised in the code, but my shell skill is not
enough to do it better without risking breakage, so i will only provide this
functional patch.
Friendly,
Sven Luther
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (500, 'testing')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-powerpc
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Index: debian/changelog
===================================================================
--- debian/changelog (revision 42051)
+++ debian/changelog (working copy)
@@ -1,3 +1,10 @@
+finish-install (2.5) UNRELEASED; urgency=low
+
+ [ Sven Luther ]
+ * [powerpc64] Added support for hvc* and hvsi* serial consoles.
+
+ -- Sven Luther <sven@tael.powerlinux.fr> Mon, 23 Oct 2006 21:59:42 +0200
+
finish-install (2.4) unstable; urgency=low
* 90console: apparently we can no longer trust pidof to output PIDs in
Index: finish-install.d/90console
===================================================================
--- finish-install.d/90console (revision 42051)
+++ finish-install.d/90console (working copy)
@@ -33,4 +33,38 @@
echo "$console" >> /target/etc/securetty
fi
;;
+hvc*)
+ log "Configuring /etc/inittab for serial console"
+ ttyspeed=$(chroot /target stty --file /dev/$console speed)
+ ttyline=${console#hvc}
+ ttyterm="$TERM"
+
+ if [ -z "$ttyterm" ]; then ttyterm=vt100; fi
+ if [ -z "$ttyspeed" ]; then ttyspeed=9600; fi
+ sed -i -e "s/^\([1-6]\):/#\1:/" \
+ -e "s/^#T0\(.*hvc\).*/T$ttyline\1$ttyline $ttyspeed $ttyterm/" \
+ /target/etc/inittab
+ echo "# serial console added by debian-installer" >> /target/etc/securetty
+ echo "$rawconsole" >> /target/etc/securetty
+ if [ -n "$console" ] && [ "$console" != "$rawconsole" ]; then
+ echo "$console" >> /target/etc/securetty
+ fi
+;;
+hvsi*)
+ log "Configuring /etc/inittab for serial console"
+ ttyspeed=$(chroot /target stty --file /dev/$console speed)
+ ttyline=${console#hvsi}
+ ttyterm="$TERM"
+
+ if [ -z "$ttyterm" ]; then ttyterm=vt100; fi
+ if [ -z "$ttyspeed" ]; then ttyspeed=9600; fi
+ sed -i -e "s/^\([1-6]\):/#\1:/" \
+ -e "s/^#T0\(.*hvsi\).*/T$ttyline\1$ttyline $ttyspeed $ttyterm/" \
+ /target/etc/inittab
+ echo "# serial console added by debian-installer" >> /target/etc/securetty
+ echo "$rawconsole" >> /target/etc/securetty
+ if [ -n "$console" ] && [ "$console" != "$rawconsole" ]; then
+ echo "$console" >> /target/etc/securetty
+ fi
+;;
esac
Reply to: