forked from OpenDingux/buildroot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Arnout Vandecappelle <[email protected]>
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters