diff options
author | Sebastian Schmelzer | 2009-08-11 19:21:45 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2009-08-11 19:21:45 +0200 |
commit | 62b370dea8406f300678d11a30ddca3410079bfb (patch) | |
tree | fb1c26c70d69dcf127260b9a0a6e01337c17a15a /os-plugins | |
parent | One link to mkdosfs is enough ... (diff) | |
download | core-62b370dea8406f300678d11a30ddca3410079bfb.tar.gz core-62b370dea8406f300678d11a30ddca3410079bfb.tar.xz core-62b370dea8406f300678d11a30ddca3410079bfb.zip |
distroutils demo code
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3079 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r-- | os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm | 30 | ||||
-rw-r--r-- | os-plugins/plugins/bootsplash/XX_bootsplash.sh | 26 |
2 files changed, 35 insertions, 21 deletions
diff --git a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm index da820230..db18f1a4 100644 --- a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm +++ b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm @@ -23,6 +23,7 @@ use File::Path; use OpenSLX::Basics; use OpenSLX::Utils; +use OpenSLX::DistroUtils; sub new { @@ -120,9 +121,37 @@ sub installationPhase $self->{pluginRepositoryPath} = $info->{'plugin-repo-path'}; $self->{openslxBasePath} = $info->{'openslx-base-path'}; + my $splashyBinPath = "$self->{openslxBasePath}/lib/plugins/bootsplash/files/bin"; my $pluginRepoPath = "$self->{pluginRepositoryPath}"; + + my $initFile = newInitFile(); + my $do_stop = unshiftHereDoc(<<" End-of-Here"); + /opt/openslx/plugin-repo/bootsplash/bin/splashy shutdown + sleep 1 + /opt/openslx/plugin-repo/bootsplash/bin/splashy_update \\ + "progress 100\" 2>/dev/null + End-of-Here + + # add helper function to initfile + # first parameter name of the function + # second parameter content of the function + $initFile->addFunction('do_stop', $do_stop); + + # place a call of the helper function in the stop block + # of the init file + # first parameter name of the function + # second parameter name of the block + $initFile->addFunctionCall('do_stop', 'stop'); + + my $distro = (split('-',$self->{'os-plugin-engine'}->distroName()))[0]; + + # write initfile to filesystem + spitFile( + "$pluginRepoPath/bootsplash.halt", + getInitFileForDistro($initFile, ucfirst($distro)) + ); # copy splashy(_update) into plugin-repo folder mkpath("$pluginRepoPath/bin"); @@ -148,6 +177,7 @@ sub removalPhase return; } + sub copyRequiredFilesIntoInitramfs { my $self = shift; diff --git a/os-plugins/plugins/bootsplash/XX_bootsplash.sh b/os-plugins/plugins/bootsplash/XX_bootsplash.sh index 8e878e63..924d304c 100644 --- a/os-plugins/plugins/bootsplash/XX_bootsplash.sh +++ b/os-plugins/plugins/bootsplash/XX_bootsplash.sh @@ -26,28 +26,12 @@ if [ -e /initramfs/plugin-conf/bootsplash.conf ]; then \n\ttype killall >/dev/null 2>&1 && killall -9 splashy" \ >>/mnt/etc/init.d/splashy.boot d_mkrlscript close splashy.boot "" - # create a runlevelscript that will start splashy on halt/reboot - # fixme: should be done distro specific (in bootsplash.pm, see #474) - echo '#!/bin/sh' >>/mnt/etc/init.d/splashy.halt - echo -e ". /etc/rc.status \ - \n. /etc/sysconfig/logfile \ - \nrc_reset \ - \ncase \"\$1\" in \ - \n\tstart) \ - \n\t\t;; \ - \n\tstop) \ - \n\t\t/opt/openslx/plugin-repo/bootsplash/bin/splashy shutdown \ - \n\t\tsleep 1 \ - \n\t\tLD_LIBRARY_PATH=/opt/openslx/uclib-rootfs/lib/ \ - /opt/openslx/plugin-repo/bootsplash/bin/splashy_update \ - \"progress 100\" 2>/dev/null \ - \n\t\t;; \ - \nesac \ - \nrc_exit" \ - >>/mnt/etc/init.d/splashy.halt - chmod 744 /mnt/etc/init.d/splashy.halt + + cp /mnt/opt/openslx/plugin-repo/bootsplash/bootsplash.halt \ + /mnt/etc/init.d/bootsplash.halt + chmod 744 /mnt/etc/init.d/bootsplash.halt cp -a /etc/splashy /mnt/etc/ - rllinker "splashy.halt" 1 1 + rllinker "bootsplash.halt" 1 1 fi fi fi |