Bug#453749: Fix serial console detection on ia64

2007-12-03 Thread dann frazier
Thanks for your responses. As I was writing this report, I began to
wonder why exactly the proc trick doesn't work on some ia64 configs -
I'm investigating this now. If I can find a workable solution there,
we may be able to forego these changes - if not, I'll regenerate new
patches based on your comments.




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#453749: Fix serial console detection on ia64

2007-12-01 Thread Otavio Salvador
Frans Pop [EMAIL PROTECTED] writes:

 On Friday 30 November 2007, dann frazier wrote:
 The attached patch to di-utils adds a slightly modified version of

 I compiled this on amd64 and after stripping it is still 4k. As it is only 
 needed during finish install, I wonder if it should be in di-utils and thus 
 in initrds.
 Maybe we should create a di-utils-extra udeb that includes utils normally 
 needed only after anna has been run. This could also include in-target for 
 example. Not sure though.

I like this idea.

-- 
O T A V I OS A L V A D O R
-
 E-mail: [EMAIL PROTECTED]  UIN: 5906116
 GNU/Linux User: 239058 GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
-
Microsoft sells you Windows ... Linux gives
 you the whole house.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#453749: Fix serial console detection on ia64

2007-12-01 Thread Frans Pop
On Friday 30 November 2007, dann frazier wrote:
 # ./serial-console-info
 DEV=ttyS2
 SPEED=115200

One more thing...
Why not just:
device:\tttyS2
speed:\t115200

IMO that would be more in line with how other utils output stuff. Current 
output looks a bit like envvars, but isn't.


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


Bug#453749: Fix serial console detection on ia64

2007-11-30 Thread dann frazier
Package: finish-install
Version: 2.13
Severity: important
Tags: patch

If you boot an ia64 system[1] without specifying a console= parameter,
the kernel will try to map /dev/console to whatever settings were
detected from EFI (firmware interface). If EFI uses a serial console,
/dev/console will be mapped to that same serial device.

d-i interacts with the user via /dev/console, so most of the time the
installer doesn't really care what the underlying device is. That is,
until the system needs to decide where it should run gettys, and where
root logins are permitted. This works is done by 90console.

90console attempts to detect the real console device by dereferencing
/proc/di-pid/fd/0. If a system was booted w/ console=ttyS0,
/proc/di-pid/fd/0 will link to /dev/ttyS0.

However, on certain ia64 platforms[2], this link points to the
ever-so-helpful /dev/console. The only way we've found to identify the
correct device is to use a small C program that issues an ioctl to the
device to retrieve the line number and speed (thanks to Bryan
Stillwell for this research/work[3]).

The workaround for this in etch is to always specify a console=
parameter, thereby disabling the automatic console setup.

The attached patch to di-utils adds a slightly modified version of Bryan's
utility. This utility was originally called getserialdev - I've
renamed it to serial-console-info, since I think it better describes
the function. Also, getserialdev's output was of the form:

# ./getserialdev
ttyS2 115200

I've modified this to instead tag the data, so that it should be
easier to maintain backwards compatability should this utility provide
additional output in the future. e.g.:

# ./serial-console-info
DEV=ttyS2
SPEED=115200

The attached patch to finish-install adds support for using
serial-console-info, if available, to 90console. Processing behaves
just as before, until it finds that /proc/di-pid/fd/0 is pointing at
/dev/console. It will only then run serial-console-info to see if it
can determine that /dev/console is actually a serial device.

I briefly considered implementing serial console detection entirely
with serial-console-info - but decided against it. The major problem
is that serial-console-info assumes that any device it finds has a
ttyS prefix, which may not always be correct.

[1] Possibly other EFI-based systems as well, I haven't verified
[2] an rx1600 w/ an MP for one
[3] https://launchpad.net/bugs/48752
-- 
dann frazier




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#453749: Fix serial console detection on ia64

2007-11-30 Thread Frans Pop
On Friday 30 November 2007, dann frazier wrote:
 The attached patch to di-utils adds a slightly modified version of

I compiled this on amd64 and after stripping it is still 4k. As it is only 
needed during finish install, I wonder if it should be in di-utils and thus 
in initrds.
Maybe we should create a di-utils-extra udeb that includes utils normally 
needed only after anna has been run. This could also include in-target for 
example. Not sure though.

 Bryan's utility. This utility was originally called getserialdev - I've
 renamed it to serial-console-info, since I think it better describes
 the function.

If I run the app on my system, I get an error code 255. It's probably 
correct that it returns an error, but I wonder if the value 255 is correct?

 The attached patch to finish-install adds support for using
 serial-console-info, if available, to 90console. Processing behaves
 just as before, until it finds that /proc/di-pid/fd/0 is pointing at
 /dev/console. It will only then run serial-console-info to see if it
 can determine that /dev/console is actually a serial device.

I think that, because of the ttyS assumption this patch may break 
hvsi/hvc virtualized console support (bottom half of 90console). This 
should be checked.

I don't think there's any need to write the output of s-c-i to a temp file. 
Just assigning it to a variable should work just as well:
+if [ $rawconsole == /dev/console ]  \
+   [ -x /bin/serial-console-info ]  \
+   sci=$(/bin/serial-console-info); then
+   rawconsole=/dev/$(echo $sci | grep ^DEV= | cut -d= -f2)
+   sci_baud=$(echo $sci | grep ^SPEED= | cut -d= -f2)
+fi

Cheers,
FJP


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