summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-03-06 00:20:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-03-06 00:20:34 +0000
commit46e89f1a659a034dc1057a087ae8e6afe454f01d (patch)
treebd199ec5fd542f42117f9c1fe997679af4a16945 /perl-install
parentdf126022d1d0bdabedeb677ec31f3fa70aa5525e (diff)
downloaddrakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar.gz
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar.bz2
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar.xz
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.zip
move inittab modifying to any::runlevel
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Xconfigurator.pm9
-rw-r--r--perl-install/any.pm11
-rw-r--r--perl-install/install_steps.pm2
3 files changed, 13 insertions, 9 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 18e9a0e23..614d16e91 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -136,13 +136,6 @@ sub readMonitorsDB {
}
}
-sub rewriteInittab {
- my ($runlevel) = @_;
- my $f = "$prefix/etc/inittab";
- -r $f or log::l("missing inittab!!!"), return;
- substInFile { s/^(id:)[35](:initdefault:)\s*$/$1$runlevel$2\n/ } $f;
-}
-
sub keepOnlyLegalModes {
my ($card, $monitor) = @_;
my $mem = 1024 * ($card->{memory} || ($card->{server} eq 'FBDev' ? 2048 : 99999));
@@ -1195,7 +1188,7 @@ Current configuration is:
my $run = exists $o->{xdm} ? $o->{xdm} : $::auto || $in->ask_yesorno(_("X at startup"),
_("I can set up your computer to automatically start X upon booting.
Would you like X to start when you reboot?"), 1);
- rewriteInittab($run ? 5 : 3) unless $::testing;
+ any::runlevel($prefix, $run ? 5 : 3) unless $::testing;
}
run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone;
}
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 34e51c442..eb6fe6418 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -781,4 +781,15 @@ sub write_passwd_user {
} "$prefix/etc/passwd";
}
+sub runlevel {
+ my ($prefix, $runlevel) = @_;
+ my $f = "$prefix/etc/inittab";
+ -r $f or log::l("missing inittab!!!"), return;
+ if ($runlevel) {
+ substInFile { s/^id:\d:initdefault:\s*$/id:$runlevel:initdefault:\n/ } $f;
+ } else {
+ cat_($f) =~ /^id:(\d):initdefault:\s*$/ && $1;
+ }
+}
+
1;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index c6c26b9b3..fd42d811b 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -765,7 +765,7 @@ sub configureXAfter {
if ($o->{X}{card}{server} eq 'FBDev') {
unless (install_any::setupFB($o, Xconfigurator::getVGAMode($o->{X}))) {
log::l("disabling automatic start-up of X11 if any as setup framebuffer failed");
- Xconfigurator::rewriteInittab(3) unless $::testing; #- disable automatic start-up of X11 on error.
+ any::runlevel($o->{prefix}, 3) unless $::testing; #- disable automatic start-up of X11 on error.
}
}
if ($o->{X}{default_depth} >= 16 && $o->{X}{card}{default_wres} >= 1024) {