Accepting User Input from UART debug Console in a service during booting
by tigerdxy from LinuxQuestions.org on (#5HCHE)
Hi,
I have Kernel Version: 4.19.50-ti-r20
running debian buster.
The Console is UART0 port linked to /dev/ttyS0:
crw------- 1 debian tty 4, 64 Jul 7 17:19 /dev/ttyS0
I try to accept user input from the ttyS0 during booting process in a service script.
I followed steps in outlined in the link:
https://alan-mushi.github.io/2014/10...h-systemd.html
But not working. It seems to me that ttyS0 is not redirected to TTYPath=/dev/tty2. I also tried chvt 13
//=== ncu-install.service
[Unit]
Description=NCU Installation
After=network.target sshd.service systemd-logind.service getty@tty2.service
[Service]
Type=oneshot
TTYPath=/dev/tty2
ExecStartPre=/bin/chvt 13
ExecStart=/ncu_install/ncu_install.sh
ExecStartPost=/bin/chvt 1
StandardInput=tty
TTYVHangup=yes
TTYReset=yes
TTYVTDisallocate=yes
#RemainAfterExit=no
[Install]
WantedBy=default.target
RequiredBy=sshd.service systemd-logind.service getty@tty1.service
//=====
They are not working.
Anything I missed?
Thank You,
David
I have Kernel Version: 4.19.50-ti-r20
running debian buster.
The Console is UART0 port linked to /dev/ttyS0:
crw------- 1 debian tty 4, 64 Jul 7 17:19 /dev/ttyS0
I try to accept user input from the ttyS0 during booting process in a service script.
I followed steps in outlined in the link:
https://alan-mushi.github.io/2014/10...h-systemd.html
But not working. It seems to me that ttyS0 is not redirected to TTYPath=/dev/tty2. I also tried chvt 13
//=== ncu-install.service
[Unit]
Description=NCU Installation
After=network.target sshd.service systemd-logind.service getty@tty2.service
[Service]
Type=oneshot
TTYPath=/dev/tty2
ExecStartPre=/bin/chvt 13
ExecStart=/ncu_install/ncu_install.sh
ExecStartPost=/bin/chvt 1
StandardInput=tty
TTYVHangup=yes
TTYReset=yes
TTYVTDisallocate=yes
#RemainAfterExit=no
[Install]
WantedBy=default.target
RequiredBy=sshd.service systemd-logind.service getty@tty1.service
//=====
They are not working.
Anything I missed?
Thank You,
David