summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-20 16:27:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-20 16:27:57 +0000
commit2ec543bbff01fe789af15b9623b5be2c39bcaebd (patch)
tree89cbd5ae9297bff4de4627f1bda713a9079da9d2 /perl-install
parent125c9258c546be4877c0bbed618e10e49bb83368 (diff)
downloaddrakx-2ec543bbff01fe789af15b9623b5be2c39bcaebd.tar
drakx-2ec543bbff01fe789af15b9623b5be2c39bcaebd.tar.gz
drakx-2ec543bbff01fe789af15b9623b5be2c39bcaebd.tar.bz2
drakx-2ec543bbff01fe789af15b9623b5be2c39bcaebd.tar.xz
drakx-2ec543bbff01fe789af15b9623b5be2c39bcaebd.zip
try harder to umount /tmp/hdimage only when needed
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_any.pm11
-rw-r--r--perl-install/install_steps.pm11
2 files changed, 15 insertions, 7 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index bba61987d..f3b6f9be1 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -1046,6 +1046,17 @@ sub remove_bigseldom_used {
);
}
+sub cond_umount_hdimage() {
+ if (cat_("/proc/mounts") =~ m|/\w+/(\S+)\s+/tmp/hdimage\s+(\S+)| && !$::o->{partitioning}{readonly}) {
+ $::o->{stage1_hd} = { device => $1, type => $2 };
+ getFile("XXX"); #- close still opened filehandle
+ eval { fs::umount("/tmp/hdimage") };
+ }
+}
+sub cond_remount_hdimage {
+ my $s = shift || delete $::o->{stage1_hd} or return;
+ fs::mount($s->{device}, '/tmp/hdimage', $s->{type});
+}
################################################################################
package pkgs_interactive;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 8cc7e7175..9f93bc53b 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -125,12 +125,6 @@ sub setupSCSI {
#------------------------------------------------------------------------------
sub doPartitionDisksBefore {
my ($o) = @_;
-
- if (cat_("/proc/mounts") =~ m|/\w+/(\S+)\s+/tmp/hdimage\s+(\S+)| && !$o->{partitioning}{readonly}) {
- $o->{stage1_hd} = { device => $1, type => $2 };
- install_any::getFile("XXX"); #- close still opened filehandle
- eval { fs::umount("/tmp/hdimage") };
- }
eval {
close *pkgs::LOG;
eval { fs::umount("$o->{prefix}/proc") };
@@ -142,6 +136,9 @@ sub doPartitionDisksBefore {
#------------------------------------------------------------------------------
sub doPartitionDisksAfter {
my ($o) = @_;
+
+ install_any::cond_umount_hdimage();
+
if (!$::testing) {
my $hds = $o->{all_hds}{hds};
partition_table::write($_) foreach @$hds;
@@ -177,7 +174,7 @@ sub doPartitionDisksAfter {
$part->{isMounted} ?
do { rmdir "/tmp/hdimage" ; symlinkf("$o->{prefix}$part->{mntpoint}", "/tmp/hdimage") } :
eval {
- fs::mount($s->{device}, "/tmp/hdimage", $s->{type});
+ install_any::cond_remount_hdimage($s);
$part->{isMounted} = 1;
};
}