summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorBastian Wissler2008-03-18 15:53:09 +0100
committerBastian Wissler2008-03-18 15:53:09 +0100
commit17c48c0a1dd32c65336b27139d36f62368240514 (patch)
treeeb11896f03e2ffd6b03c071622691e88ccdbe73b /os-plugins
parent* Heavily worked at OSPlugin::Engine and 'desktop'-plugin. Support for stage1 (diff)
downloadcore-17c48c0a1dd32c65336b27139d36f62368240514.tar.gz
core-17c48c0a1dd32c65336b27139d36f62368240514.tar.xz
core-17c48c0a1dd32c65336b27139d36f62368240514.zip
Changes to vmchooser-plugin, import of binary
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1651 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm62
-rw-r--r--os-plugins/plugins/vmchooser/XX_vmchooser.sh15
-rwxr-xr-xos-plugins/plugins/vmchooser/files/vmchooserbin0 -> 499912 bytes
3 files changed, 76 insertions, 1 deletions
diff --git a/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm b/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm
index 406e18e6..adbc5557 100644
--- a/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm
+++ b/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm
@@ -39,8 +39,9 @@ sub getInfo
return {
description => unshiftHereDoc(<<' End-of-Here'),
allows user to pick from a list of different virtual machine images
+ based on xml-files, which tell about available images.
End-of-Here
- mustRunAfter => [],
+ mustRunAfter => []
};
}
@@ -72,4 +73,63 @@ sub getAttrInfo
};
}
+
+sub installationPhase
+{ # called while chrooted to the vendor-OS root in order to give the plugin
+ # a chance to install required files into the vendor-OS.
+ my $self = shift;
+
+ my $pluginRepositoryPath = shift;
+ # The folder where the stage1-plugin should store all files
+ # required by the corresponding stage3 runlevel script.
+ # As this method is being executed while chrooted into the vendor-OS,
+ # this path is relative to that root (i.e. directly usable).
+ my $pluginTempPath = shift;
+ # A temporary playground that will be cleaned up automatically.
+ # As this method is being executed while chrooted into the vendor-OS,
+ # this path is relative to that root (i.e. directly usable).
+ my $openslxPath = shift;
+ # the openslx base path bind-mounted into the chroot (/mnt/openslx)
+
+ # for this example plugin, we simply create two files:
+ spitFile("$pluginRepositoryPath/right", "(-;\n");
+ spitFile("$pluginRepositoryPath/left", ";-)\n");
+
+ # Some plugins have to copy files from their plugin folder into the
+ # vendor-OS. In order to make this possible while chrooted, the host's
+ # /opt/openslx folder will be mounted to /mnt/openslx in the vendor-OS.
+ # So each plugin could copy some files like this:
+ #
+
+ # get our own name:
+ my $pluginName = $self->{'name'};
+
+
+ # get our own base path:
+ my $pluginBasePath = "/mnt/openslx/lib/plugins/$pluginName";
+
+ # copy all needed files now:
+ foreach my $file ( qw( vmchooser ) ) {
+ copyFile("$pluginBasePath/$file", "$pluginRepositoryPath/");
+ }
+
+ # name of current os
+ # $self->{'os-plugin-engine'}->{'vendor-os-name'}
+
+ return;
+}
+
+sub removalPhase
+{ # called while chrooted to the vendor-OS root in order to give the plugin
+ # a chance to uninstall no longer required files from the vendor-OS.
+ my $self = shift;
+ my $pluginRepositoryPath = shift;
+ # the repository folder, relative to the vendor-OS root
+ my $pluginTempPath = shift;
+ # the temporary folder, relative to the vendor-OS root
+
+ return;
+}
+
1;
+
diff --git a/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
new file mode 100644
index 00000000..0f9521b8
--- /dev/null
+++ b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
@@ -0,0 +1,15 @@
+
+CONFFILE="/initramfs/plugin-conf/vmchooser.conf"
+
+if [ -e $CONFFILE ]; then
+ . $CONFFILE
+ if [ $vmchooser_active -ne 0 ]; then
+ [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'example' os-plugin ...";
+
+ # for this example plugin, we simply take a filename from the
+ # configuration and cat that file (output the smiley):
+ cat /mnt/opt/openslx/plugin-repo/example/$preferred_side
+
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with 'example' os-plugin ...";
+ fi
+fi \ No newline at end of file
diff --git a/os-plugins/plugins/vmchooser/files/vmchooser b/os-plugins/plugins/vmchooser/files/vmchooser
new file mode 100755
index 00000000..b57e07b6
--- /dev/null
+++ b/os-plugins/plugins/vmchooser/files/vmchooser
Binary files differ