summaryrefslogtreecommitdiffstats
path: root/src/os-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/os-plugins')
-rw-r--r--src/os-plugins/plugins/plymouth/OpenSLX/OSPlugin/plymouth.pm152
-rw-r--r--src/os-plugins/plugins/plymouth/XX_plymouth.sh31
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/default.plymouth8
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.pngbin0 -> 173 bytes
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.pngbin0 -> 196 bytes
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_banner_trans.pngbin0 -> 15730 bytes
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_logo_trans.pngbin0 -> 4309 bytes
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.plymouth9
-rw-r--r--src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script37
-rw-r--r--src/os-plugins/plugins/plymouth/init-hooks/00-started/plymouth.sh22
-rw-r--r--src/os-plugins/plugins/plymouth/init-hooks/40-started-hw-config/plymouth.sh4
11 files changed, 263 insertions, 0 deletions
diff --git a/src/os-plugins/plugins/plymouth/OpenSLX/OSPlugin/plymouth.pm b/src/os-plugins/plugins/plymouth/OpenSLX/OSPlugin/plymouth.pm
new file mode 100644
index 00000000..34b6241c
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/OpenSLX/OSPlugin/plymouth.pm
@@ -0,0 +1,152 @@
+# Copyright (c) 2007..2011 - 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/
+# -----------------------------------------------------------------------------
+# plymouth.pm
+# -----------------------------------------------------------------------------
+package OpenSLX::OSPlugin::plymouth;
+
+use strict;
+use warnings;
+
+use base qw(OpenSLX::OSPlugin::Base);
+
+use File::Path;
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+use OpenSLX::DistroUtils;
+
+sub new
+{
+ my $class = shift;
+
+ my $self = {
+ name => 'plymouth',
+ };
+
+ return bless $self, $class;
+}
+
+sub getInfo
+{
+ my $self = shift;
+
+ return {
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Splashscreen for the boot process using plymouth.
+ End-of-Here
+ precedence => 30,
+ };
+}
+
+sub getAttrInfo
+{
+ my $self = shift;
+
+ return {
+ 'plymouth::active' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ should the plymouth-plugin be executed during boot?
+ End-of-Here
+ content_regex => qr{^(0|1)$},
+ content_descr => '1 means active - 0 means inactive',
+ default => '1',
+ },
+
+ 'plymouth::theme' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ name of the theme to apply to plymouth (default unifr-rz)
+ End-of-Here
+ content_regex => undef,
+ content_descr => undef,
+ default => 'unifr-rz',
+ },
+ };
+}
+
+sub suggestAdditionalKernelParams
+{
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ my @suggestedParams;
+
+ # add quiet, if not already set
+ if (!$makeInitRamFSEngine->haveKernelParam('quiet')) {
+ push @suggestedParams, 'quiet';
+ }
+
+ # add splash, required by plymouth to start correctly
+ if (!$makeInitRamFSEngine->haveKernelParam('splash')) {
+ push @suggestedParams, 'splash';
+ }
+
+ return @suggestedParams;
+}
+
+sub suggestAdditionalKernelModules
+{
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ my @suggestedModules;
+
+ push @suggestedModules, qw( drm drm_ms_helper ch7006 sil164 i810 i830 i915 mga nouveau r128 radeon savage sis tdfx ttm via );
+
+ return @suggestedModules;
+}
+
+sub installationPhase
+{
+ my $self = shift;
+ my $info = shift;
+
+ return;
+}
+
+sub removalPhase
+{
+ my $self = shift;
+ my $info = shift;
+
+ return;
+}
+
+
+sub copyRequiredFilesIntoInitramfs
+{
+ my $self = shift;
+ my $targetPath = shift;
+ my $attrs = shift;
+ my $makeInitRamFSEngine = shift;
+
+ # TODO: multi-theme support
+
+ my $plymouthDir = "$openslxConfig{'base-path'}/lib/plugins/plymouth";
+ my $plymouthTheme = $attrs->{'plymouth::theme'} || '';
+ my $themeDir = '';
+
+ if ($plymouthTheme) {
+ $themeDir = "$plymouthDir/files/lib/plymouth/themes/$plymouthTheme";
+ }
+
+ $makeInitRamFSEngine->addCMD(
+ "cp -p $plymouthDir/files/lib/plymouth/themes/default.plymouth $targetPath/lib/plymouth/themes
+ cp -rp $themeDir $targetPath/lib/plymouth/themes"
+ );
+
+ return;
+}
+
+1;
diff --git a/src/os-plugins/plugins/plymouth/XX_plymouth.sh b/src/os-plugins/plugins/plymouth/XX_plymouth.sh
new file mode 100644
index 00000000..f9927eae
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/XX_plymouth.sh
@@ -0,0 +1,31 @@
+# Copyright (c) 2007..2008 - RZ Uni Freiburg
+# Copyright (c) 2008 - 2009 OpenSLX GmbH
+#
+# This program/file 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 feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# stage3 part of 'plymouth' plugin
+#
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
+
+if [ -e /initramfs/plugin-conf/plymouth.conf ]; then
+ . /initramfs/plugin-conf/plymouth.conf
+ if [ $plymouth_active -ne 0 ]; then
+ [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'plymouth' plugin...";
+
+ if [ -f /mnt/etc/init/kdm.conf ];
+ then
+ sed 's/exec kdm/plymouth quit \n exec kdm/g' -i /mnt/etc/init/kdm.conf
+ else
+ sed 's/exec kdm/plymouth quit \n exec kdm/g' -i /mnt/etc/init.inactive/kdm.conf
+ fi
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with the 'plymouth' plugin...";
+ fi
+fi
+
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/default.plymouth b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/default.plymouth
new file mode 100644
index 00000000..bc669108
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/default.plymouth
@@ -0,0 +1,8 @@
+[Plymouth Theme]
+Name=Uni-Freiburg Basic Theme
+Description=Uni-Freiburg simple blue-ish theme with simple progress bar
+ModuleName=script
+
+[script]
+ImageDir=/lib/plymouth/themes/unifr-rz
+ScriptFile=/lib/plymouth/themes/unifr-rz/unifr-rz.script
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png
new file mode 100644
index 00000000..dd1e747a
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png
Binary files differ
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png
new file mode 100644
index 00000000..c485cfbc
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png
Binary files differ
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_banner_trans.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_banner_trans.png
new file mode 100644
index 00000000..9cb68040
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_banner_trans.png
Binary files differ
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_logo_trans.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_logo_trans.png
new file mode 100644
index 00000000..16b069cc
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/rz_logo_trans.png
Binary files differ
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.plymouth b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.plymouth
new file mode 100644
index 00000000..0f300f6b
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.plymouth
@@ -0,0 +1,9 @@
+[Plymouth Theme]
+Name=Simple RZ Theme
+Description=Simple blue RZ theme with progress bar.
+ModuleName=script
+
+[script]
+ImageDir=/lib/plymouth/themes/unifr-rz
+ScriptFile=/lib/plymouth/themes/unifr-rz/unifr-rz.script
+
diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script
new file mode 100644
index 00000000..00b6970a
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script
@@ -0,0 +1,37 @@
+Window.SetBackgroundTopColor(0.00, 0.21, 0.57);
+#Window.SetBackgroundBottomColor(0.00, 0.17, 0.95);
+
+title_left_image = Image("rz_banner_trans.png");
+title_right_image = Image("rz_logo_trans.png");
+title_left_sprite = Sprite(title_left_image);
+title_right_sprite = Sprite(title_right_image);
+screen_width = Window.GetWidth();
+
+title_right_sprite.SetX(screen_width - title_right_image.GetWidth());
+
+#----------------------------------------- Progress Bar --------------------------------
+
+progress_box.image = Image("progress_box.png");
+progress_box.sprite = Sprite(progress_box.image);
+
+progress_box.x = Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
+progress_box.y = Window.GetHeight() * 0.75 - progress_box.image.GetHeight() / 2;
+progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0);
+
+progress_bar.original_image = Image("progress_bar.png");
+progress_bar.sprite = Sprite();
+
+progress_bar.x = Window.GetWidth() / 2 - progress_bar.original_image.GetWidth() / 2;
+progress_bar.y = Window.GetHeight() / 2 * 1.5 - progress_box.image.GetHeight() / 2 + (progress_box.image.GetHeight() - progress_bar.original_image.GetHeight()) / 2;
+progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1);
+
+fun progress_callback (duration, progress)
+ {
+ if (progress_bar.image.GetWidth () != Math.Int (progress_bar.original_image.GetWidth () * progress))
+ {
+ progress_bar.image = progress_bar.original_image.Scale(progress_bar.original_image.GetWidth(progress_bar.original_image) * progress, progress_bar.original_image.GetHeight());
+ progress_bar.sprite.SetImage (progress_bar.image);
+ }
+ }
+
+Plymouth.SetBootProgressFunction(progress_callback);
diff --git a/src/os-plugins/plugins/plymouth/init-hooks/00-started/plymouth.sh b/src/os-plugins/plugins/plymouth/init-hooks/00-started/plymouth.sh
new file mode 100644
index 00000000..ab8c9346
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/init-hooks/00-started/plymouth.sh
@@ -0,0 +1,22 @@
+ ( hwinfo --gfxcard >/etc/hwinfo.gfxcard
+ case $(cat /etc/hwinfo.gfxcard) in
+ *i915*)
+ modprobe -a ${MODPRV} i915 2>/dev/null
+ ;;
+ *intel*|*Intel*)
+ modprobe -a ${MODPRV} i810 i830 i915 2>/dev/null
+ ;;
+ *nvidia*|*NVidia*|*nouveau*)
+ modprobe ${MODPRV} nouveau 2>/dev/null
+ ;;
+ *radeon*|*Radeon*)
+ modprobe ${MODPRV} radeon 2>/dev/null
+ ;;
+ *mga*|*matrox*|*Matrox*)
+ modprobe ${MODPRV} mga 2>/dev/null
+ ;;
+ *)
+ modprobe -a ${MODPRV} r128 savage sis tdfx ttm via
+ ;;
+ esac
+ modprobe -a drm fbcon; mdev -s ) &
diff --git a/src/os-plugins/plugins/plymouth/init-hooks/40-started-hw-config/plymouth.sh b/src/os-plugins/plugins/plymouth/init-hooks/40-started-hw-config/plymouth.sh
new file mode 100644
index 00000000..97094a07
--- /dev/null
+++ b/src/os-plugins/plugins/plymouth/init-hooks/40-started-hw-config/plymouth.sh
@@ -0,0 +1,4 @@
+plymouthd && plymouth show-splash
+
+echo "Plymouth init hook successfully called!" >> /tmp/plymouth.log
+echo "Plymouth init hook successfully called!"