Bug#484366: rootskel: cttyhack requires the serial console to be /dev/ttyS0

2008-06-04 Thread Frans Pop
On Tuesday 03 June 2008, Daniel Jacobowitz wrote:
 I tried to install Debian on Versatile/PB using qemu and the armel
 installer (Lenny beta 1).  It is quickly stuck complaining
 cttyhack: '/dev/ttyS0': No such file or device.

What _exact_ qemu command line did you use?

How did you connect to the ttyAMA0 serial port? Using minicom or 
something on the same host system, from a different system or what?

Note that D-I works just fine if you just let it run inside a qemu window.
I'm not yet convinced that there is either an installer bug or a busybox 
bug here.

Cheers,
FJP


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


Bug#484366: rootskel: cttyhack requires the serial console to be /dev/ttyS0

2008-06-04 Thread Daniel Jacobowitz
On Wed, Jun 04, 2008 at 03:21:41PM +0200, Frans Pop wrote:
 On Tuesday 03 June 2008, Daniel Jacobowitz wrote:
  I tried to install Debian on Versatile/PB using qemu and the armel
  installer (Lenny beta 1).  It is quickly stuck complaining
  cttyhack: '/dev/ttyS0': No such file or device.
 
 What _exact_ qemu command line did you use?
 
 How did you connect to the ttyAMA0 serial port? Using minicom or 
 something on the same host system, from a different system or what?
 
 Note that D-I works just fine if you just let it run inside a qemu window.
 I'm not yet convinced that there is either an installer bug or a busybox 
 bug here.

If you just run qemu, and SDL was available when it was built, you get
a graphical window including qemu's console and a real TTY.  So there's no
serial console involved at all.

My qemu was built without SDL, and I ran it with -nographic.  Either
of those is sufficient to end up with a serial console install,
effectively headless.  qemu's standard input and output are the serial
port.

The qemu command was:

qemu-system-arm -m 256 -M versatilepb -kernel qemu-kernel-image \
  -initrd initrd.gz -append mem=256M console=ttyAMA0 root=/dev/ram \
  -hda qemu-disk-image -nographic

-- 
Daniel Jacobowitz
CodeSourcery



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



Bug#484366: rootskel: cttyhack requires the serial console to be /dev/ttyS0

2008-06-04 Thread Frans Pop
On Wednesday 04 June 2008, Frans Pop wrote:
 On Tuesday 03 June 2008, Daniel Jacobowitz wrote:
  I tried to install Debian on Versatile/PB using qemu and the armel
  installer (Lenny beta 1).  It is quickly stuck complaining
  cttyhack: '/dev/ttyS0': No such file or device.

 What _exact_ qemu command line did you use?

And of course, shortly after sending such a message you do reproduce it.

For the benefit of others:
- download armel versatile images
- start qemu with (add -nographic if needed/wanted):
  $ qemu-system-arm -M versatilepb -serial pty -hda disk image \
   -kernel vmlinuz-kvers-versatile -initrd initrd.gz \
   -append root=/dev/ram console=ttyAMA0
- qemu will output what char device qemu it is using:
  char device redirected to /dev/pts/1
- start minicom using:
  $ minicom -s
- adjust minicom 'Serial port setup' to use /dev/pts/1 as Serial Device
  (using the correct device reported by qemu - see above);
  in 'Modem and dialing', remove the Init and Reset strings

(If -nographic is used, the boot will happen in the terminal where qemu is 
started; if it is not used, minicom will have the boot messages and debug 
shells.)

The console seems to be just /dev/console:
# readlink /proc/1/fd/0
/dev/console
# readlink /proc/self/fd/0
/dev/console

I'm not sure what the real problem here is, especially because I'm not 
sure if current D-I (since the introduction of cttyhack) has really been 
tested on systems that use something else than ttySx for their serial 
consoles. I do know there are others.
AFAIK D-I used to work on those systems, without having to create those 
devices. I'm also not sure whether there's a bug in cttyhack or that the 
kernel isn't telling it what the correct device to use is.

The symlink approach below does not seem like the right solution as a 
system could (in theory at least) have both ttySx and ttywhateverx.
And as every arch/subarch/serial driver seems to want to invent its own 
character devices, maintaining that would be unpleasant anyway.


The issue can easily be worked around:
- add extra boot parameter BOOT_DEBUG=3 in -append option
- in first debug shell, use nano to edit /etc/inittab and just remove
  '/bin/cttyhack' from ::sysinit: and ::respawn: lines
- use 'exit' to exit the debug shells


The following works as well (probably close to what Daniel did):
workaround
/lib/debian-installer/init-udev-devices:
 for i in 0 1 2 3; do
-   makedev 600 /dev/ttyS$i c 4 $(($i + 64))
+   makedev 600 /dev/ttyAMA$i c 204 $(($i + 64))
+   ln -s ttyAMA$i /dev/ttyS$i
 done

/lib/debian-installer-startup.d/S02udev:
udevsettle

+for i in 0 1 2 3; do
+   ln -s ttyAMA$i /dev/ttyS$i
+done

exit 0
/workaround

I have no idea where to go from here. Hope someone else does.

Cheers,
FJP



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



Bug#484366: rootskel: cttyhack requires the serial console to be /dev/ttyS0

2008-06-03 Thread Daniel Jacobowitz
Package: rootskel
Version: 1.62
Severity: normal

I tried to install Debian on Versatile/PB using qemu and the armel
installer (Lenny beta 1).  It is quickly stuck complaining
cttyhack: '/dev/ttyS0': No such file or device.

That's because the serial port on Versatile is named ttyAMA0.  I ran
qemu with -nographic and put console=ttyAMA0 on the command line.
This causes two problems:

1. Initially there is a /dev/ttyS0 but it is device 4/0.  ttyAMA0 is
204/64.  I could recreate it from the second debug shell or by appending
to init-udev-devices.

2. When udev runs, it recreates /dev.  udev successfully creates
/dev/ttyAMA0 with the proper major/minor.  But it naturally does not
create /dev/ttyS0.  So that doesn't work either and I created the
symlink by replacing 'exit 0' with 'ln -s ttyAMA0 /dev/ttyS0' at
the end of S02udev.

Frans warns that finish-install's 90console script may also have a
problem.  I haven't gotten there yet.

I don't know a clean fix for this problem.  It could be detected by
checking /proc/devices, most likely - there's ttyAMA but no ttyS.

On a related note, I thought cttyhack was supposed to give things
enough of a controlling terminal to use job control.  But cttyhack
/bin/sh still complains that there is no job control...

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-rc9 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



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