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

Bug#287932: debian-installer: serial console detection will fail if two console= kernel args are provided.



On Fri, Dec 31, 2004 at 01:00:26AM +0100, Sven Luther wrote:
> It is customary to use kernel command lines like :
> 
>   console=ttyS0,9600 console=tty0
> 
> to get an echo of the kernel messages or whatever on the serial
> console. This seems to be even automatically activated on powerpc prep
> kernels.
> 
> The current way for detecting a serial console is to grep for
> "console=ttyS" on the /proc/cmdline, which naturally fails in this
> setup, and resulted on an impossibility to chose a keyboard on my prep
> motorola powerstack install. fjp tells me that this mechanism is used
> in various (at least 4) places in the whole of debian installer, which
> is why i fill a generic bug, and not a bug against kbd-chooser.
           ^^^^ (s/fill/file/)

Perhaps we should look for TERM_TYPE=serial, which rootskel sets.
Failing that, a simple for loop would suffice to get the last console=
parameter, and a case statement would suffice to look for ttyS*.

  lastconsole=
  for param in $parameters; do
    case $param in
      console=*)
        lastconsole="${param#console=}"
        ;;
    esac
  done
  case $lastconsole in
    ttyS*)
      # do serial stuff
      ;;
  esac

Cheers,

-- 
Colin Watson                                       [cjwatson@debian.org]



Reply to: