From a09ae66ee443c6fcdba032542b905abe15c700dd Mon Sep 17 00:00:00 2001 From: Haggai Eran Date: Mon, 25 May 2015 22:38:02 +0300 Subject: [PATCH] projects/RPi*: add serial console service Add a console shell for debugging a Raspberry Pi. The shell is added conditionally if the console parameter appears in the kernel command line. The service file follows the template provided by stefansaraev [1]. [1] http://sprunge.us/cBdT --- .../lib/systemd/system/serial-console.service | 21 +++++++++++++++++++ .../lib/systemd/system/serial-console.service | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 projects/RPi/filesystem/usr/lib/systemd/system/serial-console.service create mode 100644 projects/RPi2/filesystem/usr/lib/systemd/system/serial-console.service diff --git a/projects/RPi/filesystem/usr/lib/systemd/system/serial-console.service b/projects/RPi/filesystem/usr/lib/systemd/system/serial-console.service new file mode 100644 index 0000000000..d70e3df75f --- /dev/null +++ b/projects/RPi/filesystem/usr/lib/systemd/system/serial-console.service @@ -0,0 +1,21 @@ +[Unit] +Description=Debug Shell on /dev/console +DefaultDependencies=no +ConditionKernelCommandLine=console + +[Service] +WorkingDirectory=/storage +ExecStart=/bin/sh -c '. /etc/profile; exec /bin/sh' +Restart=always +RestartSec=0 +StandardInput=tty +TTYPath=/dev/console +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +# bash ignores SIGTERM +KillSignal=SIGHUP + +[Install] +WantedBy=sysinit.target diff --git a/projects/RPi2/filesystem/usr/lib/systemd/system/serial-console.service b/projects/RPi2/filesystem/usr/lib/systemd/system/serial-console.service new file mode 100644 index 0000000000..d70e3df75f --- /dev/null +++ b/projects/RPi2/filesystem/usr/lib/systemd/system/serial-console.service @@ -0,0 +1,21 @@ +[Unit] +Description=Debug Shell on /dev/console +DefaultDependencies=no +ConditionKernelCommandLine=console + +[Service] +WorkingDirectory=/storage +ExecStart=/bin/sh -c '. /etc/profile; exec /bin/sh' +Restart=always +RestartSec=0 +StandardInput=tty +TTYPath=/dev/console +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +# bash ignores SIGTERM +KillSignal=SIGHUP + +[Install] +WantedBy=sysinit.target