On Sat, 2011-07-30 at 15:28 +0100, Dominic Benson wrote: > On 30 Jul 2011, at 14:56, Ian Campbell wrote:
> I attach a patch that I've used (against 2.22). It does, for me,
> prevent the problem on systems that I can test.
>
> I tried it under Citrix Xencenter, and the inittab entry for this
> console is (correctly) added.
Thanks, it looks sane to me.
> > You mentioned a previous block which added another hvc0 (with vt100), is
> > that the one inside the "if [ -e $DT_ROOT/chosen/linux,stdout-path ];
> > then" block? I think that one is safe.
>
> OK. I'm not really sure under what real circumstances it would be entered.
>
> My concern was that, if it is used, as /sys/bus/xen and /dev/hvc0 must
> both exist, two inittab lines would be produced with the same id.
> It strikes me that that would be in some way bad, although I haven't
> tried it.
The $DT stuff is for systems using Device Tree with an HVC console and
not any system currently supported by Xen (it's used by e.g. a PowerPC
hypervisor, I think). It appears that the DT stuff is checking for
specific machines and/or explicit hvc0 configurations.
However we may as well switch the Xen case "if" into an "elif" after the
DT case, then if a system which uses both Xen and DT appears it will
only hit the DT case (which would be arguably the more correct one to
trust in those circumstances). e.g. (untested):
diff --git a/finish-install.d/90console b/finish-install.d/90console
index 9886724..272e0a1 100755
--- a/finish-install.d/90console
+++ b/finish-install.d/90console
@@ -136,9 +136,7 @@ if [ -e $DT_ROOT/chosen/linux,stdout-path ]; then
"$upstart_tty1" > "$(upstart_console "$console")"
sed -i -e "s/^\(exec.*\) -8/\1/" "$(upstart_console "$console")"
fi
-fi
-
-if [ -e /sys/bus/xen ]; then
+elif [ -e /sys/bus/xen ] && [ -e /dev/hvc0 ]; then
console=hvc0
log "Setting up virtualized serial console on /dev/$console"
if [ -f /target/etc/inittab ]; then
Ian.
--
Ian Campbell
Why won't you let me kiss you goodnight? Is it something I said?
-- Tom Ryan
signature.asc
Description: This is a digitally signed message part

