<div dir="ltr">You mean in the <strong class="" style="color:rgb(0,0,0);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:18px;line-height:25.2000007629395px">getty-generator.c ?</strong><div><strong class="" style="color:rgb(0,0,0);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:18px;line-height:25.2000007629395px"><br></strong></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 20, 2015 at 9:14 AM, Andrei Borzenkov <span dir="ltr"><<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">В Mon, 20 Apr 2015 09:09:09 +0530<br>
<span class="">Praveen kumar R <<a href="mailto:praveenrgowda@gmail.com">praveenrgowda@gmail.com</a>> пишет:<br>
<br>
</span><div><div class="h5">> This is the snippet of the code in the systemV init system that controls<br>
> the serial console login<br>
> depending on the token<br>
><br>
> TOKENEXIST=`grep "TOKEN=" /proc/cmdline`<br>
> TOKEN=0<br>
> if [ "X$TOKENEXIST" != "X" ]; then<br>
> #If token is pass as a command line arg, use it.<br>
> TOKEN=`sed 's/.*TOKEN=//; s/ .*//' /proc/cmdline`<br>
> fi<br>
><br>
> TOKENOVERRIDE=`grep "TOKENOVERRIDE=" /proc/cmdline`<br>
> if [ "X$TOKENOVERRIDE" != "X" ]; then<br>
> #If token is pass as a command line arg, use it.<br>
> OVERRIDE=`sed 's/.*TOKENOVERRIDE=//; s/ .*//' /proc/cmdline`<br>
> let "TOKEN = $TOKEN & $OVERRIDE"<br>
> fi<br>
><br>
> echo "TOKEN = $TOKEN"<br>
><br>
> let "CONSOLE_LOGIN = $TOKEN & 512"<br>
> if [ $CONSOLE_LOGIN -ne 0 ]; then<br>
> echo "[`eval $uptime`]: Begin Console Access"<br>
> /etc/console_login &<br>
> echo "eCM console is enabled"<br>
> export ENABLE_ECM_CONSOLE=y<br>
> else<br>
> echo "[`eval $uptime`]: Token doesn't allow console access"<br>
> export ENABLE_ECM_CONSOLE=n<br>
> fi<br>
><br>
><br>
><br>
> I am trying to implement the same in the sytemd init system.<br>
><br>
<br>
</div></div>The straightforward approach is to put this code in generator that<br>
parses command line. It can mask standard console service and create<br>
unit for your console.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Sun, Apr 19, 2015 at 11:48 AM, Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com">arvidjaar@gmail.com</a>><br>
> wrote:<br>
><br>
> > В Sat, 18 Apr 2015 19:54:50 +0530<br>
> > Praveen kumar R <<a href="mailto:praveenrgowda@gmail.com">praveenrgowda@gmail.com</a>> пишет:<br>
> ><br>
> > > Yes it's a kernel command line arg, it is board specific token introduced<br>
> > > to control the serial console.<br>
> > > if defined serial console should not be enabled.<br>
> > ><br>
> ><br>
> > Sorry I do not understand this sentence. "define" what? Please give<br>
> > exact example of kernel command line and explain what behavior you<br>
> > expect in this case.<br>
> ><br>
> > > we have this in place for other system initializing system - sytemV ,<br>
> > where<br>
> > > depending<br>
> > ><br>
> > > On Fri, Apr 17, 2015 at 4:24 PM, Lennart Poettering <<br>
> > <a href="mailto:lennart@poettering.net">lennart@poettering.net</a><br>
> > > <javascript:_e(%7B%7D,'cvml','<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>');>> wrote:<br>
> > ><br>
> > > > On Fri, 17.04.15 15:54, Praveen kumar R (<a href="mailto:praveenrgowda@gmail.com">praveenrgowda@gmail.com</a><br>
> > > > <javascript:_e(%7B%7D,'cvml','<a href="mailto:praveenrgowda@gmail.com">praveenrgowda@gmail.com</a>');>) wrote:<br>
> > > ><br>
> > > > > I have a token passed on by command line argument on which I need to<br>
> > > > decide<br>
> > > > > to start the serial<br>
> > > ><br>
> > > > On which command line? Kernel command line? What kind of "token"?<br>
> > > ><br>
> > > > > console or not. I plan to tweak the getty*ttyS0.service and add the<br>
> > > > > script which validates the token and starts the console.<br>
> > > > ><br>
> > > > > Is this the right approach or is there any better way of handling it<br>
> > ??<br>
> > > ><br>
> > > > To get a login getty on the serial port its sufficient to add<br>
> > > > console=ttyS0... to the kernel cmdline. systemd automatically starts a<br>
> > > > serial getty automatically on the first terminal the kernel console is<br>
> > > > pointing to.<br>
> > > ><br>
> > > > Lennart<br>
> > > ><br>
> > > > --<br>
> > > > Lennart Poettering, Red Hat<br>
> > > ><br>
> ><br>
> ><br>
<br>
</div></div></blockquote></div><br></div>