[Unit]
Description=Debug Shell on /dev/ttyS2
DefaultDependencies=no
ConditionKernelCommandLine=|console=ttyS2
ConditionKernelCommandLine=|console=uart8250,mmio32,0xff130000
ConditionKernelCommandLine=|console=uart8250,mmio32,0xff1a0000
ConditionKernelCommandLine=|console=uart8250,mmio32,0xff690000

[Service]
WorkingDirectory=/storage
Environment="ENV=/etc/profile"
ExecStartPre=/bin/sh -c 'echo -en "\033[?25h"'
ExecStart=/bin/sh
Restart=always
RestartSec=0
StandardInput=tty
TTYPath=/dev/ttyS2
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP

[Install]
WantedBy=sysinit.target
