summaryrefslogtreecommitdiffstats
path: root/perl-install/install/steps.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install/steps.pm')
-rw-r--r--perl-install/install/steps.pm62
1 files changed, 40 insertions, 22 deletions
diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm
index 54f322632..0319a6575 100644
--- a/perl-install/install/steps.pm
+++ b/perl-install/install/steps.pm
@@ -1,4 +1,4 @@
-package install::steps; # $Id: steps.pm 268013 2010-04-29 15:02:04Z pterjan $
+package install::steps;
use diagnostics;
use strict;
@@ -126,7 +126,13 @@ sub selectLanguage {
$o->charsetChanged;
addToBeDone {
- lang::write_langs($o->{locale}{langs});
+ if ($o->{isUpgrade}) {
+ #- preserve existing locale settings (mga#24671)
+ $o->{locale} = lang::read();
+ $o->{locale}{langs}{$o->{locale}{lang}} = 1;
+ } else {
+ lang::write_langs($o->{locale}{langs});
+ }
} 'formatPartitions';
addToBeDone {
lang::write_and_install($o->{locale}, $o->do_pkgs);
@@ -176,6 +182,7 @@ sub selectInstallClass {
#------------------------------------------------------------------------------
sub doPartitionDisksBefore {
my ($o) = @_;
+ log::l("fdisk before:\n" . any::fdisk());
eval {
eval { fs::mount::umount("$::prefix/sys/kernel/debug/usb") };
eval { fs::mount::umount("$::prefix/sys") };
@@ -190,16 +197,19 @@ sub doPartitionDisksAfter {
my ($o) = @_;
fs::any::write_hds($o->{all_hds}, $o->{fstab}, !$o->{isUpgrade}, sub { $o->rebootNeeded }, $o);
+ log::l("fdisk after\n" . any::fdisk());
if ($::local_install) {
- my $p = fs::get::mntpoint2part($::prefix, [ fs::read_fstab('', '/proc/mounts') ]);
- my $part = find { fs::get::is_same_hd($p, $_) } @{$o->{fstab}};
- $part ||= $o->{fstab}[0];
+ #- We skipped the setupSCSI step, so $o->{fstab} will be empty. We need to
+ #- add a fake entry, to satisfy the following check for a root partition.
+ my $fstab = [ fs::read_fstab('', '/proc/mounts') ];
+ my $part = fs::get::mntpoint2part($::prefix, $fstab) || $fstab->[0];
$part->{mntpoint} = '/';
$part->{isMounted} = 1;
+ $o->{fstab} = [ $part ];
}
- fs::any::check_hds_boot_and_root($o->{all_hds}, $o->{fstab});
+ fs::any::check_hds_boot_and_root($o->{all_hds}, $o->{fstab}, $o->{isUpgrade}, $o->{match_all_hardware});
if ($o->{partitioning}{use_existing_root}) {
#- ensure those partitions are mounted so that they are not proposed in choosePartitionsToFormat
@@ -369,9 +379,6 @@ sub beforeInstallPackages {
#- some packages need such files for proper installation.
install::any::write_fstab($o);
- require network::network;
- network::network::add2hosts("localhost", "127.0.0.1");
-
#- resolv.conf will be modified at boot time
#- the following will ensure we have a working DNS during install
if (-e "/etc/resolv.conf" && ! -e "$::prefix/etc/resolv.conf") {
@@ -437,6 +444,7 @@ sub installPackages {
my $time = time();
{
local $ENV{DURING_INSTALL} = 1;
+ local $ENV{LOCAL_INSTALL} = 1 if $::local_install;
local $ENV{TMPDIR} = '/tmp';
local $ENV{TMP} = '/tmp';
local $ENV{HOME};
@@ -463,7 +471,7 @@ Either your cdrom drive or your cdrom is defective.
Check the cdrom on an installed computer using \"rpm -qpl media/main/*.rpm\"
") if any { m|read failed: Input/output error| } cat_("$::prefix/root/drakx/install.log");
- if (arch() !~ /^sparc/ && !$o->{justdb}) { #- TODO restore it as may be needed for sparc
+ if (!$o->{justdb}) {
-x "$::prefix/usr/bin/dumpkeys" or $::testing or die
"Some important packages did not get installed properly.
@@ -486,7 +494,15 @@ Consoles 1,3,4,7 may also contain interesting information";
harddrake::autoconf::cpufreq();
harddrake::autoconf::floppy();
- #- for mageia_firstime
+ # prevent slow boot on first boot:
+ my $cfg_file = "$::prefix/etc/sysconfig/harddrake2/kernel";
+ if (-f $cfg_file) {
+ my %kernel_config = getVarsFromSh($cfg_file);
+ $kernel_config{IS_LAPTOP} = bool2text(detect_devices::isLaptop());
+ setVarsInSh($cfg_file, \%kernel_config);
+ }
+
+ #- for mandrake_firstime
touch "$::prefix/var/lock/TMP_1ST";
fs::any::set_cdrom_symlink($o->{all_hds}{raw_hds});
@@ -496,11 +512,6 @@ Consoles 1,3,4,7 may also contain interesting information";
#- else if eth0 is not existing, glibc segfaults.
substInFile { s/\s*wins// if /^\s*hosts\s*:/ } "$::prefix/etc/nsswitch.conf";
- #- make sure some services have been enabled (or a catastrophic restart will occur).
- #- these are normally base package post install scripts or important services to start.
- run_program::rooted($::prefix, "chkconfig", "--add", $_) foreach
- qw(netfs network rawdevices sound kheader keytable syslog crond portmap);
-
if ($o->{mouse}{device} =~ /ttyS/) {
log::l("disabling gpm for serial mice (does not get along nicely with X)");
run_program::rooted($::prefix, "chkconfig", "--del", "gpm");
@@ -697,7 +708,14 @@ sub configureTimezone {
my ($o) = @_;
install::any::preConfigureTimezone($o);
- $o->pkg_install('ntp') if $o->{timezone}{ntp};
+ if ($o->{timezone}{ntp}) {
+ # We prefer chrony, but we'll deal with ntpd for the sake of upgrades
+ my $pkg = install::pkgs::packageByName($o->{packages}, 'chrony');
+ unless ($pkg && $pkg->flag_installed) {
+ $pkg = install::pkgs::packageByName($o->{packages}, 'ntp');
+ $o->pkg_install('chrony') unless $pkg && $pkg->flag_installed;
+ }
+ }
require timezone;
timezone::write($o->{timezone});
@@ -745,7 +763,7 @@ sub addUser {
$autologin->{user} = $o->{autologin};
$autologin->{desktop} = $o->{desktop} if $o->{desktop};
$autologin->{dm} = $o->{dm} if $o->{dm};
- any::set_autologin($o->do_pkgs, $autologin);
+ any::set_autologin($o->do_pkgs, $autologin, $o->{step}{auto});
}
install::any::disable_user_view() if @$users == ();
@@ -848,7 +866,7 @@ sub exitInstall {
};
output("$::prefix/root/drakx/package_list.pl", install::any::selected_leaves_pl($o));
- eval { install::any::getAndSaveAutoInstallFloppies($o, 1) } if arch() !~ /^ppc/;
+ eval { install::any::getAndSaveAutoInstallFloppies($o, 1) };
eval { output "$::prefix/root/drakx/README", sprintf("This directory contains several installation-related files,
mostly log files (very useful if you ever report a bug!).
@@ -907,8 +925,8 @@ sub upNetwork {
start_network_interface($o);
return 1;
} elsif (!$b_pppAvoided) {
- log::l("starting network (ppp: $o->{net}{type})");
- eval { modules::load(qw(serial ppp bsd_comp ppp_deflate)) };
+ log::l("starting network (PPP: $o->{net}{type})");
+ eval { modules::load(qw(serial bsd_comp ppp_deflate)) };
run_program::rooted($::prefix, "/etc/rc.d/init.d/syslog", "start");
start_network_interface($o);
return 1;
@@ -932,7 +950,7 @@ sub downNetwork {
} elsif (!network_is_cheap($o)) {
stop_network_interface($o);
run_program::rooted($::prefix, "/etc/rc.d/init.d/syslog", "stop");
- eval { modules::unload(qw(ppp_deflate bsd_comp ppp serial)) };
+ eval { modules::unload(qw(ppp_deflate bsd_comp serial)) };
return 1;
}
}