This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM335X: Disable login

Part Number: PROCESSOR-SDK-AM335X

Hi Team,

I am working on an AM335x device with yocto build system.

Actually, i need to disable login prompt so the user can not login system using console.

Is there any way to stop login prompt only?

Thanks and regards

Harsh

  • Hello Harsh,

    Please, see this thread. You can disable and mask serial-getty@ttyS0.service.
    root@am335x-evm:~# systemctl disable serial-getty@ttyS0.service
    root@am335x-evm:~# systemctl mask serial-getty@ttyS0.service
    root@am335x-evm:~# systemctl daemon-reload

    You can also disable these two services.
    root@am335x-evm:~# systemctl disable getty@tty1.service
    root@am335x-evm:~# systemctl disable serial-getty@ttyS3.service
    root@am335x-evm:~# systemctl daemon-reload

    If you want to disable the login prompt from OE build system. Please, add this code to <tisdk>/sources/oe-core/meta/recipes-core/systemd/systemd-serialgetty.bb.

    pkg_postinst_${PN} () {
    	tmp="${SERIAL_CONSOLES}"
    	for entry in $tmp ; do
    		ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
    		if [ -n "$D" ]; then
    			OPTS="--root=$D"
    		fi
    		systemctl $OPTS disable serial-getty@$ttydev.service
    		systemctl $OPTS mask serial-getty@$ttydev.service
    	done
    }

    Best regards,
    Kemal

  • Hi Kemal,

    Thanks for your quick response.

    I have tried both the suggested options as follows:

    1] Added following command in the startup script:

    root@am335x-evm:~# systemctl disable serial-getty@ttyS0.service
    root@am335x-evm:~# systemctl mask serial-getty@ttyS0.service
    root@am335x-evm:~# systemctl daemon-reload 

    2] Added suggested code in "<tisdk>/sources/oe-core/meta/recipes-core/systemd/systemd-serialgetty.bb" after do_install and rebuilt all the modules:

    In both the cases console is still working normally without any change.

    Further, i have added following "stop" command instead of "disable" command and console stops as per requirement: 

     root@am335x-evm:~# systemctl stop serial-getty@ttyO0.service

     

    Please share your inputs if anything else than above command need to add

    Thanks again

    Regards,

    Harsh 

  • Which exact Processor SDK version and arago-base-tisdk-image-am335x-evm.tar.xz or tisdk-rootfs-image-am335x-evm.tar.xz you use?

  • Hi Kemal,

    I have verified twice and found that your previous answer is correct.

    Following commands stop console, but console does not stop working with immediate effect.

    root@am335x-evm:~# systemctl disable serial-getty@ttyS0.service
    root@am335x-evm:~# systemctl mask serial-getty@ttyS0.service
    root@am335x-evm:~# systemctl daemon-reload

    It requires processor reboot to get the effect of the above commands.

    Where as using following "stop" command, console stops working with immediate effect without reboot:  

    root@am335x-evm:~# systemctl stop serial-getty@ttyS0.service

    I can understand with "stop", service will start everytime and then we are stopping it manually. 

    Thanks for your inputs

    Regards,

    Harsh

  • Yes, that is true.