[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Debian on SGI Altix IA-64 (follow-up)


At the end of December, I posted on this list about booting and running Debian 
etch on SGI Altix 350. There was basically 3 things to modify on the netinst 
cd to make it boot and install:
- putting 'relocatable' in elilo.conf (done - thanks to Dann Frazier)
- adding some modules to the d-i kernel (done - thanks to Dann Frazier)
- modifying something with the console device since we lose the console output 
when booting the cd (just when init - or busybox init starts)

The trick I found to get the console output after init starts was to comment 
out this line:
makedev 600 /dev/tts/"$i" c 4 "$(($i + 64))" 
in /lib/debian-installer/init-udev-devices. I've done some research to know 
exactly why this make the console output work. 

In kernel > 2.6.7, there is a new serial console driver for the Altix L1 
(CONFIG_SERIAL_SGI_L1_CONSOLE=y) and the device is /dev/ttySG0. I think this 
device gets associated with /dev/console in the d-i because, if I 
create it (just before busybox init starts):
mknod ttySG0 c 204 40
echo "something" > /dev/ttySG0 or
echo "something" > /dev/console
both will echo.

Then I looked at how busybox init was choosing the console and found out that 
this part of code is being executed:
... (from busybox init.c source)
if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
  /* this is a serial console */
  snprintf(console, sizeof(console) - 1, SC_FORMAT, sr.line);
 while ((fd = open(console, O_RDONLY | O_NONBLOCK)) < 0 && tried < 2) {
       /* Can't open selected console -- try
              logical system console and VT_MASTER */
    safe_strncpy(console, (tried == 0 ? _PATH_CONSOLE : CURRENT_VC), 

So sr.line is set to 0 which seems correct but the SC_FORMAT variable 
is '/dev/tts/' (hard-coded) resulting in console=/dev/tts/0 instead 
of /dev/ttySG0.

On the d-i CD, /dev/tts/0 is created by 
the /lib/debian-installer/init-udev-devices script, so busybox will try to 
open it and will succeed but this device is not the correct one on the Altix 
so no more console output after busybox init.

If I delete /dev/tts/0 (or comment out the line to create this device in the 
init-udev-devices script), the 'open' call of busybox will fail so busybox 
will retry with console=_PATH_CONSOLE (which is defined as /dev/console) and 
this will work since we effectively are on /dev/console (/dev/ttySG0) during 
the Debian installation on Altix.

That is what I think creates the problem with console output when installing 
on Altix. I don't know what is the best solution to correct this but maybe:
1- patching busybox so that SC_FORMAT would be /dev/ttySG on Altix (if kernel 
> 2.6.7)
2- creating the /dev/ttySG0 device in the init-udev-devices script


Reply to: