From ec1dde68f32d6f304217b777a54aea698f119c13 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 2 Jul 2007 23:27:51 +0000 Subject: * added support for os-plugins: + added script slxos-plugin, which must be invoked to install a plugin into a vendor-OS + added handling of plugins to slxconfig-demuxer + added folder structure for plugins (below 'os-plugins') + implemented one simple plugin, called 'Example' which contains a couple of hints how to write own plugins git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1220 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/Engine.pm | 50 ++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'installer') diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 53fce7c7..9ae3e90a 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -403,6 +403,37 @@ sub startChrootedShellForVendorOS ); } +sub callChrootedFunctionForVendorOS +{ + my $self = shift; + my $function = shift; + + if (!-e $self->{'vendor-os-path'}) { + die _tr( + "can't call chrooted function for vendor-OS '%s', since it doesn't exist!\n", + $self->{'vendor-os-path'} + ); + } + + $self->startLocalURLServersAsNeeded(); + + callInSubprocess( + sub { + $self->changePersonalityIfNeeded(); + $self->callChrootedFunctionInStage1D($function); + } + ); + + $self->touchVendorOS(); + vlog( + 0, + _tr( + "Chrooted function for vendor-OS '%s' has finished.\n", + $self->{'vendor-os-name'} + ) + ); +} + sub removeVendorOS { my $self = shift; @@ -1102,9 +1133,26 @@ sub startChrootedShellInStage1D chrootInto($self->{'vendor-os-path'}); $self->{'meta-packager'}->startSession(); + + # will hang until user exits manually: slxsystem('sh'); - # hangs until user exits manually + $self->{'distro'}->updateDistroConfig(); + $self->{'meta-packager'}->finishSession(); +} + +sub callChrootedFunctionInStage1D +{ + my $self = shift; + my $function = shift; + + chrootInto($self->{'vendor-os-path'}); + + $self->{'meta-packager'}->startSession(); + + # invoke given function: + $function->(); + $self->{'distro'}->updateDistroConfig(); $self->{'meta-packager'}->finishSession(); } -- cgit v1.2.3-55-g7522