Merge pull request #3833 from HiassofT/le92-systemd-debug-console

[le92] systemd: enable switch debug-tty to provide a debug console
This commit is contained in:
MilhouseVH 2019-09-24 20:52:12 +01:00 committed by GitHub
commit 236ea95fd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 53 additions and 101 deletions

View File

@ -222,3 +222,5 @@
# IR remote keymaps supported in default config
IR_REMOTE_KEYMAPS="rc6_mce xbox_360 xbox_one"
# debug tty path
DEBUG_TTY="/dev/tty3"

View File

@ -181,7 +181,6 @@ post_install() {
add_user nobody x 65534 65534 "Nobody" "/" "/bin/sh"
add_group nogroup 65534
enable_service debug-shell.service
enable_service shell.service
enable_service show-version.service
enable_service var.mount

View File

@ -1,25 +0,0 @@
[Unit]
Description=Debug Shell
DefaultDependencies=no
ConditionKernelCommandLine=|tty
ConditionKernelCommandLine=|debugging
ConditionPathExists=|/storage/.cache/debug.libreelec
[Service]
Environment=TTY=3
WorkingDirectory=/storage
ExecStart=/bin/sh -c '. /etc/profile; exec /bin/sh'
Restart=always
RestartSec=0
StandardInput=tty
TTYPath=/dev/tty3
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP
[Install]
WantedBy=sysinit.target

View File

@ -89,6 +89,7 @@ PKG_MESON_OPTS_TARGET="--libdir=/usr/lib \
-Dkmod-path=/usr/bin/kmod \
-Dmount-path=/usr/bin/mount \
-Dumount-path=/usr/bin/umount \
-Ddebug-tty=$DEBUG_TTY \
-Dversion-tag=${PKG_VERSION}"
pre_configure_target() {
@ -128,9 +129,6 @@ post_makeinstall_target() {
safe_remove $INSTALL/usr/lib/udev/rules.d/71-seat.rules
safe_remove $INSTALL/usr/lib/udev/rules.d/73-seat-late.rules
# remove debug-shell.service, we install our own
safe_remove $INSTALL/usr/lib/systemd/system/debug-shell.service
# remove getty units, we dont want a console
safe_remove $INSTALL/usr/lib/systemd/system/autovt@.service
safe_remove $INSTALL/usr/lib/systemd/system/console-getty.service
@ -158,8 +156,19 @@ post_makeinstall_target() {
safe_remove $INSTALL/usr/bin/systemd-nspawn
safe_remove $INSTALL/usr/lib/systemd/system/systemd-nspawn@.service
# remove genetators/catalog
safe_remove $INSTALL/usr/lib/systemd/system-generators
# remove unneeded generators
for gen in $INSTALL/usr/lib/systemd/system-generators/*; do
case "$gen" in
*/systemd-debug-generator)
# keep it
;;
*)
safe_remove "$gen"
;;
esac
done
# remove catalog
safe_remove $INSTALL/usr/lib/systemd/catalog
# remove partition

View File

@ -0,0 +1,27 @@
From 49285dae6756b22bc6881c04939f7c43c35b5506 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Sat, 29 Jun 2019 00:26:41 +0100
Subject: [PATCH] debug-shell: configure environment, unhide cursor
---
units/debug-shell.service.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/units/debug-shell.service.in b/units/debug-shell.service.in
index 1127e68..4c3e971 100644
--- a/units/debug-shell.service.in
+++ b/units/debug-shell.service.in
@@ -16,8 +16,8 @@ IgnoreOnIsolate=yes
ConditionPathExists=@DEBUGTTY@
[Service]
-Environment=TERM=linux
-ExecStart=@SUSHELL@
+Environment=ENV=/etc/profile
+ExecStart=/bin/sh -c 'echo -en "\033[?25h"; exec /bin/sh'
Restart=always
RestartSec=0
StandardInput=tty
--
2.14.1

View File

@ -1,23 +0,0 @@
[Unit]
Description=Debug Shell on /dev/console
DefaultDependencies=no
ConditionKernelCommandLine=console
[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/console
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP
[Install]
WantedBy=sysinit.target

View File

@ -73,3 +73,7 @@
# build with installer (yes / no)
INSTALLER_SUPPORT="no"
# debug tty path
DEBUG_TTY="/dev/console"

View File

@ -1,23 +0,0 @@
[Unit]
Description=Debug Shell on /dev/console
DefaultDependencies=no
ConditionKernelCommandLine=console
[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/console
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP
[Install]
WantedBy=sysinit.target

View File

@ -130,3 +130,6 @@
# for a list of additional drivers see packages/linux-driver-addons
# Space separated list is supported,
DRIVER_ADDONS="crazycat dvb-latest"
# debug tty path
DEBUG_TTY="/dev/console"

View File

@ -1,24 +0,0 @@
[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

View File

@ -79,3 +79,6 @@
# for a list of additinoal drivers see packages/linux-driver-addons
# Space separated list is supported,
DRIVER_ADDONS="dvb-latest"
# debug tty path
DEBUG_TTY="/dev/ttyS2"