public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: serial tty name
Date: Wed, 14 Dec 2011 19:33:41 +0100	[thread overview]
Message-ID: <20111214183341.GK4585@pengutronix.de> (raw)
In-Reply-To: <4EE8BC52.5060905@compulab.co.il>

On Wed, Dec 14, 2011 at 05:10:10PM +0200, Igor Grinberg wrote:
> Hi Richard,
> 
> On 12/14/11 16:43, Richard Zhao wrote:
> > How to map different uart port to ttymxc0 (take imx for example)?
> > 
> > In rootfs, it usually "getty ttymxc0"  to get
> > serial console. And the rootfs may be shared by different boards.
> > Traditionaly way is to set right platform device ID.
> > 
> > But with DT, UART2 always generate ttymxc1, UART3 for ttymxc2. You
> > always needs to modify the getty command when your change another board.
> > 
> > Is there a way to fix it?
> 
> As for fix in userspace, you can spawn getty on every ttymxc*,
> so you will get it always.
> 
> Another (userspace) fix would be:
> Instead of getty, add a script (say getty.sh) which will do something like:
> -----------
> CONSOLE=`cat /proc/cmdline | tr " " "\n" | grep console= | tr "=" " " | tr "," " "`
> TTY=`echo $CONSOLE | cut -d' ' -f 2`
> SPEED=`echo $CONSOLE | cut -d' ' -f 3`
> 
> /sbin/getty -L $TTY $SPEED vt100
> --------------

what about:

	eval "$(sed 's/.*console=\([^,]*\),\([0-9]*\).*/tty=\1; speed=\2/'" /proc/cmdline)"

this should prevent getting a "useless use of cat award".

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2011-12-14 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 14:43 serial tty name Richard Zhao
2011-12-14 15:10 ` Igor Grinberg
2011-12-14 18:33   ` Uwe Kleine-König [this message]
2011-12-15  0:44     ` Richard Zhao
2011-12-14 15:31 ` Rob Herring
2011-12-15  0:31   ` Richard Zhao
2011-12-19  4:08   ` Shawn Guo
2011-12-19  4:49     ` Jason Liu
2011-12-19  5:41       ` Richard Zhao
2011-12-19  3:56 ` Shawn Guo
2011-12-19  5:40   ` Richard Zhao
2011-12-19  6:05     ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111214183341.GK4585@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox