<div dir="ltr">This is the snippet of the code in the systemV init system that controls the serial console login<div>depending on the token</div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;word-wrap:normal;word-break:normal;color:rgb(51,51,51);font-size:12px;line-height:15.9999990463257px;background-color:rgb(245,245,245)"> TOKENEXIST=`grep "TOKEN=" /proc/cmdline`                                              
    TOKEN=0                                                                               
    if [ "X$TOKENEXIST" != "X" ]; then                                                    
           #If token is pass as a command line arg, use it.                               
           TOKEN=`sed 's/.*TOKEN=//; s/ .*//' /proc/cmdline`                     
    fi                                                                           
                                                                                          
    TOKENOVERRIDE=`grep "TOKENOVERRIDE=" /proc/cmdline`                                   
    if [ "X$TOKENOVERRIDE" != "X" ]; then                                                 
           #If token is pass as a command line arg, use it.
           OVERRIDE=`sed 's/.*TOKENOVERRIDE=//; s/ .*//' /proc/cmdline`
           let "TOKEN = $TOKEN & $OVERRIDE"                 
    fi                                                                 
                                                                       
    echo "TOKEN = $TOKEN"                                              
                                                            
    let "CONSOLE_LOGIN = $TOKEN & 512"                                 
    if [ $CONSOLE_LOGIN -ne 0 ];  then                                 
        echo "[`eval $uptime`]: Begin Console Access"                  
        /etc/console_login &                                           
        echo "eCM console is enabled"                                  
        export ENABLE_ECM_CONSOLE=y                                    
    else                                                               
        echo "[`eval $uptime`]: Token doesn't allow console access"
        export ENABLE_ECM_CONSOLE=n                        
    fi                                                </pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;word-wrap:normal;word-break:normal;color:rgb(51,51,51);font-size:12px;line-height:15.9999990463257px;background-color:rgb(245,245,245)"><br></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;word-wrap:normal;word-break:normal;color:rgb(51,51,51);font-size:12px;line-height:15.9999990463257px;background-color:rgb(245,245,245)"><br></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;word-wrap:normal;word-break:normal;color:rgb(51,51,51);font-size:12px;line-height:15.9999990463257px;background-color:rgb(245,245,245)">I am trying to implement the same in the sytemd init system.</pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 19, 2015 at 11:48 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">В Sat, 18 Apr 2015 19:54:50 +0530<br>
Praveen kumar R <<a href="mailto:praveenrgowda@gmail.com">praveenrgowda@gmail.com</a>> пишет:<br>
<span class=""><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>
</span>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>
<span class="im HOEnZb"><br>
> we have this in place for other system initializing system - sytemV , where<br>
> depending<br>
><br>
> On Fri, Apr 17, 2015 at 4:24 PM, Lennart Poettering <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a><br>
</span><span class="im HOEnZb">> <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>
</span><div class="HOEnZb"><div class="h5">> > <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>
> > 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>
</div></div></blockquote></div><br></div>