summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorOliver Tappe2007-06-19 17:49:36 +0200
committerOliver Tappe2007-06-19 17:49:36 +0200
commit9929f7ca1f4316fc66feab3539be4d7576769b78 (patch)
treee5d8a8a7765657898bdc7c0b0497dc96445323bb /installer
parent* Added glibc-locale in order to allow use of locale-support in target (diff)
downloadcore-9929f7ca1f4316fc66feab3539be4d7576769b78.tar.gz
core-9929f7ca1f4316fc66feab3539be4d7576769b78.tar.xz
core-9929f7ca1f4316fc66feab3539be4d7576769b78.zip
* added support for invoking a chrooted shell for any installed vendor-OS,
in order to simplify doing any manual changes to the vendor-OS. invoke 'slxos-setup shell <vendor-os>' to start the chrooted shell git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1175 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer')
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm37
-rwxr-xr-xinstaller/slxos-setup17
2 files changed, 54 insertions, 0 deletions
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index 4d313e73..6064ce6f 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -304,6 +304,25 @@ sub updateVendorOS
$self->{'vendor-os-name'});
}
+sub startChrootedShellForVendorOS
+{
+ my $self = shift;
+
+ if (!-e $self->{'vendor-os-path'}) {
+ die _tr("can't start chrooted shell for vendor-OS '%s', since it doesn't exist!\n",
+ $self->{'vendor-os-path'});
+ }
+
+ $self->startLocalURLServersAsNeeded();
+
+ callInSubprocess( sub {
+ $self->changePersonalityIfNeeded();
+ $self->startChrootedShellInStage1D();
+ });
+ vlog 0, _tr("Chrooted shell for vendor-OS '%s' has been closed.\n",
+ $self->{'vendor-os-name'});
+}
+
sub removeVendorOS
{
my $self = shift;
@@ -910,6 +929,24 @@ sub updateStage1D
$self->stage1D_updateBasicVendorOS();
}
+sub startChrootedShellInStage1D
+{
+ my $self = shift;
+
+ vlog 0, "starting chrooted shell for $self->{'vendor-os-name'}";
+ vlog 0, "---------------------------------------";
+ vlog 0, "- please type 'exit' if you are done! -";
+ vlog 0, "---------------------------------------";
+
+ chrootInto($self->{'vendor-os-path'});
+
+ $self->{'meta-packager'}->startSession();
+ slxsystem('sh');
+ # hangs until user exits manually
+ $self->{'distro'}->updateDistroConfig();
+ $self->{'meta-packager'}->finishSession();
+}
+
sub stage1D_setupPackageSources()
{
my $self = shift;
diff --git a/installer/slxos-setup b/installer/slxos-setup
index 1d6a0201..381de5b3 100755
--- a/installer/slxos-setup
+++ b/installer/slxos-setup
@@ -95,6 +95,18 @@ if ($action =~ m[^import]i) {
or die _tr("can't chdir to script-path <%> (%s)", $FindBin::RealBin, $!);
$engine->initialize($vendorOSName, 'update');
$engine->updateVendorOS();
+} elsif ($action =~ m[^shell]i) {
+ my $vendorOSName = shift @ARGV;
+ if (!defined $vendorOSName) {
+ print STDERR _tr("You need to give the name of the vendor-os you'd like to start of shell for!\n");
+ pod2usage(2);
+ }
+ # we chdir into the script's folder such that all relative paths have
+ # a known starting point:
+ chdir($FindBin::RealBin)
+ or die _tr("can't chdir to script-path <%> (%s)", $FindBin::RealBin, $!);
+ $engine->initialize($vendorOSName, 'update');
+ $engine->startChrootedShellForVendorOS();
} elsif ($action =~ m[^install]i) {
my $vendorOSName = shift @ARGV;
if (!defined $vendorOSName) {
@@ -155,6 +167,7 @@ if ($action =~ m[^import]i) {
list-supported
list-installed
remove
+ shell
update
Try '%s --help' for more info.\n", $0);
}
@@ -204,6 +217,10 @@ show supported distros
removes an installed vendor-OS
+=item B<< shell <vendor-os-name> >>
+
+starts a chrooted shell for an installed vendor-OS
+
=item B<< update <vendor-os-name> >>
updates an installed vendor-OS