systemd: enable switch debug-tty to provide a debug console

This allows us to use the default debug-shell.service provided
by systemd and cut down on custom made services. This will also
always provide a debug shell as there is no reason we shouldn't
have access to one.
This commit is contained in:
Lukas Rusak 2019-02-22 10:52:26 -08:00
parent 4a82fd0f70
commit ec17cea5e6
No known key found for this signature in database
GPG Key ID: 8C310C807E7393A3
10 changed files with 15 additions and 100 deletions

View File

@ -225,3 +225,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

@ -177,7 +177,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

@ -88,7 +88,8 @@ PKG_MESON_OPTS_TARGET="--libdir=/usr/lib \
-Dzshcompletiondir=no \
-Dkmod-path=/usr/bin/kmod \
-Dmount-path=/usr/bin/mount \
-Dumount-path=/usr/bin/umount"
-Dumount-path=/usr/bin/umount \
-Ddebug-tty=$DEBUG_TTY"
pre_configure_target() {
export CFLAGS="$CFLAGS -fno-schedule-insns -fno-schedule-insns2 -Wno-format-truncation"
@ -127,9 +128,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
@ -258,4 +256,5 @@ post_install() {
enable_service usercache.service
enable_service kernel-overlays.service
enable_service hwdb.service
enable_service debug-shell.service
}

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

@ -85,3 +85,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

@ -137,3 +137,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

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