Commit d9ba1553 authored by Andreas Henriksson's avatar Andreas Henriksson

debian/kbd.init: run setterm against /dev/tty1 under systemd

The util-linux setterm program explicitly uses STDIN/STDOUT for some
ioctl based settings. Those ioctls fails if we run setterm under systemd
sanitized environment which has closed stdin/stdout for us. Explicitly
redirect to /dev/tty1 as none of these ioctls seems to be per-vc
specific.
Additionally TERM needs to be specified (either in the environment or
explicitly). Since systemd sanitizes the environment, we give it
explicitly.

Closes: #771161
Thanks: Andreas Trottmann
parent 031e9b15
......@@ -221,7 +221,15 @@ setup ()
setterm_args="$setterm_args -powerdown $POWERDOWN_TIME"
fi
if [ "$setterm_args" ]; then
setterm $setterm_args
if [ -d /run/systemd/system ]; then
# setterm relies on $TERM and STDIN/STDOUT which has been
# sanitized away by systemd, so we use --term and redirect
# input/output.
setterm --term linux $setterm_args \
< ${DEVICE_PREFIX}1 > ${DEVICE_PREFIX}1
else
setterm $setterm_args
fi
fi
# Keyboard rate and delay
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment