From fc2ac9bf5244de8121f1fc65eb4d168dead4689f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 17 Jan 2011 01:55:09 +0100 Subject: [PATCH] Add systemd unit files --- scripts/systemd/splashy-halt.service | 9 +++++++++ scripts/systemd/splashy-kexec.service | 9 +++++++++ scripts/systemd/splashy-poweroff.service | 9 +++++++++ scripts/systemd/splashy-quit.service | 8 ++++++++ scripts/systemd/splashy-reboot.service | 9 +++++++++ scripts/systemd/splashy-start.service | 8 ++++++++ scripts/systemd/systemd-splashy | 12 ++++++++++++ 7 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 scripts/systemd/splashy-halt.service create mode 100644 scripts/systemd/splashy-kexec.service create mode 100644 scripts/systemd/splashy-poweroff.service create mode 100644 scripts/systemd/splashy-quit.service create mode 100644 scripts/systemd/splashy-reboot.service create mode 100644 scripts/systemd/splashy-start.service create mode 100644 scripts/systemd/systemd-splashy diff --git a/scripts/systemd/splashy-halt.service b/scripts/systemd/splashy-halt.service new file mode 100644 index 0000000..cebb40a --- /dev/null +++ b/scripts/systemd/splashy-halt.service @@ -0,0 +1,9 @@ +[Unit] +Description=Show Splashy Halt Screen +After=getty@tty1.service prefdm.service +Before=halt.service +DefaultDependencies=no + +[Service] +ExecStart=/lib/systemd/systemd-splashy shutdown 'Halting...' +Type=forking diff --git a/scripts/systemd/splashy-kexec.service b/scripts/systemd/splashy-kexec.service new file mode 100644 index 0000000..6aba037 --- /dev/null +++ b/scripts/systemd/splashy-kexec.service @@ -0,0 +1,9 @@ +[Unit] +Description=Show Splashy Reboot with kexec Screen +After=getty@tty1.service prefdm.service +Before=kexec.service +DefaultDependencies=no + +[Service] +ExecStart=/lib/systemd/systemd-splashy shutdown 'Rebooting with kexec...' +Type=forking diff --git a/scripts/systemd/splashy-poweroff.service b/scripts/systemd/splashy-poweroff.service new file mode 100644 index 0000000..b378f99 --- /dev/null +++ b/scripts/systemd/splashy-poweroff.service @@ -0,0 +1,9 @@ +[Unit] +Description=Show Splashy Power Off Screen +After=getty@tty1.service prefdm.service +Before=poweroff.service +DefaultDependencies=no + +[Service] +ExecStart=/lib/systemd/systemd-splashy shutdown 'Powering Off...' +Type=forking diff --git a/scripts/systemd/splashy-quit.service b/scripts/systemd/splashy-quit.service new file mode 100644 index 0000000..10abfd6 --- /dev/null +++ b/scripts/systemd/splashy-quit.service @@ -0,0 +1,8 @@ +[Unit] +Description=Terminate Splashy Boot Screen +Before=getty@tty1.service +After=dev-tty1.device local.service splashy-start.service + +[Service] +ExecStart=-/usr/sbin/splashy_update exit +Type=oneshot diff --git a/scripts/systemd/splashy-reboot.service b/scripts/systemd/splashy-reboot.service new file mode 100644 index 0000000..341dbdd --- /dev/null +++ b/scripts/systemd/splashy-reboot.service @@ -0,0 +1,9 @@ +[Unit] +Description=Show Splashy Reboot Screen +After=getty@tty1.service prefdm.service +Before=reboot.service +DefaultDependencies=no + +[Service] +ExecStart=/lib/systemd/systemd-splashy shutdown 'Rebooting...' +Type=forking diff --git a/scripts/systemd/splashy-start.service b/scripts/systemd/splashy-start.service new file mode 100644 index 0000000..2e77c7a --- /dev/null +++ b/scripts/systemd/splashy-start.service @@ -0,0 +1,8 @@ +[Unit] +Description=Show Splashy Boot Screen +DefaultDependencies=no +After=systemd-vconsole-setup.service udev-settle.service + +[Service] +ExecStart=/lib/systemd/systemd-splashy boot 'Booting...' +Type=forking diff --git a/scripts/systemd/systemd-splashy b/scripts/systemd/systemd-splashy new file mode 100644 index 0000000..2d6e5d2 --- /dev/null +++ b/scripts/systemd/systemd-splashy @@ -0,0 +1,12 @@ +#!/bin/bash + +splashy $1 2>/dev/null +str=$2 +max=1024 +i=0 +while true +do + splashy_update "print $str" 2>/dev/null && break + i=$(($i+1)) + [ $i -gt $max ] && break +done -- 1.7.3.4