kumquat-buildroot/package/petitboot/pb-console
Reza Arbab f7c2b6fefd package/petitboot: run petitboot UI on consoles
Display the petitboot UI instead of a login prompt, allowing the
configuration of custom tty(s) as we do for the login prompt.

petitboot already depends on udev, so let's use it instead of rcS to
launch pb-console. This has the advantage of easily wildcarding the list
of ttys ("hvc*") and enables hotplug devices ("ttyUSB0").

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2023-11-05 19:04:41 +01:00

37 lines
701 B
Bash

#!/bin/sh
DAEMON="pb-console"
PB_CONSOLE_PORT=${2:-"console"}
PB_CONSOLE_ARGS="--getty --detach -- -n -i 0 $PB_CONSOLE_PORT linux"
# shellcheck source=/dev/null
[ -r "/etc/default/petitboot" ] && . "/etc/default/petitboot"
start() {
printf 'Starting %s on %s: ' "$DAEMON" "$PB_CONSOLE_PORT"
mkdir -p /var/log/petitboot
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -S -q -x "/usr/libexec/petitboot/$DAEMON" \
-- $PB_CONSOLE_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
case "$1" in
start)
"$1";;
stop|restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart|reload} [port]"
exit 1
;;
esac