summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/devices.pm7
-rw-r--r--perl-install/install2.pm9
-rw-r--r--perl-install/install_steps.pm45
-rw-r--r--perl-install/install_steps_gtk.pm2
4 files changed, 54 insertions, 9 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index ffc1aeaef..f4bbc0285 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -42,8 +42,11 @@ sub make($) {
if (m,^(.*/(?:dev|tmp))/(.*),) {
$_ = $2;
} else {
- $file = "/tmp/$_";
- -e $file or $file = "/dev/$_";
+ #- lnx4win use a plain swap file, should not assume a leading /tmp or /dev.
+ unless (-f $file) {
+ $file = "/tmp/$_";
+ -e $file or $file = "/dev/$_";
+ }
}
-e $file and return $file; #- assume nobody takes fun at creating files named as device
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 36afc5702..be7c75257 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -279,7 +279,7 @@ sub setupSCSI {
sub partitionDisks {
return
$o->{fstab} = [
- { device => "loop7", type => 0x83, mntpoint => "/", isFormatted => 1, isMounted => 1 },
+ { device => "loop7", type => 0x83, size => ((cat_('/dos/lnx4win/size.txt'))[0]*2048), mntpoint => "/", isFormatted => 1, isMounted => 1 },
{ device => "/initrd/dos/lnx4win/swapfile", type => 0x82, mntpoint => "swap", isFormatted => 1, isMounted => 1 },
] if $o->{lnx4win};
return if $o->{isUpgrade};
@@ -366,10 +366,6 @@ sub choosePackages {
sub doInstallStep {
$o->readBootloaderConfigBeforeInstall if $_[1] == 1;
- #- some packages need such files for proper installation.
- install_any::write_ldsoconf($o->{prefix});
- fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
-
$o->beforeInstallPackages;
$o->installPackages($o->{packages});
$o->afterInstallPackages;
@@ -647,6 +643,9 @@ sub main {
install_any::lnx4win_postinstall($o->{prefix}) if $o->{lnx4win};
install_any::killCardServices();
+ #- make sure failed upgrade will not hurt too much.
+ install_steps::cleanIfFailedUpgrade($o);
+
#- have the really bleeding edge ddebug.log for this f*cking msec :-/
eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") };
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 5f2c4bddd..cbb3ce38e 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -21,6 +21,10 @@ use commands;
use network;
use fs;
+my @filesToSaveForUpgrade = qw(
+/etc/ld.so.conf /etc/fstab /etc/hosts /etc/conf.modules
+);
+
#-######################################################################################
#- OO Stuff
@@ -183,6 +187,21 @@ sub choosePackages($$$$) {
sub beforeInstallPackages {
my ($o) = @_;
+
+ #- save these files in case of upgrade failure.
+ if ($o->{isUpgrade}) {
+ foreach (@filesToSaveForUpgrade) {
+ unlink "$o->{prefix}/$_.mdkgisave";
+ if (-e "$o->{prefix}/$_") {
+ eval { commands::cp("$o->{prefix}/$_", "$o->{prefix}/$_.mdkgisave") };
+ }
+ }
+ }
+
+ #- some packages need such files for proper installation.
+ install_any::write_ldsoconf($o->{prefix});
+ fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
+
network::add2hosts("$o->{prefix}/etc/hosts", "localhost.localdomain", "127.0.0.1");
require pkgs;
pkgs::init_db($o->{prefix}, $o->{isUpgrade});
@@ -303,6 +322,15 @@ GridHeight=70
log::l("moving previous desktop files that have been updated to Trash of each user");
install_any::move_desktop_file($o->{prefix});
}
+
+ #- rename saved files to .mdkgiorig.
+ if ($o->{isUpgrade}) {
+ foreach (@filesToSaveForUpgrade) {
+ if (-e "$o->{prefix}$_.mdkgisave") {
+ unlink "$o->{prefix}$_.mdkgiorig"; rename "$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_.mdkgiorig";
+ }
+ }
+ }
}
#------------------------------------------------------------------------------
@@ -667,7 +695,22 @@ sub miscellaneous {
}
#------------------------------------------------------------------------------
-sub exitInstall { install_any::ejectCdrom }
+sub cleanIfFailedUpgrade($) {
+ my ($o) = @_;
+
+ #- if an upgrade has failed, there should be .mdkgisave files around.
+ if ($o->{isUpgrade}) {
+ foreach (@filesToSaveForUpgrade) {
+ if (-e "$o->{prefix}/$_" && -e "$o->{prefix}/$_.mdkgisave") {
+ rename "$o->{prefix}/$_", "$o->{prefix}/$_.mdkginew"; #- keep new files around in case !
+ rename "$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_";
+ }
+ }
+ }
+}
+
+#------------------------------------------------------------------------------
+sub exitInstall { install_any::ejectCdrom; }
#-######################################################################################
#- Wonderful perl :(
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index eb6741b9c..5c3ad0a7e 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -514,7 +514,7 @@ sub choosePackagesTree {
sub installPackages {
my ($o, $packages) = @_;
- my ($current_total_size, $last_size, $nb, $total_size, $start_time, $last_dtime);
+ my ($current_total_size, $last_size, $nb, $total_size, $start_time, $last_dtime, $trans_progress_total);
my $w = my_gtk->new(_("Installing"), grab => 1);
$w->{window}->set_usize($windowwidth * 0.8, $windowheight * 0.5);