Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-31 Thread Ian Campbell
On Sat, 2011-07-30 at 17:31 +0200, Otavio Salvador wrote:
> Hello
> 
> On Sat, Jul 30, 2011 at 15:10, Dominic Benson
>  wrote:
> > Package: finish-install
> > Version: 2.32
> > Severity: normal
> >
> > finish-install 90console script checks for the existence of
> > /sys/bus/xen to determine whether to add a console on
> > /dev/hvc0 - but in 2.6.38 / 2.6.39 this always appears to exist.
> 
> Ian, do you mind to have a look at this?

Done. I'm just about to commit the patch from
<1312037866.3786.38.ca...@dagon.hellion.org.uk> to finish-install.

Ian.

-- 
Ian Campbell


Logic is a pretty flower that smells bad.


signature.asc
Description: This is a digitally signed message part


Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Otavio Salvador
Hello

On Sat, Jul 30, 2011 at 15:10, Dominic Benson
 wrote:
> Package: finish-install
> Version: 2.32
> Severity: normal
>
> finish-install 90console script checks for the existence of
> /sys/bus/xen to determine whether to add a console on
> /dev/hvc0 - but in 2.6.38 / 2.6.39 this always appears to exist.

Ian, do you mind to have a look at this?

-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Dominic Benson

On 30 Jul 2011, at 15:57, Ian Campbell wrote:

> On Sat, 2011-07-30 at 15:28 +0100, Dominic Benson wrote:
>> 
>> 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).

Ahh, that sounds like a good plan in that case. The adjusted patch looks fine 
to me.

[there remains no currently effective 'is XEN' test, but using /dev/hvc0, if it 
exists, precisely once, sounds reasonable]

Dominic





--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Ian Campbell
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


Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Dominic Benson

On 30 Jul 2011, at 14:56, Ian Campbell wrote:

> (please keep 636...@bugs.debian.org CC'd so this conversation is
> recorded on the bug)

Sorry - missed that last time.
> 
> On Sat, 2011-07-30 at 14:43 +0100, Dominic Benson wrote:
>> On 30 Jul 2011, at 14:40, Ian Campbell wrote:
>> 
>>> On Sat, 2011-07-30 at 14:10 +0100, Dominic Benson wrote:
 Package: finish-install
 Version: 2.32
 Severity: normal
 
 finish-install 90console script checks for the existence of 
 /sys/bus/xen to determine whether to add a console on 
 /dev/hvc0 - but in 2.6.38 / 2.6.39 this always appears to exist.
>>> 
>>> Do you mean that /sys/bus/xen exists even when not running under Xen? Or
>>> when running under Xen but without the necessary driver (perhaps in an
>>> HVM domain)?
>> 
>> The former - that /sys/bus/xen exists even when not running under Xen.
>> 
>> I've seen it under VMware, Parallels, Virtualbox and on a real
>> hardware box (an old Sunfire v20z)
> 
> OK. Some sort of check for hvc0 is probably in order then.
> 
> Sounds like you have at least the beginnings of a patch -- can you post
> it?

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.

> 
> 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.


Dominic



finish-install_hvc0-check.patch
Description: Binary data




Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Ian Campbell
(please keep 636...@bugs.debian.org CC'd so this conversation is
recorded on the bug)

On Sat, 2011-07-30 at 14:43 +0100, Dominic Benson wrote:
> On 30 Jul 2011, at 14:40, Ian Campbell wrote:
> 
> > On Sat, 2011-07-30 at 14:10 +0100, Dominic Benson wrote:
> >> Package: finish-install
> >> Version: 2.32
> >> Severity: normal
> >> 
> >> finish-install 90console script checks for the existence of 
> >> /sys/bus/xen to determine whether to add a console on 
> >> /dev/hvc0 - but in 2.6.38 / 2.6.39 this always appears to exist.
> > 
> > Do you mean that /sys/bus/xen exists even when not running under Xen? Or
> > when running under Xen but without the necessary driver (perhaps in an
> > HVM domain)?
> 
> The former - that /sys/bus/xen exists even when not running under Xen.
> 
> I've seen it under VMware, Parallels, Virtualbox and on a real
> hardware box (an old Sunfire v20z)

OK. Some sort of check for hvc0 is probably in order then.

Sounds like you have at least the beginnings of a patch -- can you post
it?

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.

Ian.
-- 
Ian Campbell


DYSLEXICS OF THE WORLD, UNTIE!


signature.asc
Description: This is a digitally signed message part


Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Ian Campbell
On Sat, 2011-07-30 at 14:10 +0100, Dominic Benson wrote:
> Package: finish-install
> Version: 2.32
> Severity: normal
> 
> finish-install 90console script checks for the existence of 
> /sys/bus/xen to determine whether to add a console on 
> /dev/hvc0 - but in 2.6.38 / 2.6.39 this always appears to exist.

Do you mean that /sys/bus/xen exists even when not running under Xen? Or
when running under Xen but without the necessary driver (perhaps in an
HVM domain)?

> The effect is an "init id co respawned too fast, disabling for 5 mins"
> message every 5 mins on systems without /dev/hvc0
> 
> Adding a check that /dev/hvc0 exists prevents this particular
> manifestation, but possibly a more conclusive fix would be required
> as the previous block can also create a co console using
> /dev/hvc0, but with mode vt100. I don't have a suitable environment
> to test what happens under those circimstances.
> 
> -- System Information:
> Debian Release: 5.0.8
>   APT prefers oldstable
>   APT policy: (500, 'oldstable')
> Architecture: i386 (x86_64)
> 
> Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
> 
> 
> 

-- 
Ian Campbell


A statesman is a politician who's been dead 10 or 15 years.
-- Harry S. Truman


signature.asc
Description: This is a digitally signed message part


Bug#636040: finish-install: hvc0 console added to inittab even when not available

2011-07-30 Thread Dominic Benson
Package: finish-install
Version: 2.32
Severity: normal

finish-install 90console script checks for the existence of 
/sys/bus/xen to determine whether to add a console on 
/dev/hvc0 - but in 2.6.38 / 2.6.39 this always appears to exist.

The effect is an "init id co respawned too fast, disabling for 5 mins"
message every 5 mins on systems without /dev/hvc0

Adding a check that /dev/hvc0 exists prevents this particular
manifestation, but possibly a more conclusive fix would be required
as the previous block can also create a co console using
/dev/hvc0, but with mode vt100. I don't have a suitable environment
to test what happens under those circimstances.

-- System Information:
Debian Release: 5.0.8
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org