From b20d62cf6f8493cc79c9e8b25e39d2bb5bbd735b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 28 Aug 2000 21:59:42 +0000 Subject: no_comment --- perl-install/fs.pm | 13 +------------ perl-install/install_steps.pm | 12 ++++++++---- perl-install/sbus_probing/main.pm | 1 + 3 files changed, 10 insertions(+), 16 deletions(-) (limited to 'perl-install') diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 9185b980b..bbef90222 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -223,23 +223,12 @@ sub umount($) { log::l("calling umount($mntpoint)"); syscall_('umount', $mntpoint) or die _("error unmounting %s: %s", $mntpoint, "$!"); - my @mtab = cat_('/etc/mtab'); #- don't care about error, if we can't read, we won't manage to write... (and mess mtab) - local *F; - open F, ">/etc/mtab" or return; - foreach (@mtab) { print F $_ unless /(^|\s)$mntpoint\s/; } + substInFile { $_ = '' if /(^|\s)$mntpoint\s/ } '/etc/mtab'; #- don't care about error, if we can't read, we won't manage to write... (and mess mtab) } sub mount_part($;$$) { my ($part, $prefix, $rdonly) = @_; - if ($part->{realMntpoint} eq "/tmp/hdimage") { - my $dir = "$prefix$part->{mntpoint}"; - $dir =~ s|/+$||; - log::l("special hd case ($dir)"); - rmdir $dir; - symlink "/tmp/hdimage", $dir; - return; - } #- root carrier's link can't be mounted loopback::carryRootCreateSymlink($part, $prefix); diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index d74e33b94..b8e4d07c6 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -127,7 +127,7 @@ sub doPartitionDisksBefore { my ($o) = @_; if (cat_("/proc/mounts") =~ m|/\w+/(\S+)\s+/tmp/hdimage\s+(\S+)| && !$o->{partitioning}{readonly}) { - $o->{stage1_hd} = { dev => $1, fs => $2 }; + $o->{stage1_hd} = { device => $1, type => $2 }; install_any::getFile("XXX"); #- close still opened filehandle eval { fs::umount("/tmp/hdimage") }; } @@ -143,13 +143,17 @@ sub doPartitionDisksAfter { partition_table::write($_) foreach @{$o->{hds}}; $_->{rebootNeeded} and $o->rebootNeeded foreach @{$o->{hds}}; } - if (my $s = delete $o->{stage1_hd}) { - eval { fs::mount($s->{dev}, "/tmp/hdimage", $s->{fs}) }; - } $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}, $o->{raid}) ]; fsedit::get_root($o->{fstab}) or die "Oops, no root partition"; + if (my $s = delete $o->{stage1_hd}) { + my ($part) = grep { $_->{device} eq $s->{device} } @{$o->{fstab}}; + $part->{isMounted} ? + symlinkf("$o->{prefix}$part->{mntpoint}", "/tmp/hdimage") : + eval { fs::mount($s->{dev}, "/tmp/hdimage", $s->{fs}) }; + } + cat_("/proc/mounts") =~ m|(\S+)\s+/tmp/rhimage nfs| && !grep { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{manualFstab} || []} and push @{$o->{manualFstab}}, { type => "nfs", mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,rsize=8192,wsize=8192" }; diff --git a/perl-install/sbus_probing/main.pm b/perl-install/sbus_probing/main.pm index 9282d8d90..238540fe2 100644 --- a/perl-install/sbus_probing/main.pm +++ b/perl-install/sbus_probing/main.pm @@ -2,6 +2,7 @@ package sbus_probing::main; use c; use log; +use common qw(:common); use modules; my %sbus_table_network = ( -- cgit v1.2.1