From c732cc5cd3b18c13908deb1dfdc0343fd4135a2f Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Thu, 27 Mar 2008 17:03:55 +0000 Subject: New plugin concept: Default theme and splashy binaries moved to plugin. Makefile modified: removed copy of splashy, theme dir shouldn't be copied either after display theme and pxe theme have been moved as well. Added support of own themes in config-path/plugins/bootsplash/themes. New init-hooks added, not really necessary. A few cosmetic corrections ->styleguide git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1702 95ad53e4-c205-0410-b2fa-d234c58c8868 --- Makefile | 2 - .../bootsplash/OpenSLX/OSPlugin/bootsplash.pm | 25 +++- os-plugins/plugins/bootsplash/XX_bootsplash.sh | 33 +++-- os-plugins/plugins/bootsplash/files/bin/splashy | Bin 0 -> 1973148 bytes .../plugins/bootsplash/files/bin/splashy_update | Bin 0 -> 4048 bytes .../bootsplash/files/themes/openslx/config.xml | 12 ++ .../files/themes/openslx/themes/openslx/blank.ttf | 0 .../themes/openslx/themes/openslx/openslx.png | Bin 0 -> 62522 bytes .../files/themes/openslx/themes/openslx/theme.xml | 138 +++++++++++++++++++++ .../init-hooks/05-have-kernelvars/bootsplash.sh | 8 +- .../init-hooks/15-have-ip-config/bootsplash.sh | 2 +- .../init-hooks/25-have-network-root/bootsplash.sh | 2 +- .../init-hooks/40-started-hw-config/bootsplash.sh | 2 +- .../init-hooks/60-have-servconfig/bootsplash.sh | 2 +- .../init-hooks/70-before-plugins/bootsplash.sh | 2 +- .../init-hooks/80-after-plugins/bootsplash.sh | 2 +- .../init-hooks/85-have-initial-boot/bootsplash.sh | 1 + .../init-hooks/90-postinit-done/bootsplash.sh | 1 + .../bootsplash/init-hooks/95-cleanup/bootsplash.sh | 1 + theming/openslx/bootsplash/config.xml | 12 -- .../openslx/bootsplash/themes/openslx/blank.ttf | 0 .../openslx/bootsplash/themes/openslx/openslx.png | Bin 62522 -> 0 bytes .../openslx/bootsplash/themes/openslx/theme.xml | 138 --------------------- tools/splashy | Bin 1973148 -> 0 bytes tools/splashy_update | Bin 4048 -> 0 bytes 25 files changed, 199 insertions(+), 184 deletions(-) create mode 100755 os-plugins/plugins/bootsplash/files/bin/splashy create mode 100755 os-plugins/plugins/bootsplash/files/bin/splashy_update create mode 100644 os-plugins/plugins/bootsplash/files/themes/openslx/config.xml create mode 100644 os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/blank.ttf create mode 100644 os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/openslx.png create mode 100644 os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/theme.xml create mode 100644 os-plugins/plugins/bootsplash/init-hooks/85-have-initial-boot/bootsplash.sh create mode 100644 os-plugins/plugins/bootsplash/init-hooks/90-postinit-done/bootsplash.sh create mode 100644 os-plugins/plugins/bootsplash/init-hooks/95-cleanup/bootsplash.sh delete mode 100644 theming/openslx/bootsplash/config.xml delete mode 100644 theming/openslx/bootsplash/themes/openslx/blank.ttf delete mode 100644 theming/openslx/bootsplash/themes/openslx/openslx.png delete mode 100644 theming/openslx/bootsplash/themes/openslx/theme.xml delete mode 100755 tools/splashy delete mode 100755 tools/splashy_update diff --git a/Makefile b/Makefile index 6ebfb50f..b40c8b32 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,6 @@ supported."; \ -p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/tpm \ -p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/initramfs \ -p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/busybox \ - -p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/splashy \ -p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs \ -p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/ramfstools \ -p $(SLX_BUILD_PATH)$(SLX_PRIVATE_PATH)/config/default/initramfs \ @@ -204,7 +203,6 @@ supported."; \ $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/busybox/; \ cp -pP tools/{ddcprobe,915resolution}{,.x86_64,.i586} \ $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/ramfstools; \ - cp -p tools/splashy{,_update} $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/splashy/; \ cp -p tools/mksquashfs $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/; \ cd initramfs/tpm; tar --exclude=.svn -cp * | \ tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/tpm/; \ diff --git a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm index aab314ea..efffed0e 100644 --- a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm +++ b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm @@ -19,6 +19,8 @@ use warnings; use base qw(OpenSLX::OSPlugin::Base); +use File::Path; + use OpenSLX::Basics; use OpenSLX::Utils; @@ -30,6 +32,8 @@ sub new name => 'bootsplash', }; + mkpath("$openslxConfig{'config-path'}/plugins/bootsplash/themes"); + return bless $self, $class; } @@ -116,20 +120,31 @@ sub copyRequiredFilesIntoInitramfs my $attrs = shift; my $makeInitRamFSEngine = shift; - my $themeDir = "$openslxConfig{'base-path'}/share/themes"; + my $bootsplashDir = "$openslxConfig{'base-path'}/lib/plugins/bootsplash"; + my $bootsplashConfigDir = "$openslxConfig{'config-path'}/plugins/bootsplash"; my $bootsplashTheme = $attrs->{'bootsplash::theme'} || ''; + my $splashyThemeDir = ''; + if ($bootsplashTheme) { - my $bootsplashThemeDir = "$themeDir/$bootsplashTheme/bootsplash"; + my $bootsplashThemeDir = "$bootsplashDir/files/themes/$bootsplashTheme"; + my $altThemeDir = "$bootsplashConfigDir/themes/$bootsplashTheme"; if (-d $bootsplashThemeDir) { - my $splashyPath = "$openslxConfig{'base-path'}/share/splashy"; + $splashyThemeDir = "$bootsplashThemeDir"; + } + elsif (-d $altThemeDir) { + $splashyThemeDir = "$altThemeDir"; + } + if (-d $splashyThemeDir) { + my $splashyPath = "$bootsplashDir/files/bin"; +print "6. $splashyPath"; $makeInitRamFSEngine->addCMD( - "cp -p $splashyPath/* $targetPath/bin/" + "cp -p $splashyPath/splashy* $targetPath/bin/" ); $makeInitRamFSEngine->addCMD( "mkdir -p $targetPath/etc/splashy" ); $makeInitRamFSEngine->addCMD( - "cp -a $bootsplashThemeDir/* $targetPath/etc/splashy/" + "cp -a $splashyThemeDir/* $targetPath/etc/splashy/" ); } } diff --git a/os-plugins/plugins/bootsplash/XX_bootsplash.sh b/os-plugins/plugins/bootsplash/XX_bootsplash.sh index 4a27dafa..10a3abc2 100644 --- a/os-plugins/plugins/bootsplash/XX_bootsplash.sh +++ b/os-plugins/plugins/bootsplash/XX_bootsplash.sh @@ -6,21 +6,20 @@ . /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 ... - testmkd /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 + . /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 ... + testmkd /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/files/bin/splashy b/os-plugins/plugins/bootsplash/files/bin/splashy new file mode 100755 index 00000000..ad5b0ad2 Binary files /dev/null and b/os-plugins/plugins/bootsplash/files/bin/splashy differ diff --git a/os-plugins/plugins/bootsplash/files/bin/splashy_update b/os-plugins/plugins/bootsplash/files/bin/splashy_update new file mode 100755 index 00000000..0a7be6c8 Binary files /dev/null and b/os-plugins/plugins/bootsplash/files/bin/splashy_update differ diff --git a/os-plugins/plugins/bootsplash/files/themes/openslx/config.xml b/os-plugins/plugins/bootsplash/files/themes/openslx/config.xml new file mode 100644 index 00000000..16080a07 --- /dev/null +++ b/os-plugins/plugins/bootsplash/files/themes/openslx/config.xml @@ -0,0 +1,12 @@ + + + + + /etc/splashy/themes + + openslx + + /etc/splashy/themes/openslx + /etc/splashy/splashy.pid + /dev/.initramfs/splashy.fifo + diff --git a/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/blank.ttf b/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/blank.ttf new file mode 100644 index 00000000..e69de29b diff --git a/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/openslx.png b/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/openslx.png new file mode 100644 index 00000000..62fc1320 Binary files /dev/null and b/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/openslx.png differ diff --git a/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/theme.xml b/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/theme.xml new file mode 100644 index 00000000..d3c9bb1b --- /dev/null +++ b/os-plugins/plugins/bootsplash/files/themes/openslx/themes/openslx/theme.xml @@ -0,0 +1,138 @@ + + + + + + openslx + 0.1 + ... + http:// + Author <author@mail.com> + + + + + 0 + 42 + 100 + 17 + + + + 128 + 147 + 161 + 255 + + + + no + + 0 + 0 + 0 + 0 + + + + + + 240 + 240 + 240 + 255 + + + + forward + backward + forward + backward + + + yes + yes + yes + yes + + + + + openslx.png + openslx.png + openslx.png + openslx.png + openslx.png + + + + 0 + 0 + 0 + 0 + + + + + no + + + 1 + 61 + 98 + 38 + + + + 0 + 0 + 0 + 0 + + + + no + + 0 + 0 + 0 + 0 + + + + + + blank.ttf + 2 + + + + 62 + 93 + 114 + 0 + + + + no + no + no + 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 index 392b234e..657ae1e4 100644 --- a/os-plugins/plugins/bootsplash/init-hooks/05-have-kernelvars/bootsplash.sh +++ b/os-plugins/plugins/bootsplash/init-hooks/05-have-kernelvars/bootsplash.sh @@ -4,13 +4,13 @@ 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 + 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 + /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 index 7d8db91b..8df98b22 100644 --- 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 @@ -1 +1 @@ -[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 15" >/dev/null 2>&1 +[ ${no_bootsplash} -eq 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 index 5d2f9a85..be6ac567 100644 --- 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 @@ -1 +1 @@ -[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 25" >/dev/null 2>&1 +[ ${no_bootsplash} -eq 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 index 12affaa4..d5fc62ec 100644 --- 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 @@ -1 +1 @@ -[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 40" >/dev/null 2>&1 +[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 40" >/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 index 5f6a1f57..9c3bd20f 100644 --- a/os-plugins/plugins/bootsplash/init-hooks/60-have-servconfig/bootsplash.sh +++ b/os-plugins/plugins/bootsplash/init-hooks/60-have-servconfig/bootsplash.sh @@ -1 +1 @@ -[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 60" >/dev/null 2>&1 +[ ${no_bootsplash} -eq 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 index d1b810f6..fcd0c410 100644 --- a/os-plugins/plugins/bootsplash/init-hooks/70-before-plugins/bootsplash.sh +++ b/os-plugins/plugins/bootsplash/init-hooks/70-before-plugins/bootsplash.sh @@ -1 +1 @@ -[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 70" >/dev/null 2>&1 +[ ${no_bootsplash} -eq 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 index fa1d0baa..0abfa5b2 100644 --- a/os-plugins/plugins/bootsplash/init-hooks/80-after-plugins/bootsplash.sh +++ b/os-plugins/plugins/bootsplash/init-hooks/80-after-plugins/bootsplash.sh @@ -1 +1 @@ -[ ${no_bootsplash} = 0 ] && /bin/splashy_update "progress 80" >/dev/null 2>&1 +[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 80" >/dev/null 2>&1 diff --git a/os-plugins/plugins/bootsplash/init-hooks/85-have-initial-boot/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/85-have-initial-boot/bootsplash.sh new file mode 100644 index 00000000..8738e454 --- /dev/null +++ b/os-plugins/plugins/bootsplash/init-hooks/85-have-initial-boot/bootsplash.sh @@ -0,0 +1 @@ +[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 85" >/dev/null 2>&1 diff --git a/os-plugins/plugins/bootsplash/init-hooks/90-postinit-done/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/90-postinit-done/bootsplash.sh new file mode 100644 index 00000000..2546d298 --- /dev/null +++ b/os-plugins/plugins/bootsplash/init-hooks/90-postinit-done/bootsplash.sh @@ -0,0 +1 @@ +[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 90" >/dev/null 2>&1 diff --git a/os-plugins/plugins/bootsplash/init-hooks/95-cleanup/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/95-cleanup/bootsplash.sh new file mode 100644 index 00000000..5ff86715 --- /dev/null +++ b/os-plugins/plugins/bootsplash/init-hooks/95-cleanup/bootsplash.sh @@ -0,0 +1 @@ +[ ${no_bootsplash} -eq 0 ] && /bin/splashy_update "progress 95" >/dev/null 2>&1 diff --git a/theming/openslx/bootsplash/config.xml b/theming/openslx/bootsplash/config.xml deleted file mode 100644 index 16080a07..00000000 --- a/theming/openslx/bootsplash/config.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - /etc/splashy/themes - - openslx - - /etc/splashy/themes/openslx - /etc/splashy/splashy.pid - /dev/.initramfs/splashy.fifo - diff --git a/theming/openslx/bootsplash/themes/openslx/blank.ttf b/theming/openslx/bootsplash/themes/openslx/blank.ttf deleted file mode 100644 index e69de29b..00000000 diff --git a/theming/openslx/bootsplash/themes/openslx/openslx.png b/theming/openslx/bootsplash/themes/openslx/openslx.png deleted file mode 100644 index 62fc1320..00000000 Binary files a/theming/openslx/bootsplash/themes/openslx/openslx.png and /dev/null differ diff --git a/theming/openslx/bootsplash/themes/openslx/theme.xml b/theming/openslx/bootsplash/themes/openslx/theme.xml deleted file mode 100644 index d3c9bb1b..00000000 --- a/theming/openslx/bootsplash/themes/openslx/theme.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - openslx - 0.1 - ... - http:// - Author <author@mail.com> - - - - - 0 - 42 - 100 - 17 - - - - 128 - 147 - 161 - 255 - - - - no - - 0 - 0 - 0 - 0 - - - - - - 240 - 240 - 240 - 255 - - - - forward - backward - forward - backward - - - yes - yes - yes - yes - - - - - openslx.png - openslx.png - openslx.png - openslx.png - openslx.png - - - - 0 - 0 - 0 - 0 - - - - - no - - - 1 - 61 - 98 - 38 - - - - 0 - 0 - 0 - 0 - - - - no - - 0 - 0 - 0 - 0 - - - - - - blank.ttf - 2 - - - - 62 - 93 - 114 - 0 - - - - no - no - no - diff --git a/tools/splashy b/tools/splashy deleted file mode 100755 index ad5b0ad2..00000000 Binary files a/tools/splashy and /dev/null differ diff --git a/tools/splashy_update b/tools/splashy_update deleted file mode 100755 index 0a7be6c8..00000000 Binary files a/tools/splashy_update and /dev/null differ -- cgit v1.2.3-55-g7522