Display the splash screen when shutting down

- Also, turn the HDMI off after a short wait
This commit is contained in:
David Carley
2022-09-01 04:36:24 +00:00
parent cce4e17b49
commit 868258cfa7
6 changed files with 24 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ RUN apt update \
&& apt install -y \
build-essential git wget binfmt-support qemu gcc-9 \
parted gcc-avr avr-libc avrdude python3 python3-pip python3-tornado \
curl unzip python3-setuptools gcc-arm-linux-gnueabihf bc vim locate sudo \
inetutils-ping curl unzip python3-setuptools gcc-arm-linux-gnueabihf bc vim locate sudo \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt install -y nodejs

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Turn off HDMI at powerdown
DefaultDependencies=no
Before=umount.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c ' \
killall xinit \
&& plymouth change-mode --shutdown show-splash \
&& sleep 10s \
&& /usr/bin/vcgencmd display_power 0 '
[Install]
WantedBy=poweroff.target

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bbctrl",
"version": "1.0.10b12",
"version": "1.0.10b15",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bbctrl",
"version": "1.0.10b12",
"version": "1.0.10b15",
"hasInstallScript": true,
"license": "GPL-3.0+",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "bbctrl",
"version": "1.0.10b12",
"version": "1.0.10b15",
"homepage": "https://onefinitycnc.com/",
"repository": "https://github.com/OneFinityCNC/onefinity",
"license": "GPL-3.0+",

View File

@@ -156,6 +156,11 @@ if $UPDATE_PY; then
service bbctrl restart
fi
# Install the service that turns off the screen during shutdown
cp ./installer/config/bbctrl-poweroff.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable bbctrl-poweroff
# Expand the file system if necessary
chmod +x ./installer/scripts/resize_root_fs.sh
./installer/scripts/resize_root_fs.sh

View File

@@ -21,18 +21,12 @@ def call_get_output(cmd):
class RebootHandler(bbctrl.APIHandler):
def put_ok(self):
subprocess.Popen(['plymouth', 'show-splash'])
subprocess.Popen(['plymouth', 'change-mode', '--shutdown'])
subprocess.Popen(['killall', 'xinit'])
subprocess.Popen(['reboot'])
class ShutdownHandler(bbctrl.APIHandler):
def put_ok(self):
subprocess.Popen(['plymouth', 'show-splash'])
subprocess.Popen(['plymouth', 'change-mode', '--shutdown'])
subprocess.Popen(['killall', 'xinit'])
subprocess.Popen(['shutdown', '-h', 'now'])