summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/bootsplash
diff options
context:
space:
mode:
authorMichael Janczyk2008-03-11 18:43:03 +0100
committerMichael Janczyk2008-03-11 18:43:03 +0100
commit1f6874db7ad37a3b2948997ab4919e1ec7ea5100 (patch)
treef33c4c72d9c6f53caeec97ec85f7df730a2a4936 /os-plugins/plugins/bootsplash
parentImplemented suggestion by Sebastian: (diff)
downloadcore-1f6874db7ad37a3b2948997ab4919e1ec7ea5100.tar.gz
core-1f6874db7ad37a3b2948997ab4919e1ec7ea5100.tar.xz
core-1f6874db7ad37a3b2948997ab4919e1ec7ea5100.zip
firts part.
split of theme plugin into bootsplash plugin and displaymanager plugin, both including config files,... and setting theme git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1617 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/bootsplash')
-rw-r--r--os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm161
-rw-r--r--os-plugins/plugins/bootsplash/XX_bootsplash.sh26
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/05-have-kernelvars/bootsplash.sh16
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/15-have-ip-config/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/25-have-network-root/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/40-started-hw-config/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/50-have-layered-fs/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/60-have-servconfig/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/70-before-plugins/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/80-after-plugins/bootsplash.sh1
-rw-r--r--os-plugins/plugins/bootsplash/init-hooks/99-handing-over/bootsplash.sh1
11 files changed, 211 insertions, 0 deletions
diff --git a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm
new file mode 100644
index 00000000..8748dfb2
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm
@@ -0,0 +1,161 @@
+# Copyright (c) 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# bootsplash.pm
+# - implementation of the 'bootsplash' plugin, which installs splashy
+# into the ramfs, including changeing theme
+# -----------------------------------------------------------------------------
+package OpenSLX::OSPlugin::bootsplash;
+
+use strict;
+use warnings;
+
+use base qw(OpenSLX::OSPlugin::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+sub new
+{
+ my $class = shift;
+
+ my $self = {
+ name => 'bootsplash',
+ };
+
+ return bless $self, $class;
+}
+
+sub getInfo
+{
+ my $self = shift;
+
+ return {
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Installs Splashy as bootsplash into ramfs and sets a Theme.
+ End-of-Here
+ mustRunAfter => [],
+ };
+}
+
+sub getAttrInfo
+{
+ my $self = shift;
+
+ return {
+ 'bootsplash::active' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ should the 'bootsplash'-plugin be executed during boot?
+ End-of-Here
+ content_regex => qr{^(0|1)$},
+ content_descr => '1 means active - 0 means inactive',
+ default => '1',
+ },
+ 'bootsplash::precedence' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ the execution precedence of the 'bootsplash' plugin
+ End-of-Here
+ content_regex => qr{^\d\d$},
+ content_descr => 'allowed range is from 01-99',
+ default => 30,
+ },
+
+ 'bootsplash::theme' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ name of the theme to apply to bootsplash (unset for no theme)
+ End-of-Here
+ content_regex => undef,
+ content_descr => undef,
+ default => 'openslx',
+ },
+ };
+}
+
+sub suggestAdditionalKernelParams
+{
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ my @suggestedParams;
+
+ # add vga=0x317 unless explicit vga-mode is already set
+ if (!$makeInitRamFSEngine->haveKernelParam(qr{\bvga=})) {
+ push @suggestedParams, 'vga=0x317';
+ }
+
+ # add quiet, if not already set
+ if (!$makeInitRamFSEngine->haveKernelParam('quiet')) {
+ push @suggestedParams, 'quiet';
+ }
+
+ return @suggestedParams;
+}
+
+sub suggestAdditionalKernelModules
+{
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ my @suggestedModules;
+
+ # Ubuntu needs vesafb and fbcon (which drags along some others)
+ if ($makeInitRamFSEngine->{'distro-name'} =~ m{^ubuntu}i) {
+ push @suggestedModules, qw( vesafb fbcon )
+ }
+
+ return @suggestedModules;
+}
+
+sub copyRequiredFilesIntoInitramfs
+{
+ my $self = shift;
+ my $targetPath = shift;
+ my $attrs = shift;
+ my $makeInitRamFSEngine = shift;
+
+ my $themesDir = "$openslxConfig{'base-path'}/share/themes";
+ my $bootsplashTheme = $attrs->{'bootsplash::theme'} || '';
+ if ($bootsplashTheme) {
+ my $bootsplashThemeDir = "$themesDir/$bootsplashTheme/bootsplash";
+ if (-d $bootsplashThemeDir) {
+ my $splashyPath = "$openslxConfig{'base-path'}/share/splashy";
+ $makeInitRamFSEngine->addCMD(
+ "cp -p $splashyPath/* $targetPath/bin/"
+ );
+ $makeInitRamFSEngine->addCMD(
+ "mkdir -p $targetPath/etc/splashy"
+ );
+ $makeInitRamFSEngine->addCMD(
+ "cp -a $bootsplashThemeDir/* $targetPath/etc/splashy/"
+ );
+ }
+ }
+ else {
+ $bootsplashTheme = '<none>';
+ }
+
+ vlog(
+ 1,
+ _tr(
+ "bootsplash-plugin: bootsplash=%s
+ $bootsplashTheme
+ )
+ );
+
+ return;
+}
+
+1;
diff --git a/os-plugins/plugins/bootsplash/XX_bootsplash.sh b/os-plugins/plugins/bootsplash/XX_bootsplash.sh
new file mode 100644
index 00000000..fc65e6f9
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/XX_bootsplash.sh
@@ -0,0 +1,26 @@
+#! /bin/sh
+#
+# stage3 part of 'bootsplash' plugin - the runlevel script
+#
+. /etc/functions
+. /etc/distro-functions
+. /etc/sysconfig/config
+if [ -e /initramfs/plugin-conf/bootsplash.conf ]; then
+ . /initramfs/plugin-conf/bootsplash.conf
+ if [ $bootsplash_active -ne 0 ]; then
+ if [ ${no_bootsplash} -eq 0 ]; then
+ # make the splashy_update binary available in stage4 ...
+ mkdir -p /mnt/var/lib/openslx/bin
+ cp -a /bin/splashy_update /mnt/var/lib/openslx/bin
+
+ # ... and create a runlevelscript that will stop splashy somewhere near
+ # the end of stage4
+ d_mkrlscript init splashy.stop "Stopping Splashy ..."
+ echo -e "\t/var/lib/openslx/bin/splashy_update exit 2>/dev/null \
+ \n\ttype killall >/dev/null 2>&1 && killall -9 splashy \
+ \n\trm -f /var/lib/openslx/bin/splashy_update 2>/dev/null" \
+ >>/mnt/etc/${D_INITDIR}/splashy.stop
+ d_mkrlscript close splashy.stop ""
+ fi
+ fi
+fi
diff --git a/os-plugins/plugins/bootsplash/init-hooks/05-have-kernelvars/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/05-have-kernelvars/bootsplash.sh
new file mode 100644
index 00000000..392b234e
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/05-have-kernelvars/bootsplash.sh
@@ -0,0 +1,16 @@
+# splashy depends on /proc/fb with VESA
+# only activate with kernel option quiet and no debuglevel
+if grep -E "(VESA|VGA)" /proc/fb > /dev/null 2>&1 \
+ && grep -qi " quiet " /proc/cmdline > /dev/null 2>&1 \
+ && [ $DEBUGLEVEL -eq 0 ] \
+ && [ -e /bin/splashy ] ; then
+ export no_bootsplash=0
+else
+ export no_bootsplash=1
+fi
+
+if [ ${no_bootsplash} -eq 0 ]; then
+ /bin/splashy boot 2>/dev/null
+ # add splashy.stop runlevel script
+ D_SPLASHY=splashy.stop
+fi
diff --git a/os-plugins/plugins/bootsplash/init-hooks/15-have-ip-config/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/15-have-ip-config/bootsplash.sh
new file mode 100644
index 00000000..7d8db91b
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/15-have-ip-config/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 15" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/25-have-network-root/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/25-have-network-root/bootsplash.sh
new file mode 100644
index 00000000..5d2f9a85
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/25-have-network-root/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 25" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/40-started-hw-config/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/40-started-hw-config/bootsplash.sh
new file mode 100644
index 00000000..12affaa4
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/40-started-hw-config/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 40" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/50-have-layered-fs/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/50-have-layered-fs/bootsplash.sh
new file mode 100644
index 00000000..4b7e9c78
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/50-have-layered-fs/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 50" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/60-have-servconfig/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/60-have-servconfig/bootsplash.sh
new file mode 100644
index 00000000..5f6a1f57
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/60-have-servconfig/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 60" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/70-before-plugins/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/70-before-plugins/bootsplash.sh
new file mode 100644
index 00000000..d1b810f6
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/70-before-plugins/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 70" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/80-after-plugins/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/80-after-plugins/bootsplash.sh
new file mode 100644
index 00000000..fa1d0baa
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/80-after-plugins/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 80" >/dev/null 2>&1
diff --git a/os-plugins/plugins/bootsplash/init-hooks/99-handing-over/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/99-handing-over/bootsplash.sh
new file mode 100644
index 00000000..93673915
--- /dev/null
+++ b/os-plugins/plugins/bootsplash/init-hooks/99-handing-over/bootsplash.sh
@@ -0,0 +1 @@
+[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 100" >/dev/null 2>&1